Change color of bulbs with dimmer switch without changing brightness?

I’m currently programming my IKEA dimmer switches used with deconz and I’m having trouble with changing the color of my bulbs without touching the current brightness. The action I’m trying is this:

action:
- service: light.turn_on
entity_id: light.gang_2_etg
data_template:
brightness: ‘{{states.light.gang_2_etg.attributes.color_temp + 20}}’

Is there any way to input the current brightness and output the same brightness togheter with the color change?

Um, you may have wanted to set the color temp, but you’re actually setting the brightness. Maybe try this:

action:
- service: light.turn_on
  entity_id: light.gang_2_etg
  data_template:
    color_temp: "{{ state_attr('light.gang_2_etg', 'color_temp') + 20 }}"

Also, in the future, please format YAML code properly.

Thanks! Sorry about that (both of my errors…)

1 Like