Template Switch - Home Assistant as the docs say indeed is great for a garage door that has a switch and separate status sensor.
But what if I want to get in between this switch and the user input?
This switch is presented in Lovelace but now I want to have this going on:
Refuse to open when alarm is armed
At certain moments send a confirmation notification asking if the user really wants to open the door (e.g. it’s very late, or nobody is home)
I thought to use an input boolean, and have automation do opening and closing, however this does not sync with the status of the switch.
When using the switch to close the door, the status will still be open until the sensor reports closed.
When using an input boolean to control the template switch, logically, the status of this input boolean will be off, when the switch is called to close it, with the possibility of the door never reaching the close position.
Actually a better integration would be the Template cover:
You add all this in the open_cover: action sequence. It can contain a list of actions, including the choose action. Or if you want to stick with the template switch the same applies to the turn_on action.
Follow up question: Let’s say Mobile App user ‘user123’ tries to open the door by flipping that template switch/cover. Is there a way to detect that that user did it and message only that user? (Tried some things from Automation Trigger Variables - Home Assistant but no result.)