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.
For those that stumble across this post as I have, please consider upvoting my WTH to get this added as part of the GUI.
Actions for me Is not good because i Need confirmation for script and switches exposed on android auto favourites not card.
There Is a solutuon?
On the card “entities” it applies to ROW taps, not to the action on the switch itself.

So if I toggle the switch shown, no confirmation is asked. If I tap the grey area, it works.
I think it’s not enough.
yeah thats correct. tap_action is not working on switches etc.
i use this only on buttons. as i know there is no working solution for switches etc.
Doesn’t it still work?
It’s so pathetic that the toggle action does not work for a toggle.
Do we have any workaround that looks like a toggle button?
Can be custom card, but no script
Just make a template button. The reason it doesn’t work is that toggles inherently need a state to know which service to call, turn on or turn off. There are 2 actions under the hood where tap_action is only 1. I’m sure something could be done to handle that situation, but no one has made a feature request for that.
Thank you for the answer.
What’s the difference between input_boolean and template button in this context?
I mean, input_boolean have states predefined and known for the system. There is the toggle acction for input_boolean domain.
BTW I need to secure it on frontent-only. Simply proceed with action on confirmation. Returning false on the click event would be enough. No need to know state of the entity
Maybe I’m doing something wrong, but I need input_boolean entity listed on entities card secure with confirmation. Obviosuly, securing only one-way transition would be valid and helful.
type: entities
entities:
- entity: input_boolean.pv_ctrl_edit_mode
The ui toggle feature itself requires 2 actions a turn on and turn off. That’s the disconnect here. Where a button in the UI is 1 action.

In that image, if you clicked the top toggle, it would call turn_off, if you clicked the bottom toggle, it would call turn_on.

In this image, you see a button, if you click that button it only runs whatever action is applied to tap action.
These are how these UI elements work. Because the confirmation is tied to tap_action, it makes it impossible to attach to the switch ui element.
So, your options are to create a script that runs toggle, or a button entity that calls the toggle. What you cannot have is a toggle element with the restriction on it.
