I’ve now found a way to solve this. I created a mqtt_json light, which is listening to a dummy topic. This will probably also work with other lights, but mqtt_json supports RGB and white channel:
- platform: mqtt_json
name: wohnzimmer_strip
brightness: true
rgb: true
command_topic: "dummy"
optimistic: true
white_value: true
This gives me a dimmable light with a color picker and also a white channel:
With this, I can have automations which forward the state of this light to the individual lights:
- alias: "Wohnzimmer LED Strip Color"
trigger:
platform: state
entity_id: light.wohnzimmer_strip
condition:
- condition: state
entity_id: light.wohnzimmer_strip state: 'on'
action:
- service: light.turn_on
entity_id: light.wohnzimmer_strip_decke_r
data_template:
brightness: "{{ (states.light.wohnzimmer_strip.attributes.rgb_color[0] * (states.light.wohnzimmer_strip.attributes.brightness / 255)) | int }}"
- service: light.turn_on
entity_id: light.wohnzimmer_strip_decke_g
data_template:
brightness: "{{ (states.light.wohnzimmer_strip.attributes.rgb_color[1] * (states.light.wohnzimmer_strip.attributes.brightness / 255)) | int }}"
- service: light.turn_on
entity_id: light.wohnzimmer_strip_decke_b
data_template:
brightness: "{{ (states.light.wohnzimmer_strip.attributes.rgb_color[2] * (states.light.wohnzimmer_strip.attributes.brightness / 255)) | int }}"
- service: light.turn_on
entity_id: light.wohnzimmer_strip_decke_w
data_template:
brightness: "{{ (states.light.wohnzimmer_strip.attributes.white_value * (states.light.wohnzimmer_strip.attributes.brightness / 255)) | int }}"
- alias: "Wohnzimmer LED Strip Power" trigger:
platform: state
entity_id: light.wohnzimmer_strip
to: 'off'
action:
- service: light.turn_off
entity_id: light.wohnzimmer_strip_decke_r
- service: light.turn_off
entity_id: light.wohnzimmer_strip_decke_g
- service: light.turn_off
entity_id: light.wohnzimmer_strip_decke_b
- service: light.turn_off
entity_id: light.wohnzimmer_strip_decke_w
I’d prefer if I could pack everything into one rule, but it seems like the rgb_color attribute is not present when the light is turned off.
