Lock an entity from easily changing from dashboard

I generally just use entities cards for each room in my dashboard.
Currently entities have attributes to enable and hidden. I would like a option to lock it.
If locked, the the switch on the dashboard needs a confirmation click, and it not included in the header toggle of the card.

There is a confirm action available for each entity in an entities card:

Screenshot 2022-06-06 at 15-40-08 Actions

Not sure but I think you would have to disable the header toggle for the card.

Alternatively there is this third party solution:

Thanks. I’ll look a bit deeper at both options. Nothing else, I can use the confirmation click and remove the toggle header. Another thought, the toggle header could have a hook to call a local script.

I gave the confirmation a try, but it did not work the way I hoped:

type: entities
entities:
  - entity: switch.underfloor_gpo_1_1
    name: Vent Fan
    tap_action:
      action: toggle
      confirmation: true
  - entity: switch.underfloor_gpo_1_2
    name: lights
    icon: mdi:car-parking-lights
  - entity: switch.pm_plug
    icon: mdi:water-pump
  - entity: sensor.pm_plug_power
    icon: mdi:gauge
  - entity: sensor.wl_front_distance
  - entity: sensor.rain_water_depth
  - entity: switch.outside_r_ff
title: Underfloor
show_header_toggle: false

I only get a confirmation pop-up when the “Vent Fan” line’s icon is clicked, not the switch slider on the line is clicked.

Ah. It seems that is the way it is supposed to work for switches unfortunately. See https://github.com/home-assistant/frontend/issues/5555