Trying to crate an automatuion that mirrors on/off and brightness of each other.
However only the off parts works… any ideas?
- alias: mirrored light.dimmable_light_6
id: mirrored light.dimmable_light_6
triggers:
- platform: state
entity_id: light.dimmable_light_6
actions:
- choose:
- conditions: '{{ states.light.dimmable_light_6.state == ''off'' }}'
sequence:
- action: light.turn_off
target:
entity_id: light.dimmable_light_7
default:
- action: light.turn_on
target:
entity_id: light.dimmable_light_7
data:
brightness: "{{ state_attr('light.dimmable_light_6', 'brightness') }}"
Edwin_D
(Edwin D.)
June 12, 2025, 8:38pm
2
This post syncs the state of multiple switches, you can do the same for lights:
A light that is already on should not do anything when already on, and thus not cause a loop. If it is, it might be the integration changes an attribute and trigger again. If it does, a loop may occur. Try changing it to:
alias: Hallway Light Switches
description: Hallway Light Switches
trigger:
- platform: state
entity_id:
- switch.0x3410f4fffe72ab0d
- switch.zb_switch_office_left
from:
- "on"
- "off"
to:
- "on"
- "off"
condition: []
action:
…
For brightness you need a second automation, using a state trigger on the brightness attribut and setting that in the other lights.
yea thanks.
I got the on/off to synk now.
the brightness sync I have trouble with:
- alias: sync brightness1
trigger:
- platform: template
value_template: "{{ state_attr('light.dimmable_light_7','brightness') }}"
condition: []
action:
- action: light.turn_on
target:
entity_id: light.dimmable_light_6
brightness: "{{ state_attr('light.dimmable_light_7', 'brightness') }}"
mode: single
Edwin_D
(Edwin D.)
June 12, 2025, 9:10pm
4
Try something like this (untested):
description: ""
mode: single
triggers:
- trigger: state
entity_id:
- light.dimmer_1
- light_dimmer_2
attribute: brightness
to:
conditions: []
actions:
- action: light.turn_on
metadata: {}
data:
brightness: "{{ trigger.to_state.attributes.brightness }}"
target:
entity_id:
- light.dimmer_1
- light.dimmer_2
why dont do a group so both can have the same values
3 Likes
I agree , especially if the lights are from same manufacturer.
Based on the info provided, I would think this applies to this scenario.
light:
- platform: group
name: Living Room Lights
unique_id: living_room_lights
entities:
- light.lamp_1
- light.lamp_2
if you are using Zigbee2Mqtt theres a seccion to doit
with tasmota just do GroupTopic
Yes, that would fix the problem controlling it from HA. But these lights are in fact a dimmer comtrolling lights. I want them to mirror each other also when physcly turning the dimmers as well.
What manufacturer and model are we working with?
@WarLion suggestion may still be in play…
i believe those are Zigbee are you using z2m or zha?
on z2m just add both as a group
on ZHA you can use this method
Trying to figure out the bindings/group function for my large Zigbee network.
It would seem that all of my devices only have very limited cluster control and not the on/off or LevelControl clusters needing for directly pairing a remote with a switch/light
Is this just because none of my devices support it or is it a problem with my setup? (Sonoff Zigbee 3.0 USB Plus)
(Hue bulb LWA004 by Signify Netherlands B.V.)
[image]
(Tradfri Control Outlet)
[image]
Here is the diagnostics:
diagnos…
if you are using a smart dimmer just change the action to the new entity
if you really wanna make an automation meaby something like this
alias: Sync light 6 → light 5
mode: queued
triggers:
- entity_id: light.dimmable_light_6
trigger: state
id: light6
- entity_id: light.dimmable_light_5
trigger: state
id: light5
actions:
- choose:
- conditions:
- condition: trigger
id:
- light6
sequence:
- if:
- condition: template
value_template: "{{ trigger.to_state.state == 'on' }}"
then:
- action: light.turn_on
target:
entity_id: light.dimmable_light_5
data:
brightness: "{{ trigger.to_state.attributes.brightness }}"
color_temp: "{{ trigger.to_state.attributes.color_temp | default(250) }}"
rgb_color: >-
{{ trigger.to_state.attributes.rgb_color | default([255,
255, 255]) }}
effect: "{{ trigger.to_state.attributes.effect | default('none') }}"
else:
- action: light.turn_off
target:
entity_id: light.dimmable_light_5
data: {}
- choose:
- conditions:
- condition: trigger
id:
- light5
sequence:
- if:
- condition: template
value_template: "{{ trigger.to_state.state == 'on' }}"
then:
- action: light.turn_on
target:
entity_id: light.dimmable_light_6
data:
brightness: "{{ trigger.to_state.attributes.brightness }}"
color_temp: "{{ trigger.to_state.attributes.color_temp | default(250) }}"
rgb_color: >-
{{ trigger.to_state.attributes.rgb_color | default([255,
255, 255]) }}
effect: "{{ trigger.to_state.attributes.effect | default('none') }}"
else:
- action: light.turn_off
target:
entity_id: light.dimmable_light_6
data: {}
havent try but If your lights don’t support all attributes like color_temp or effect just remove those keys or check if the attribute exists before applying.
Thanks that works wonders!