Pull power and state data from Tuya WiFi smart devices
Project description
TuyaPower - PyPi Module
Author: Jason A. Cox https://github.com/jasonacox/tuyapower
Description
Python module to pull power and state data from Tuya WiFi smart devices.
Preparation
sudo apt-get install python-crypto python-pip
pip install pycrypto
pip install pytuya
pip install Crypto # some systems will need this
pip install pyaes # some systems will need this
Usage:
import tuyapower
PLUGID = '01234567891234567890'
PLUGIP = '10.0.1.99'
PLUGKEY = '0123456789abcdef'
DEVICEVERS = '3.1'
(on, w, mA, V, err) = tuyapower.deviceInfo(PLUGID,PLUGIP,PLUGKEY,PLUGVERS)
Parameters:
- id = Device ID e.g. 01234567891234567890
- ip = Device IP Address e.g. 10.0.1.99
- key = Device Key e.g. 0123456789abcdef
- vers = Version of Protocol 3.1 or 3.3
Response Data:
- on = Switch state - true or false
- w = Wattage
- mA = milliamps
- V = Voltage
- err = Error message or OK
Note: If error occurs, on will be set to false, w, mA and V will be set to -99.0.
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
tuyapower-0.0.2.tar.gz
(1.6 kB
view details)
Built Distribution
File details
Details for the file tuyapower-0.0.2.tar.gz
.
File metadata
- Download URL: tuyapower-0.0.2.tar.gz
- Upload date:
- Size: 1.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92eb9be651b70cd8fc5d42eb04f05f8782a3d802d5bcc79c8ddeb86386e2ff35 |
|
MD5 | 88a27f165fe425a43f3d787f9250fb16 |
|
BLAKE2b-256 | 443ae9c887a741bcdd610961d41e2fe29bccf17ed32626d555fccae9db8e27b3 |
File details
Details for the file tuyapower-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: tuyapower-0.0.2-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 916fca868ab17c59d27414b3cf7b77cc1d76befe2d2f8a7c504f30eaeef35fe9 |
|
MD5 | 93ad0fbf43dd48289f4dd5e03111f353 |
|
BLAKE2b-256 | e730365f130ae2cb11670c8277b8fb379894e8493bfe04cc41b6dfe0369ce312 |