Simplified Automation - Master/Slave

It is not very hard to make a light / switch act as a slave to another, but it requires a few lines of automation code.

It would be very convenient to have a simplified master/slave automation where a list of slaves follows the master. Anyone know abouth such implementation (or do I have to learn to build one myself :slight_smile:) ?

Example in pseudo-config-yaml:

master_slave:
master: light.bedroom_ceiling
entities:
- light.bed_lamp_right
- light.bed_lamp_left

Can you explain what your trying to do?
Sure you just add the three entities into whatever it is your trying to do?
Or address them as a light group?
light.bedroom etc

Light Group

The group light platform lets you combine multiple lights into one entity. All child lights of a light group can still be used as usual, but controlling the state of the grouped light will forward the command to each child light.

Just to be clear, this is a scenario where you want the slave lights to follow the master. But, if the slave lights turn on by themselves, nothing else automatically turns on?

If not, you just described a group which I would recommend using.

If yes, then you could be onto something…but I think it would still be handled with a group :slight_smile:

This works if I control the group - but I want other lights / switches to be slave to another light / switch. Reason is that I have lights controlled by a button on the wall, and I want other lights in the same room to be slaves to the light controlled by the button.

Yes, the Slave lights should be able to be controlled independently.

My problem is that I have a button on the wall (Z-wave under Vera) where I cannot catch the event that I push the button - the only event that I can catch is that a state has changed on one light (which means that I cannot control the state of a group with that button).

I want other lamps in the same room to be slaves to that state.

It is fully possible to do an automation that triggers on state changes etc. I can of course do that, but an integration/setting where you can define master and slave in an easy way would be so much more elegant.

Maybe I have to build an integration myself… :slight_smile:

I see, you have an existing wall switch, that directly controls power to a light, and you want it to also control other lights (that are not directly controlled by the wall switch). In other words, you have an existing light entity and you wish to have it control other light entities.

You’re right, this is currently only achievable via an automation and there’s no native platform available. I suggest you create a Feature Request and hope someone implements it (or, if you have the required skills, create it yourself).

In case anyone was wondering, the automation to create primary-secondary lighting is trivial:

- alias: 'primary-secondary lighting'
  trigger:
    entity_id: light.primary
    platform: state
  action:
    service_template: light.turn_{{trigger.to_state.state}}
    entity_id:
      - light.secondary1
      - light.secondary2
      - light.secondary3
      - light.secondary4
2 Likes

@123 That was elegant enough - Thank you very much for teaching me (us). Fairly new to home assistant and still learning.

May still look into doing something just to test how to develop for this platform.

1 Like

Now how would you do something like that if the wall switch was a dimmer or if the master light had RGB?

Check if there’s anything that meets your needs in the Blueprints Exchange.

Thanks I could not find it there. Sorry for responding to old thread. I’ll ask for help elsewhere.