2 Switches - 1 Light

Haven’t really worked with trigger ids yet, but that’s how I keep my XMas lights in sync:

alias: Switch - Sync XMas Lights
trigger:
  - platform: state
    entity_id: >-
      switch.xmas_living_room,switch.xmas_lobby,switch.outdoor_1,switch.outdoor_2
    from: 'on'
    to: 'off'
  - platform: state
    entity_id: >-
      switch.xmas_living_room,switch.xmas_lobby,switch.outdoor_1,switch.outdoor_2
    from: 'off'
    to: 'on'
action:
  - service: switch.turn_{{ trigger.to_state.state }}
    target:
      entity_id:
        - switch.xmas_lobby
        - switch.xmas_living_room
        - switch.outdoor_1
        - switch.outdoor_2
mode: single

You might even be able to skip the second trigger if you also remove the ‘from’ and ‘to’ from the first one - not sure what it would do when the state changes e.g. from ‘unavailable’ to ‘on’ or from ‘off’ to ‘unavailable’, though.

3 Likes