In rule machine, it only says open and close
We need a little more information. What device driver are you using? What button are you using? If the driver reports the state of your curtain (open or closed), then a simple "if" statement would either open or close your curtain based on current state.
You could use button controller and the conditional action option @Pantheon suggested, checking the current state of the curtain and doing the opposite command,
Or a very simple "toggle" command that would either open or close based on current state. That is if you only want fully open or fully closed.
If (curtain is open) {
Close curtain
} else {
Open curtain
}
There is no toggle command I can find
I was not sure about a toggle command. Then @lairdknox 's code is my choice.
It exists for switches. Maybe not showing because of the device type. The IF > Else option shown should do the trick if you cannot choose Toggle Switch.
It’s not but thx for the alternatives
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.