How to use blueprint's input in brightness and color temp control?

Hi!
I started today my first blueprint, but currently im facing with the following problem: i can’t use the input entity in the light.turn_on action if its mapped. But i can use it if its assigned directly. I think its some kind of converting problem, but i cant figure it out.
Thanks in advance!

The action is working if i use it like this:

action:
  - service: light.turn_on
    target: !input target_light
    data:
      color_temp_kelvin: "{{ states('sensor.beallitott_szinhomerseklet') }}"
      brightness_pct: "{{ states('sensor.beallitott_fenyero') }}"

This is the way, how i want to use:

action:
  - service: light.turn_on
    target: !input target_light
    data:
      color_temp_kelvin: !input color_temp
      brightness_pct: !input brightness

if your input is from sensors, you’d have to make variables and use the variables in templates.

i.e.

actions:
  - variables:
      color_temp_entity_id: !input color_temp
      brightness_pct_entity_id: !input brightness
  - action: light.turn_on
    target: !input target_light
    data:
      color_temp_kelvin: "{{ states(color_temp_entity_id) }}"
      brightness_pct: "{{ states(brightness_pct_entity_id) }}"

This is assuming your selector is an entity selector. If it’s a target selector, this will not work.

1 Like