OK, now I have a better handle on the issue.
To put it bluntly, this is due to a deficiency in Home Assistant. To be fair, itâs not only Home Assistant, openHAB shares the same blind spot.
Iâve been using another Home Automation system for many years and it does not have this deficiency, namely the lack of a basic pushbutton.
Itâs not an on/off switch, nor a binary_sensor, nor some other attempt to fit a âsquare peg in a round holeâ, in its simplest form itâs a âmomentary booleanâ. Enable it and it goes true
and then, a moment later, goes back to false
. It has a hundred and one real-world applications.
A more sophisticated model is not âmomentaryâ but supports states and duration such as press, release, hold, and doubletap. However, for your purposes, a basic âmomentary booleanâ would easily resolve this issue.
In Premise, hereâs how I specify that a boolean, called âActivatedâ, is momentary (you just tick a box). Done. I can later render it in the UI with a pushbutton widget.
It puzzles me why this âprimitiveâ is missing in both openHAB and Home Assistant. In both systems, a âmomentary booleanâ is simulated by, quite frankly, very roundabout techniques. Anyone who takes issue with my use of the word âroundaboutâ only needs to look at Steveâs solution (above). Thatâs pretty much the standard way of simulating a pushbutton in Home Assistant.
In addition, Feature Requests have been made over the years, typically for a pushbutton widget for Frontend UI, and nothing has resulted other than replies saying you can already do that (not really), followed by a lengthy example involving scripts and automations.
Unfortunately, none of what I said helps you. Plus, this all probably sounded like a rant, except thatâs not my intention. Iâd like to have a beer with the core developers and ask what kind of house they live in where none of their gadgetry has pushbuttons.
Perhaps I ought to submit a Feature Request to enhance Input Boolean. It could benefit from having a âmomentaryâ type
. When momentary, itâs default state is always false
. Calling input_boolean.turn_on
or input_boolean.toggle
(existing services) would make it momentarily change state to true
then return to false
. The service input_boolean.turn_off
would do nothing. The UI widget for it would be a simple pushbutton (like what we already see in the alarm panelâs keypad).