Java Runtime Environment: which java platform is used and what version
openHAB version: 2.5.4
Issue of the topic:
Hi, I’ve got 3 individual switch items configured. One that can turn a computer on via Wake-On LAN, one that can check if the computer is online via ping, and a third that can turn the computer off via an SSH exec (the target computer is running linux)
They all seem to work (and the first Wake On-LAN one also seems to monitor it via ping)
The Wake-On LAN binding seems to indicate that you can combine it with an Exec command however my understanding is the Wake-On LAN binding is a legacy (v1) binding and that the method to combine them is now different. https://www.openhab.org/addons/bindings/wol1/
Do I need to create some kind of virtual switch or rule or something else?
I guess I’m having trouble getting my head around the “switch” concept. Does a switch have an action for both on and off? They feel more like buttons (press and it does X) rather than switches having an on and an off currently.
That’s it. It is an action.
in openHAB, Item commands and states are two different, um, things.
When you poke a UI graphic it issues a command to the Item.
Bindings like WOL listen for commands, and may do stuff with them. In WOL case, it sends a wakeup for command ON and ignores any other command.
Bindings like network process incoming information and issue state updates to an Item.
Switches happen to have states and available commands with the same name.
Items like Dimmers can be different, e.g. command ON but state is always numeric like 100%.
Have a review of your events.log and it may make more sense.
Thanks to both of you. I’ve got it working now. I’m sure there are multiple ways to achieve this with openhab but here is what is working now for me (things config is the same as original post):
Items: