Syncing two dimmers with automation

Hello together,

i have a dimm actor for dimming lights in a room. Now i have replaced the existing lamp with a Philips Hue lamp. This philips Hue lamp has its own entitiy within hass. Now, i have the possibility to switch on the light with my dimm actor, and switch also the light with the Hue entity. But if the dimm actor is is off, the hue entity will not work. But this is normal, because if the main switch is off, the light have no power .

Ok, but now, i want to sync the two entities. If i turn on the lights with the dimm actor, also the hue entitiy should be turned on and vice versa, if i turn on the hue entiy, the wall mounted dimm actor shall switch on the lights. In a further step, also dimming should be possible this way.

Because i am in the beginning with automations under hass, i do not really now what to do. Perhaps somebody of you could help me here? The following configuration is my first try, but it isn’t working:

- alias: Hue Entity auf Schalter ĂĽbertragen
  trigger:
    platform: state
    entity_id: light.hue_light
  action:
    - service: state
      data_template:
        entity_id: 
          - light.dimmer_deckenlicht
        state: '{{ trigger.to_state.state }}'
        brightness: '{{ states.light.hue_light.attributes.brightness }}'

- alias: Dimmer auf Hue Licht ĂĽbertragen
  trigger:
    platform: state
    entity_id: light.dimmer_deckenlicht
  action:
    - service: state
      data_template:
        entity_id: 
          - light.hue_light
        state: '{{ trigger.to_state.state }}'
        brightness: '{{ states.light.dimmer_deckenlicht.brightness }}' 

I will get an error in the log file:

(MainThread) [homeassistant.config] Invalid config for [automation]: Service state does not match format <domain>.<name> for dictionary value @ data['action'][0]['service']. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 74). Please check the docs at https://home-assistant.io/components/automation/
(MainThread) [homeassistant.config] Invalid config for [automation]: Service state does not match format <domain>.<name> for dictionary value @ data['action'][0]['service']. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 74). Please check the docs at https://home-assistant.io/components/automation/

Thank you very much and regards
danyo

I don’t have a full solution to offer, but “state” is not a service. Look at light.turn_on or homeassistant.turn_on as possible options.

Here is what I’ve used in the past… Currently not in use so not sure if it still works (not sure why it wouldn’t).

  - alias: "Brightness - Master Bedroom Brightness Change (1 to 2)"
    trigger:
      - platform: template
        value_template: "{{ states.light.master1.attributes.brightness }}"
    action:
       - service: light.turn_on
        data_template:
          entity_id: light.master2
          brightness: "{{ trigger.to_state.attributes.brightness }}"
  - alias: "Brightness - Master Bedroom Brightness Change (2 to 1)"
    trigger:
      - platform: template
        value_template: "{{ states.light.master2.attributes.brightness }}"
    action:
       - service: light.turn_on
        data_template:
          entity_id: light.master1
          brightness: "{{ trigger.to_state.attributes.brightness }}"

1 Like

Hi,

thanks for you example, but it isn’t working. It seems, that if i switch on the Hue control entity to a time, where the light bulb is not connected to the main power, it will not trigger the wall mounted Dimm actor, if i switch from within Homeassistant and vice versa…

Any other suggestions? What about the other people using Hue Lights in their current system. How do you solve this?

Regards
Danyo

Did you ever get this figured out? Has been driving me crazy as well.