One switch multiple devices

So I’m just getting started with HA and I want to achieve a simple task, which I’m not really sure on how this is done with HA.

I want to have a switch ‘light’ which acts on two devices (‘light_1’ and ‘light_2’).
When ‘light’ is on ‘light_1’ should be ‘on’ and ‘light_2’ should be ‘off’.
Then of course the reverse for when ‘light’ is off.

I expected to do this with a scene, which works for turning it ‘on’ but not ‘off’.

EDIT: So ‘light’ would be a virtual device acting on the two physical devices ‘light_1’ and ‘light_2’

Two simple automations.

Take a look at the template light.

2 Likes

Ok this works:

light:
  - platform: template
    lights:
      light_0:
        friendly_name: "light_0"
        unique_id: light_1
        turn_on:
          - service: switch.turn_on
            data:
              entity_id: switch.tas_plug_01
          - service: switch.turn_off
            data:
              entity_id: switch.tas_plug_02 
        turn_off:
          - service: switch.turn_off
            data:
              entity_id: switch.tas_plug_01
          - service: switch.turn_on
            data:
              entity_id: switch.tas_plug_02

So this is the way to go?
Just seemed a bit to convoluted to me, but it is alright I guess :slight_smile:
Things work very differently in HA :smiley:

Thanks

Das gute Hofbräu :smiley: cheers und danke

1 Like