Hi all, I connected to Apilio customer care, who suggested to drop my question here I am a noob regarding these things: I cannot manage tocreate a routine in Apilio that does the trick for me.
Can you get the status of the light (or the socket, if you use one) via the Tuya app? Because then you could build a toggle button (and you don’t use a double press)
Does the switch itself distinguish single and double presses? (if you can apply different logic to the buttons in the Tuya app, then it probably does).
Hi there, thanks for thinking along. Please read below.
1. Can you get the status of the light (or the socket, if you use one) via the Tuya app? Because then you could build a toggle button (and you don’t use a double press)
No I can’t. The Smart Life app doesn’t support Philips Hue smart lights last I 've heared. I don’t use a smart socket. After some searching I find out people who want to control their Hue lights via Smart Life, they use Apilio.
2. Does the switch itself distinguish single and double presses? (if you can apply different logic to the buttons in the Tuya app, then it probably does).
@dennisdevogt You probably can connect the Philips Hue bulbs with the Tuya Zigbee hub (at least basic functionality works, I have tested that once). But I guess you want to keep the Hue ecosystem, so this path is not a good option.
When I use this link I see all my Hue lights and all my Tuya switches. What I need to know is how to make a routine. How do I set this up in this Apilio system?
Hi @dennisdevogt,
we first need to learn a bit how those switches work. Once that’s clear, building the automation is probably no problem.
So next, open the detail screen of your device, click on “Edit” and then move all toggles for device attributes to “Monitor in Apilio”.
After saving it, you can use the switch and see what data arrives in Apilio.
E.g. do a single click, reload the device page and take a note of the value that was registered. Then do the same for a double click.
I assume that you want a single click to toggle the lights on or off, so you need to keep track of the current status of the light. If that is the case, you can use Apilio variables to hold the on/off status and so act on that every time the button is pressed.
To do this, for each individual switch. create a boolean variable “switch_x_status” (for a 4 switch box you can make 4 versions)
Use a Tuya condition “switch_x_pressed” for the switch that triggers on single press
Create a logicblock “do_switch_x_pressed” that is executed when the tuya condition switch_x_pressed changes
For the action, use a webhook to update your switch_x_status by toggling the value
Create a boolean condition “is_switch_x_TRUE” that tests whether switch_x_status is TRUE
Create a logicblock “turn_on_off_light_x” that triggers depending on is_switch_x_TRUE
For the action on TRUE, switch on your light
For the action on FALSE, switch off your light