A Python Package for Interacting with SmartThings
Project description
Python SmartThings
Version | Stage |
---|---|
1.0.0 | Release |
This purpose for the creation of this package is twofold. The main reason I created this package is to be able to issue commands to my Z-Wave devices via my SmartThings Hub from a RaspberryPi running Falcon Player software. The other reason for the creation of this package is to further my knowledge of the Python programming language.
Dependencies
- Python >=3.7
- Packages
- requests
Installation
pip3 install python-smartthings
How to Use
Import package to project.
import SmartThings
Create an instance of a SmartThings account using your Personal Access Token.
Vist https://account.smartthings.com/tokens to create or revoke Personal Access Tokens.
ST = SmartThings.Account(PERSONAL_ACCESS_TOKEN)
After creating an instance of the Account class, three dictionaries will be created from API requests.
ST.locations # {LOCATION_NAME:LOCATION_ID}
ST.devices # {LOCATION_NAME:{DEVICE_NAME:DEVICE_ID}}
ST.scenes # {LOCATION_NAME:{SCENE_NAME:SCENE_ID}}
These dictionaries can be used with the included methods to execute actions on devices and scenes.
ST.control_device(ST.devices[LOCATION_NAME][DEVICE_NAME], capability=None, command=None, arguments=None)
# Reference the SmartThings API documentation for information regarding the
# format of capabilities, commands, and arguments
ST.execute_scene(ST.scenes[LOCATION_NAME][DEVICE_NAME])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python-smartthings-1.0.0.tar.gz
.
File metadata
- Download URL: python-smartthings-1.0.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eed6b8e5e10c4d337098c4b11af8b394c7e0df68b04ee64ca06ce72ba00b2161 |
|
MD5 | e4df64e1fdaaa7dafb145a4cae8f83b6 |
|
BLAKE2b-256 | 1a6211a375350efa6fd344bfa44283b69f7db7792ab46e3ad830adbb21e3aedd |
File details
Details for the file python_smartthings-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: python_smartthings-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f980c3cc26932874bc5d4a6ae9e1a5cf809fffafa9f2b64a3ea6f1fd45d85d72 |
|
MD5 | c5ffa54b1f7b05d40eb7b0274ac8d29d |
|
BLAKE2b-256 | 9bdb906eb5612b83120b1e4adfa1025009a8760e4fca17f864fc73d3546185be |