WOL-Item represented as PushButton

Hi,
i’ve created a Item to wake up my NAS. Actually. On Habpanel I use a simple switch (in lack of alternatives) to turn the NAS on. But now the Widget keep its status “ON” until I push the button (unnecessarily because there is no shutdown-function installed) a scond time… and if my NAS settle into shutdown the widget won’t notice.
So actually i simply need the function of a PushButton (in German: “Taster”) instead of the “switch”-Widget.

PS: I’ve tried to use the “BUTTON”-Widget … but there are settings to sent a command (which i don’t need for the WOL-Binding/Item). In addition there is no use for the active/inactive-Settings in the Button-Widget.

PPS:o.k. the “premium”-solution would be to have a widget with a new (mixed?) “Item”, which

  1. checked the status of my NAS an (NAS avaible? Yes/No)
  2. represented the status on the widget
  3. if widget is pressed perform the Switch-function.

Any Ideas for the simply (or the premium) Requirement?

Thanks in advantage
Tom

Simple solution:

Exception autoupdate
autoupdate=“false” is a special instruction which keeps the current state of the item, even if a command has been received. This way, the Item is unchanged unless you explicitly post an update to the item.
Example:
Switch Garage_Gate {binding=“xxx”, autoupdate=“false”}

https://docs.openhab.org/configuration/items.html#exception-autoupdate

“Premium” solution?
https://docs.openhab.org/addons/bindings/wol1/readme.html#examples

uh, that was quick … and the simple solution worked great! Thanks!

for the premium solution i’m not sure if we missunderstand each other - i don’t want to turn of the NAS (by exec-binding); i just like to check “is NAS avaible in network” - this should be the “active” status in e.g. a Button-Widget (in Habpanel).

best regards
Tom

Ah ok.

You could ping it via Network Binding
https://docs.openhab.org/v2.2/addons/bindings/network/readme.html

Thing

Thing network:pingdevice:nas [ hostname=“192.168.0.42” ]

Item

Switch NAS “NAS ist [MAP(online.map):%s]” { channel=“network:pingdevice:nas:online” }

Perhaps with MAP Translation Service
online.map

ON=online
OFF=offline

And then shown as “dummy” widget in hapbanel

Thanks … it all works … i’ve now two Widgets:
a) Switch Widget with “hide on/off” and a Sun-Icon which looks like a Pushbutton
b) Dummy Widget (next to the Switch Widget) to see the Status of my NAS