HTTP Switch is great. What it lacks is the ability to “force” turning a switch on or off (in case, say, the switch was turned on by means other than ST.) @btrial’s solution was to create two momentary buttons (see here).
Now I’m trying to combine both. So basically 3 buttons. One to toggle on/off. The other two to “force” the switch to turn on/off regardless of the switch’s state. This is my first DTH, so any guidance would be appreciated. Here’s what I have so far:
I’m just abstracting from all the commands, etc. for now and try to focus on the interface. This is how I understand it works:
- There’s a parameter
switch
that could take value “on” or “off”. Thetoggle
tile reads this value and sets the background color, label, and action accordingly. - When
on()
is called, it sets this parameter to “on”… this should supposedly change thetoggle
andvalue_tile
tiles… but somehow they don’t change. - The only change I see comes from putting in
nextState
. - The
xxx
is just there since I don’t know what to put there.
Thanks a lot!