Can a color change trigger the same color change on another light?

Hi all,

Before buying some more expensive color bulbs, I was wondering if this is possible via an automation in HA:

Can the color change on one light / bulb trigger the same color change on another light / bulb?

Big thank you in advance.

Yes, two methods

  1. Group the bulbs together. If they are same type they will change to the same
  2. Make a automation triggered by changes on the first bulb. Then use light-service to set the second bulb to the same paramteres Something like
alias: Follow other lamp
description: ''
trigger:
  - platform: state
    entity_id: light.bulb1
condition: []
action:
  - service: light.turn_on
    data:
      brightness: '{{ states.light.bulb1.attributes.brightness }}'
      color_temp: '{{ states.light.bulb1.attributes.color_temp }}'
    target:
      entity_id: light.bulb2
mode: single
3 Likes

do you mean bulb1 here?

1 Like

Definitely yes, I think it has just been a typo…

1 Like

I guess it depends - you may want to leave bulb2 at it’s current brightness and just change the colour, or you may want to mirror the colour and the brightness :slight_smile:

1 Like

Yes, a typo when I changed from my long entity names to make it readable

1 Like

Wow that is awesome thank you so much ! :slight_smile: :+1:
I cannot try it right now, but now I am going to buy them and then test all of this.

So 4th line form the botton if I understood it right, needs to be bulb1 instead of 2 … so far I am a beginner and did all the automations via gui not yaml, but will definitely dive into this, too.

Yes both would the target in my case, but both might be valid cases of course :slight_smile: :+1:

Correct, I just edited the post to be correct.

If you cut/paste this into a “blank automation” in YAML mode, and go back to “GUI” mode, then it will show as GUI and you can see which attributes it sets.

There are other attributes, which can be “copied” using the same metod.

1 Like

@khvej8
omg it works amazing! :smiley: :star_struck:
thank you so much :+1: :+1:

I do not have the color ones yet, but tested already with brighteness, awesome :smiley:

In the gui it still shows me yaml (for the actions), it says “Visual editor is not supported for this configuration” … but that is still fine, I anyway wanted to get more familiar with yaml.

(backround of this is I am using two bridges, a hue bridge with (almost) all lights (and some hue accessoires), as my wife really uses the hue app and alexa etc., and a sonoff bridge for all the rest, switches, sensors, sockets etc. to have all the flexibility for all kinds of devices.
And to also have a good zigbee mesh for the non-hue devices, I have some lamps in central positions with 4, 3 or 2 GU10s and I connect one of the bulps to the sonoff to have the repeater functionality. And simply let this one follow the hue ones. For on / off it was easy, but now it also works for dimming and color, so great :slight_smile: )

One fun fact I might need to dig in: At 1% dimming in hue app, the following bulp gets off already. If I do 1% in the HA app, the following bulp does not turn off, and follows correctly to 1%. All other values work perfectly identical :smiley:

Edit2:
Although it works great, I have these errors and warnings in the log - should I just ignore them, or try to do something about them? :slight_smile:

Error while executing automation automation.link_light_corridor_mid_hue_to_non_hue_follow: expected int for dictionary value @ data[‘brightness’]
Error executing script. Invalid data for call_service at pos 1: expected int for dictionary value @ data[‘brightness’]

  • Template variable warning: ‘mappingproxy object’ has no attribute ‘brightness’ when rendering ‘{{ states.light.corridor_middle_tradfri_hue_1.attributes.brightness }}’
  • Template variable warning: ‘mappingproxy object’ has no attribute ‘color_temp’ when rendering ‘{{ states.light.corridor_middle_tradfri_hue_1.attributes.color_temp }}’