I have Tuya smart plug (zigbee) connected to my TV, and I do not want to accidentally turn off my TV whenever I touch that button on my dashboard. To solve this, I’ve currently added 2 buttons where the off button uses a confirmation.
It works, but the disadvantage is that I have two buttons, and no icon status color
type: horizontal-stack
cards:
- type: button
tap_action:
action: call-service
service: switch.turn_on
service_data:
entity_id: switch.woonkamer_tv_meubel_on_off
icon: mdi:television
icon_height: 75px
name: Aan
- type: button
tap_action:
action: call-service
service: switch.turn_off
service_data:
entity_id: switch.woonkamer_tv_meubel_on_off
confirmation:
text: Are you sure you want to do it?
icon: mdi:television-off
icon_height: 75px
name: Uit
Is it possible to add confirmation and icon color state to a toggle button? The flow would be:
Plug off
Icon color blue
On click, turn on the plug
Plug on
Icon color yellow
On clik, show confirmation
Thanks for the suggestion. But I think this isn’t the solution.
The HACS button card does have more options for styling based on state, but as far as I can see the confirmation options is the same as the default button card.
This way, the confirmation would pop-up on both on and off state, and not just when the device is on.
With the custom button card you can have a lock, then you need to click the entity twice before you can turn it on/off. Having a confirmation only for one of the states is not possible.