Automation/Scripting: Turn on Hue light when another light turns on

Is it possible to detect the status of one light to turn on another light? I want to detect my stairs hue light and then turn on the hue light for the hallway upstairs. I am using a physical light switch for the stairs. I hope this makes sense.

Basically, when the physical light for the stairs is turned on, can HA detect it and turn on the hallway light and then do that in reverse.

Does the stairs light have any connectivity (is its state reported to HA?)

If so, a simple automation can accomplish this. If not you need some sort of sensor to detect the stair light turning on.

It’ll be 2 hue lights (stairs & hallway). The upstairs hallway has it’s own switch behind a door. I figured it would be nice to have the upstairs light turn on when the stairs light turns on too.

I know HA can do if conditions, I’m just not sure how to start and all.

I just saw this in another thread. Would this work? Edited of course. If this is the basic logic, then I can work with that.

    - id: "Hallway light"
  alias: 'Turn on hallway light'
  trigger:
    platform: state
    entity_id: light.stairs
    from: 'off'
    to: 'on'
  action:
    service: light.turn_on
    entity_id: light.hallway

Give this a try…

  - alias: 'Hallway on With Stairs'
    trigger:
      platform: state
      entity_id: light.stairs
      to: on
    action:
      service: light.turn_on
      entity_id: light.hallway

You would need to replace the entity IDs and states with the correct ones according to your configuration. Their may be a slight delay in the light turning on. The stairs light will have to get power, connect to the hub and report its state to HA before HA can trigger the automation and turn on the hallway light.

Note that none of this will work if the hallway light is manually turned off at the switch.

1 Like

Cool and thanks.

The manual switch isn’t a big deal. Just two people in the house so we can deal with that. I’ll give it all a try. Thanks again.