Python scripts that allow me to control Tuya-compatible smart Wi-Fi light bulbs & sockets at home.
Read setup here, then it should be pretty clear how to use this script.
I'm storing values in constants.py
file which is excluded from this repo but you can hardcode these values if you want.
In:
device = tinytuya.OutletDevice(constants.Lampki_device_ID, constants.Lampki_device_IP, constants.Lampki_device_key) # device = Lampki
replace:
constants.Lampki_device_ID
to yourdevice_ID
, eg.00000000000000000000
constants.Lampki_device_IP
to yourdevice_IP
, eg.192.168.1.200
constants.Lampki_device_key
to yourdevice_key
, eg.ab0000abc00bbaaa
so it looks like this:
device = tinytuya.OutletDevice('00000000000000000000', '192.168.1.200', 'ab0000abc00bbaaa') # device = Lampki
All these values can be taken from Wizard, see more here.
- Turn on a device 🟢
- Turn off a device 🔴
- 0.1: Initial release with 4 devices; sensitive variables were hidden in another file.
Using SemVer.
- tinytuya
- Tuya IoT Platform
- How to get a value from a nested dictionary
- Save secret stuff in a different file
If you found a bug or want to propose a feature, feel free to visit the Issues page.