#Recreate on / off button from Lights dashboard in custom dashboard

1 messages · Page 1 of 1 (latest)

elder talon
#

Can I recreate the button that HA provides you in prebuilt lights dash? I want to add it to card in my custom dash

#

I will add that I know how to create light group
But I really want that small on off toggle

limpid silo
#

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.

quasi ember
# limpid silo You can add a badge of button type to the Heading card. You can add two of them ...

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"
  • 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"
elder talon
quasi ember
#

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.)