Two dim lights > how to automate the same dim levels

Hi
I have two dimmers that must turn on/off at the same time IF one of the two dim buttons is pressed (but then also maintain the same dim level of one of the two dim buttons is rotated, is this possible in HA?

the following automation turns on both dim lights but when someone changes the dimlevel on one of the two dimmers, it only changes that belonging dim light, not the other one.

alias: Dim
description: ""
trigger:
  - platform: state
    entity_id:
      - light.dimeetkamer
      - light.dimwoonkamer
    from: "off"
    to: "on"
    id: "1"
  - platform: state
    entity_id:
      - light.dimeetkamer
      - light.dimwoonkamer
    from: "on"
    to: "off"
    id: "2"
action:
  - if:
      - condition: trigger
        id:
          - "1"
    then:
      - data: {}
        target:
          entity_id:
            - light.dimeetkamer
            - light.dimwoonkamer
        action: light.turn_on
  - if:
      - condition: trigger
        id:
          - "2"
    then:
      - target:
          entity_id:
            - light.dimeetkamer
            - light.dimwoonkamer
        data: {}
        action: light.turn_off
mode: single
max_exceeded: silent

Hi Bowa,

I suggest you set the brightness level when you turn the light on, then you control it. If you just turn it on, other factors are affecting the brightness and you don’t know where it’s at.


  action:
    - action: light.turn_on
      target:
        entity_id:
          - light.kitchen
          - light.living_room
      data:
        brightness: 150

for example

If you want these lights to always be in sync, home assistant would need to be used to change the brightness every time using similar/related logic.

Maybe search for blueprints or other examples that match what you are specifically doing to get a better picture.
Tips on Searching for Answers & Duplicate Topics in the Forum.

The solution that works: