Turn off all lights with one button

Hey everyone,
I’m trying to make a switch on my lovelace dashboard to turn off all lights.
I created a group in my configuration.yaml and it looks like this:

discovery:

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  ip_ban_enabled: true
  login_attempts_threshold: 5

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

deconz:
  host: ip-of-deconz
  port: port-of-deconz

light:
  - platform: group
    name: "Alle Lampen"
    entities:
      - light.0x000d6ffffe06b484 #Kitchen2
      - light.0x680ae2fffe47bf1b #Livingroom1
      - light.0x680ae2fffe65c9f4 #Livingroom3
      - light.0x680ae2fffe69fafd #Livingroom2
      - light.0x84fd27fffe3a0e71 #Diningroom1
      - light.0x84fd27fffe3b7206 #Diningroom2
      - light.0xd0cf5efffef0697f #Kitchen1
      - light.0xec1bbdfffe7f6929 #Bedroom

now I want to make a button on my dashboard which looks like this:


unfortunately this is not working. If I create buttons which turn on/off a single light then this is working without any problems.
What I’m doing wrong here?

What’s in your groups.yaml?

My groups.yaml is just an empty file. It’s nothing in there

That’s where you put the groups you’ve defined. Something like this:

kitchen:
  name: Kitchen lights
  entities:
    - light.kitchen_1
    - light.kitchen_2
    - light.kitchen_3

cooker:
  name: Cooker lights
  entities:
    - light.cooker_1
    - light.cooker_2
    
hallway:
  name: Hallway spotlights
  entities:
    - light.hallway_1
    - light.hallway_2
    - light.hallway_3

landing:
  name: Landing spotlights
  entities:
    - light.landing_1
    - light.landing_2
    - light.landing_3
1 Like

Not if they are using the light group platform, which they are. That goes under light:

It’s working now, thank you!
I don’t really understand why because before I did it exactly like this Light Group - Home Assistant and it didn’t work

Do you have light: in more than one place in your config?

The light group platform definitely works. I’m using it extensively.

light:
- platform: group
  name: Lounge Downlights
  entities:
  - light.lifx_lounge_front_left
  - light.lifx_lounge_front_right
  - light.lifx_lounge_middle_left
  - light.lifx_lounge_middle_right
  - light.lifx_lounge_rear_left
  - light.lifx_lounge_rear_right

I have only the light entry I mentioned above, this is my full configuration.yaml I posted here

I made a entity card with each light/switch listed, as on or off, and at the top beside the header - Titled Light switches- there’s a toggle that turns them all on/off. Seems to be built in, i didn’t code anything to control all the switches, nor did I group anything.

1 Like

Best solution for me. Header toggle