#Recreate on / off button from Lights dashboard in custom dashboard
1 messages · Page 1 of 1 (latest)
I will add that I know how to create light group
But I really want that small on off toggle
You can add a badge of button type to the Heading card. You can add two of them with icons and play with visability depending on the group state.
I read this message and thought "that can't be the right way to do that." Sure, enough, it is exactly right. I've never used the Heading card but it makes sense. The cards and badges don't accept templates (that would have been too easy). Getting card_mod to target the right things looks to be a hassle. ```yaml
type: heading
icon: mdi:television
heading: Living Room
heading_style: title
badges:
- type: button
icon: mdi:power
tap_action:
action: perform-action
perform_action: light.toggle
target:
entity_id: light.living_room_lights
data: {}
text: "On"
color: accent
visibility:- condition: state
entity: light.living_room_lights
state: "on"
- condition: state
- type: button
icon: mdi:power
tap_action:
action: perform-action
perform_action: light.toggle
target:
entity_id: light.living_room_lights
data: {}
text: "Off"
visibility:- condition: state
entity: light.living_room_lights
state: "off"
- condition: state
Thank you it worked
It's exactly what I was looking for
I made my own with a custom:button-card. It's not exact but pretty close. Colors are hard-coded at the moment. (I couldn't get the colors right for the background. The opacity kept getting applied to the whole card and not just the background color.)