How to add interactive check prior to turning on a switch?

need to avoid accidental turning on of switches due to phone in pocket or the likes, have had it happen a few times leaving water running for long periods of time
is there a way to add an interactive (are you sure?) check in lovelace before turning on a switch entity?

That would be an interesting card- make a features request.

I would just make two switches and use an automation that would only complete the action if both are on or off. I sort of do something like that with my sprinkler controller. One switch turns a Boolean helper entity on or off and this entity is a condition of the automation.

The “tap action” part of a card has a confirmation option - don’t think it’s available through the UI.

    tap_action:
      action: perform-action
      confirmation:
        text: The router will be offline for about two minutes.
      perform_action: script.restart_router
    entity: script.restart_router
2 Likes

Either use a confirmation like @jackjourneyman just suggested, or else make sure that tap_action is set to none or more info, then use a hold_action to trigger the switches on your dashboard

1 Like

this is looking like a handful, below is just an example of the switches I have on a dashboard now that I need to add interactive check for, I have to create actions for each one of those independently?

type: entities
entities:
  - entity: switch.wifi_switch_4ch_switch_1
  - entity: switch.wifi_switch_4ch_switch_2
  - entity: switch.wifi_switch_4ch_switch_3
  - entity: switch.wifi_switch_4ch_switch_4

The love-lock-card can do this: https://github.com/CyrisXD/love-lock-card.

type: custom:love-lock-card
title: Garage Doors
popup: confirm
cards:
  - type: entities
    entities:
      - entity: binary_sensor.garage_door_a_tilt_sensor
        name: Garage Door A Status
      - entity: switch.shelly_garage_door_a
        name: Garage Door A
1 Like

It would be nice if it worked. I’ve tried for an hour to get a simple permission to turn on a light a light. Or is it only for locks?

Do you see what I did wrong here?

type: custom:love-lock-card
title: Kim's Worklight
popup: confirm
cards:
  - type: entities
    entities:
      - entity: switch.kim_worklight_relay
        name: Kim's Worklight

Your code is good - it will work on any entity that you can manipulate in HA. The ‘lock’ message is about unlocking the control to change the light/switch/lock status.

Did you install the custom repository as described in the documentation? Rather than using the manual method you might want to install it via HACS Integration: https://www.hacs.xyz/

1 Like

that worked great, sweet…!!!