Hello!
I’m completely new to home assistant and I’m trying to learn. Can someone please help me, I am looking to build a dashboard that has the same “off” button in the header of sections as the built in lights dashboard does. It shows when there are lights on in the area and if you press it, it turns all lights in that section off. I can’t for the life of me figure out how to add that to my created dashboard.
I don’t know how that one is done. I made one similar by adding a badge to the heading.
type: grid
cards:
- type: heading
heading: Test Section
heading_style: title
badges:
- type: button
icon: mdi:power
tap_action:
action: perform-action
perform_action: switch.toggle
target:
entity_id:
- switch.patio_lights
- switch.shop_rear
data: {}
text: "Off"
visibility:
- condition: state
entity: switch.patio_lights
state_not: "on"
- condition: state
entity: switch.shop_rear
state_not: "on"
- type: heading
heading: Test Section
heading_style: title
badges:
- type: button
icon: mdi:power
tap_action:
action: perform-action
perform_action: switch.toggle
target:
entity_id:
- switch.patio_lights
- switch.shop_rear
data: {}
text: "On"
color: accent
visibility:
- condition: state
entity: switch.patio_lights
state: "on"
- condition: state
entity: switch.shop_rear
state: "on"
- type: tile
entity: switch.patio_lights
- type: tile
entity: switch.shop_rear
I had to create two headings, one for On and one for Off, and use visibility to show/hide badge buttons with different colors and labels.
It’s most likely using the
Action:
light.turn_off /_on
Target > Area(Basement)
Or Better of
Action: toggle.light
Target: Area(Basement)
@QuikDraw
Thank you so much for that, you put me on the right track and it is doing what I want it to do. I very much appreciate it. I’m coming from Hubitat, I’m very tech knowledgeable but I must say, home assistant is a little tough to learn.
I know what you mean. I came from HomeSeer. I just wanted to see what everyone was talking about with Home Assistant, so I tried it out. One by one I duplicated each of my automations until I could equally use either platform. By the time I finished mimicking all my HomeSeer stuff in Home Assistant, Home Assistant became fairly comfortable. I eventually stopped using HomeSeer altogether.
I’ll normally start by copying and modifying something I already did. If I have any trouble, I’ll incorporate the help of one or more LLMs. Knowing LLMs spend most of their time hallucinating, I check against the official HA documentation. Knowing the HA documentation sometimes lags behind the releases, I’ll search this forum for any up-to-the-minute changes.
I find that in Home Assistant I’m pretty much only limited by my imagination (and my wallet for hardware).


