Confirmation dialog on switch/button UI actions

Thanks!! do you know if there is something similar for cover entities such as garage door?

i guess still with the workarounds & the lovelace lock - there is value in having it built in globally and natively inside HA

I assume this wish is still pending.

In the meantime, I am using the entity button card, and its hold action.

Instead of a quick click, you need to click and hold for about 3 seconds, to trigger the action.

3 Likes

Just saw this. Fantastic idea.

I was using @faisalqureshiā€™s solution, but then I found the lock feature natively supported by the button-entity custom cards. If you install this for lovelace, you can use the lock: true functionality which is designed for this use case. I implemented this for my garage door (cover) entity and it works really well. You can even limit the ā€œunlockā€ capability to only specific HA users!

screenshot:

custom card info:

My garage doorā€™s lovelace entity config:

entity: cover.garage_door_opener
        type: 'custom:button-card'
        tap_action:
          action: toggle
        show_name: true
        show_state: true
        lock: true
        state:
          - value: closed
            icon: 'mdi:garage'
            styles:
              state:
                - font-size: 12px
                - color: green
          - value: open
            icon: 'mdi:garage-open'
            styles:
              state:
                - font-size: 12px
                - color: red
1 Like

Yes. I too discovered this custom card last week. It is amazing. Iā€™m slowly changing all my cards to this. The level of customisation is fantastic.

Have you tried the ā€œconfirmationā€ tag? It gives you a confirm prompt before triggering.

It also has tap_action, dbltao_action, and hold_action. Works very well for the situation in this thread.

2 Likes

Yep! I personally like the lock function, but that one also does the trick.

I still vote for this feature. I propose an update to persistent notifications component to also have ability to show lovelace dialogues.

For example you can specify if itā€™s persistent notification or a lovelace popup with buttons that can trigger actions. That way anyone can use notifications for whatever they want. So if i want to display confirmation to turn off a light or disable home alarm arming i can do it. This seems like a vary basic functionality thatā€™s missing.

1 Like
  - double_tap_action:
      action: call-service
      confirmation:
        text: Are you sure you want to restart?
      service: script.1585358453646
  

This is here as an fyi for anyone who comes through here later. This yaml is in my picture elements, and pops up a confirmation dialog for me.

  - double_tap_action:
      action: call-service
      confirmation:
        text: Are you sure you want to restart?
      service: script.1585358453646

fyi this is a thing now

1 Like

This is implemented in Lovelace now. Closing

2 Likes