How to use switch-on and set-timer function in one go #442
vvmichielvv
started this conversation in
General
Replies: 1 comment 2 replies
-
Hi @vvmichielvv , thanks for the kind note! A huge credit to @uzlonewolf for the incredible protocol engineering and for the context of your request, the new function If you know the DP values you need to set for your device (perhaps this) you just create a dictionary of the DPS index and values. I believe something like this would work: # Set the DPS values
dps = {}
dps["1"] = True
dps["9"] = 1800
# Request the settings
set_multiple_values(dps) Test it and let us know how it goes. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Jason,
Thanks so much for all your efforts in keeping tuya controls up to date. I am a long time happy user of your code.
One question: I have a use case of switching on a heater for say 30mins and then automatically switch it off. I use a Tuya socket switch for that which works. However, it has sometimes trouble with its wifi connection. I want to absolutely make sure the socket switches off after 30 mins. If it hasn't switched on, then that is ok.
Is there any way in having ONE network call to the Tuya switch in which both the 'switch on' and 'set timer' DPs are set? That way, either nothing is switched (bad reception) or both on and off, but it never stays on. Is this with 'set_multiple_values' and is there a simple example that works?
regards, Michiel
Beta Was this translation helpful? Give feedback.
All reactions