Using the TuyaSmart url request to create an API with Flask and Python3 to turn on/off you own switch
- Buy WiFi TECKIN 16A 3300W
- Download Tuya Smart APP in your mobile
- Pair device with your mobile APP
- Change with your credentials
data={
"userName": "[email protected]", # change with your email Tuya Smart APP
"password": "xxxxxxxxxx", # change with your password Tuya Smart APP
"countryCode": "1",
"bizType": "tuya",
"from": "tuya",
}
- Get you ID device
5.1 Edit you device
5.2 Device information
5.3 Copy ID Virtual and paste into switchId value
switchId = "xxxxxxxxxxx"
pip3 install -r requirements.txt
To switch on/off
python3 main.py
MIT