How to turn on lights in a group?

How do I use dev/service call to turn on all lights in a group?

I have a groups.yaml file that contains:

downstairs lights:
  name: Downstairs Light Group
  entities:
    - light.dining_room_light
    - light.fireplace

I can do a service call: Light: Turn on to light.dining_room_light, but how do I turn on group.downstairs_lights?

Solved. Do not create groups in a yaml file. Use the helper: groups instead. Then the call service mode works just fine.

1 Like

This ^

I first time I tried setting up Zigbee bulbs I set them in a ZHA group (Zigbee | Configure) but it they were very unstable. Dimming at different levels. Really frustrating.

Switched to the HA Helper group method instead and they’re working 100%.

The syntax changed, those are old kind of groups.
The new syntax specifies what it is: Group - Home Assistant
So you can still create your own yaml files and the groups will act as whatever you set them.

In addition to my solution in #2, I created four groups (in helpers):

Downstairs Lights Group
Downstairs Switches Group
Upstairs Lights Group
Upstairs Switches Group

Some of my lights are switches and some are lights. Instead of making the switches as lights option in helpers, I chose to just make multiple groups. (Because I have too many automations to change “switch” to “light”. Maybe later).

And then One to rule them All, I created an “all lights” group in groups.yaml

AllLights:
  name: All Lights Group
  entities:
    - light.downstairs_lights_group
    - switch.downstairs_switches_group
    - light.upstairs_lights_group
    - switch.upstairs_switches_group   

I am having a bit of trouble with this.

I created two groups in the helpers section, one for regular light switches and one for dimmer switches because my basement lights are on a smart dimmer switch and Home Assistant make it a light entity instead of a switch.

In groups.yaml I have the following:

AllLights:
    name: All Lights
    entities:
      - switch.regular_lights
      - light.dimmer_lights

However, when I try to make a custom button card to make a switch to control all the lights it doesn’t work.

type: custom:button-card
entity: AllLights
name: All Lights
icon: mdi:toggle-switch
tap_action:
  action: toggle
styles:
  card:
    - filter: opacity(100%)
    - height: 100px
    - width: 100px
  icon:
    - color: '#3d85c6'
  name:
    - font-size: 13px
    - color: white
state:
  - value: 'on'
    styles:
      card:
        - background-color: '#484848'
        - filter: opacity(100%)
      icon:
        - color: '#FFC107'

If I change the entity to switch.regular_lights or to light.dimmer_lights then it will work, but if I try to use the AllLights group it will not.

Can someone tell me what I am doing wrong? I tried making an entity_id in groups.yaml but that did not seem to work either.

Should be entity: light.AllLights
You need to declare what type it is.

That is not working. It works if I put one of the groups in the button like light.dimmer_lights or 'switch.regular_lights`, but light.AllLights does not work, nor can I do

type: custom:button-card
name: All Lights
entities: 
  - switch.regular_lights
  - light.dimmer_lights

I tried using group.AllLights and that also didn’t work.

Check what the group is in entities. It should say what it is there
Might be switch.

My AllLights group from the group.yaml file doesn’t show up under entities. The two groups I created under helpers show up.

an entity never includes Uppercase characters. Try light.alllights

I tried that too and it doesn’t work. It doesn’t seem to acknowledge anything that ins the group.yaml file.

Stupid question maybe. But did you define the group.yaml in your configuration.yaml?

group: !include groups.yaml
1 Like