How do you sync all of the lights in a group?

Hi there, i was wondering how you can sync all the lights in a group. For example i might have
light.bedside_light_left, light.bedside_light_right, light.master_bedroom_light in a group. If one of these changes state I would like the rest to follow. I’ve looked around and can’t figure out how to do it.
Thanks

I assume you mean if someone changes an individual light?

You have to automate syncing in that case.

Are you using the light group platform or group integration?

I’m just using group. All of my lights have on device controls so i cant have some master group switch, each one individually has to control the entire group. So if i turn on light.bedside_light_left then i want light.bedside_light_right and light.master_bedroom_light to also turn on. Same for turning off.

As Tom said, you have the answer.

Here’s an abbreviated example:

trigger:
  platform: state
  entity_id:
    - light.bedside_light_left
    - light.bedside_light_right
    - light.master_bedroom_light
  to: # a null 'to' triggers on all state changes, but not attribute changes. So this wont change brightness or colour, only the on/off state of the lights
condition:
  condition: template
  value_template: "{{ trigger.to_state.state in ['off', 'on'] }}"
action:
  service: "homeassistant.turn_{{ trigger.to_state.state }}"
  target:
    entity_id: group.your_light_group_here ### <--- change this

Note: lists of entities are not supported in the UI automation editor. You have to use yaml view mode, or list all the triggers individually, like this:

trigger:
  - platform: state
    entity_id: light.bedside_light_left
    to: 
  - platform: state
    entity_id: light.bedside_light_right
    to: 
  - platform: state
    entity_id: light.master_bedroom_light
    to: 
3 Likes

That works, thanks a lot! I’m new to HA and don’t quite know what i’m doing yet.

hey sorry
I am also a beginner here.
If my light is a dimmer can I also have the exact dimmer state. If e.g. on entity changes to 60 that all follow?
my lights are zwave dimmers. I need to test what happens what actually happens if one of the entities in the group does send out a report while dimming up or down with a intermediate value… So I do not create a festival of endless loop blinking

1 Like

I tried this but get an error
not sure how to define the value template… it can be 0-100, ON, OFF

trigger:
  - platform: state
    entity_id:
      - light.zw_dimmer_12
    attribute: brightness
  - platform: state
    entity_id:
      - light.zw_dimmer_13
    attribute: brightness
  - platform: state
    entity_id:
      - light.zw_dimmer_14
    attribute: brightness
condition:
  - condition: template
    value_template: '{{ trigger.to_state.state }}'
action:
  - service: homeassistant.turn_{{ trigger.to_state.state }}
    target:
      entity_id: light.zw_grp_dimmer_wohnbereich

error: Error handling message: template value should be a string for dictionary value @ data['value_template']. Got None (invalid_format

1 Like

thanks that excatly what i need!