bushbrother The update with colour sync has been pushed now but just incase you still want to automate this, I’m using two scripts. One to sync the on/off state and another to sync the colour and brightness.
On/off script:
alias: Sync Light State to Local Deck
description: Sync the on/off state of the source light with the target light.
mode: single
fields:
source_light:
description: The light entity to sync from.
example: light.bedroom
target_light:
description: The light entity to sync to.
example: light.localdeck_button_13_light
sequence:
- service: light.turn_{{ states(source_light) }}
target:
entity_id: "{{ target_light }}"
Example Automation:
alias: Sync Bathroom Light to Deck Light
description: Sync the on/off state of light.bedroom with light.localdeck_button_13_light.
trigger:
- platform: state
entity_id:
- light.bathroom_light
- platform: state
entity_id:
- binary_sensor.192_168_0_247
to: "on"
for:
hours: 0
minutes: 0
seconds: 20
condition: []
action:
- service: script.sync_light_state_to_local_deck
data:
source_light: light.bathroom_light
target_light: light.localdeck_button_16_light
mode: single
The ping sensor here is to sync the state of the lights on power on of the deck
Colour state script:
alias: Sync Light and LocalDeck Light Attributes
mode: queued
sequence:
- variables:
entity_id: "{{ entity_id }}"
brightness: "{{ brightness }}"
color_temp: "{{ color_temp }}"
rgb_color: "{{ rgb_color }}"
hs_color: "{{ hs_color }}"
xy_color: "{{ xy_color }}"
- choose:
- conditions:
- condition: template
value_template: "{{ brightness is not none }}"
sequence:
- service: light.turn_on
target:
entity_id: "{{ entity_id }}"
data:
brightness: "{{ brightness }}"
- choose:
- conditions:
- condition: template
value_template: "{{ color_temp is not none }}"
sequence:
- service: light.turn_on
target:
entity_id: "{{ entity_id }}"
data:
color_temp: "{{ color_temp }}"
- conditions:
- condition: template
value_template: "{{ rgb_color is not none }}"
sequence:
- service: light.turn_on
target:
entity_id: "{{ entity_id }}"
data:
rgb_color: "{{ rgb_color }}"
- conditions:
- condition: template
value_template: "{{ hs_color is not none }}"
sequence:
- service: light.turn_on
target:
entity_id: "{{ entity_id }}"
data:
hs_color: "{{ hs_color }}"
- conditions:
- condition: template
value_template: "{{ xy_color is not none }}"
sequence:
- service: light.turn_on
target:
entity_id: "{{ entity_id }}"
data:
xy_color: "{{ xy_color }}"
Example Automation:
alias: Sync Bedroom and Deck Lights - Attributes
description: >-
Sync the brightness and color of light.bedroom_hue with
light.localdeck_button_07_light.
trigger:
- platform: state
entity_id: light.bedroom_hue
- platform: state
entity_id:
- binary_sensor.192_168_0_247
to: "on"
for:
hours: 0
minutes: 0
seconds: 20
condition:
- condition: state
entity_id: light.bedroom_hue
state: "on"
action:
- service: script.sync_bedroom_and_deck_light_attributes
data:
entity_id: light.localdeck_button_07_light
brightness: "{{ state_attr('light.bedroom_hue', 'brightness') }}"
color_temp: "{{ state_attr('light.bedroom_hue', 'color_temp') }}"
rgb_color: "{{ state_attr('light.bedroom_hue', 'rgb_color') }}"
hs_color: "{{ state_attr('light.bedroom_hue', 'hs_color') }}"
xy_color: "{{ state_attr('light.bedroom_hue', 'xy_color') }}"