Command on a Switch

I’ve got a pingable device configured with the network binding. This works fine, and I’ve got it disabled on my sitemap. I don’t want a toggle switch on the sitemap, as you can’t turn it off remotely, only issue a WOL packet.

So I’ve worked out that if I add a mapping to the sitemap switch, I get a nice button instead of a toggle:
image

On the Item I’ve added Command Options Metadata:
image

Which to me, all adds up. There’s a button that will issue a command, and a command defined against the item.

I’ve also setup a rule to do the WOL action, although at the moment it’s just logging into the log that it has fired:

When I jab the button on the site map, nothing happens. If I reconfigure the item as a number, I lose ON/OFF functionality elsewhere (e.g. the icon won’t change to an off version).

Is it possible to do what I’m wanting?

  • Platform information:
    • Hardware: amd64/ample
    • OS: 5.14.21-150400.24.60-default
    • Java Runtime Environment: 11.0.18
    • openHAB version: 3.4.3

Yes and no. Yes, it’s possible to do what you are really after but no, not by sending 2 as a command to a Switch Item. Change the mapping to ON=Boot and the trigger of the rule to trigger when the Switch Item receives an ON command, or change the type of the Item to be a Number Item.

1 Like

For the basicui sitemap, this is what I use:

Switch item=Garage_Door_Reboot mappings=[ON="Reboot"]

No special mapping file / transformation. Just handle the “received command ON”

1 Like

Thanks all.
I was trying to avoid changing the status of the item myself, but I think there might be a difference between a command and an update?