Can someone help me with an on/off representation of a particular switch in a sitemap?
I have a push button that controls ON (PushON) and another button that controls OFF (PushOFF) to control a light. I need to send an ON command to one of them to turn on or off the light:
PushON.sendCommand(ON) //turns ON the light
PushOFF.sendCommand(ON) //turns OFF the light
Is there a possibility to have one single switch button in a sitemap that when toggled left it sends ON to PushON and when toggled right it sends ON to PushOFF?
rule "proxy light"
when Item proxy_light received command
then if (receivedCommand == ON) {
PushON.sendCommand(ON)
}
if (receivedCommand == OFF) {
PushOFF.sendCommand(ON)
}
end
Hi,
I’m trying to follow this example, but I can’t get i working. I’m new to openHAB and using Visual Studio.
I’ve created an item files “switch.items” and inserted the switch command, it seems to work, since I can find it in the PaperUI.
The rule doesn’t seem to work, it says there are 2 problems, the problems are PushON and PushOFF. It’s like it’s not included in the library or something like that?
The sitemap is a little confusing too, but I’ve tried to follow guides, don’t know if it works since the rule is not working.
It would be very helpful if I could see screenshots of the different files. I think this could be helpfull to all who just start with openHab, since the “demo” is very big and confusing.
PushON and PushOFF are two example Items. The original poster wanted one line on his sitemap that could eventually send commands to either of them.
I guess you don’t have those Items defined.
Okay, you are probably starting at the wrong end of the stick.
I would suggest trying to follow the Yeelight binding documentation to end up with your lamp represented as an Item in openHAB.
At that stage, you should be able to at least see it the admin PaperUI, and move on to creating a sitemap to be used with the end-user BasicUI.
If you have problems with that, best to start your own new thread, since this has little to do with simulating pushbuttons via a rule.