I have a switch that puts my sprinkler system into standby mode for the winter and takes it out during the summer. I would like to have a “are you sure” prompt when I change it. It would be nice if there were an option on the switch configuration that let me set it to ask for confirmation when it is pressed. if it is changed through a non-ha method, it would just report the current state, but if you change it through the HA UI, either phone app or lovelace screen, it prompts you for confirmation.
The built in glance card can do this. Under the entity you add a tap action and can add the confirmation option. Actions - Home Assistant
As squirtbrnr said. But in addition, most of the cards have the action-option. Just put a toggle service there and then use the confirmation option of the call.
See
I’ve found a fairly simple way to achieve this without having to delve into yaml or install any custom components.
Create a timer helper set to say 10 seconds.
Use the switch that currently controls your sprinkler (or whatever) to start the timer instead.
Create a Conditional card that contains a tile or button or whatever. Set that button to perform your action with an appropriate label (Are you sure?), and configure the condition so the card only displays while the timer is active.
Gives you complete control over where the confirmation appears and what it looks like etc.
tap_action:
action: toggle
confirmation:
text: Are you Sure?
This Work for the UI.