You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 tinytuya
c = tinytuya.Cloud(
apiRegion="xx",
apiKey="xxxxxx",
apiSecret="xxxxxx")
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?
importtinytuyac=tinytuya.Cloud(
apiRegion="xx",
apiKey="xxxxxx",
apiSecret="xxxxxx"
)
device_id="xxxxxx"# Replace this with your actual device IDcommands= {
'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.
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: