-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cloud command #485
Labels
tuya_iot_cloud
Support questions for getting local key and Tuya Cloud APIs.
Comments
I suspect the countdown command expects you want to turn on the device until countdown is reached at which it will turn it off. Have you tried just sending the countdown? import tinytuya
c = tinytuya.Cloud(
apiRegion="xx",
apiKey="xxxxxx",
apiSecret="xxxxxx"
)
device_id = "xxxxxx" # Replace this with your actual device ID
commands = {
'commands': [
{'code': 'countdown_1', 'value': 0}
]
}
result = c.sendcommand(device_id, commands) You can poke around the iot.tuya.com developer portal to see if gives any guidance. I would also try different combinations of sequencing different commands to see what they do. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using Cloud.py example, whenever i put a value other than 0 on countdown_1, the result always toggles state regardless of switch_1 'value' (True or False).
My project: i created two batch commands to run cloud_on, cloud_off, but after some delay of 30 seconds.
It could be better to use only one py file and check with If state and arguments but i am not familiar to do this.
import
tinytuyac = tinytuya.Cloud(
apiRegion="xx",
apiKey="xxxxxx",
apiSecret="xxxxxx")
id = "xxxxxx"
commands = {
'commands': [{
'code': 'switch_1',
'value': False
}, {
'code': 'countdown_1',
'value': 0
}]
}
result = c.sendcommand(id,commands)`
The text was updated successfully, but these errors were encountered: