With a light switch it’s possible to toggle, on off on off with each press. But for more complicated functions like turning on/off a computer via Wake on Lan there are two separate identities.
Is it possible to have a button that with each press alternately calls one, then another entity. There doesn’t need to be conditions to this. Simply one press calls on, the next press calls off, the next press calls on.
It feels like something that should be very simple but may be complicated in practice since I haven’t found any other thread on this.
Thank you very much for providing the above code I will attempt this immediately.
Regards to the post above, I found this link which appears to correspond to your suggestion.
But there is no explanation on how it’s actually set up, I guess if you already know what to do it would remind you, but it’s very much lacking otherwise unfortunately.
That will leave you with a WOL button but you won’t be able to shutdown the machine unless you use some sort of service / shell command etc
At least you’ll be able to test the WOL functionality in the meantime
One thing about this WOL switch is that if the machine is already up it’ll detect it so the button registers as on
To me it’s a perfectly acceptable way to do it. Yes you can do it in all the other ways described but if you are not used to yaml, your way will be easy to understand and create.