Getting the status and attributes of an !input item in a blueprint

I have an blueprint to control brightness and color temp for a room and have some issues trying to get the on/off status from one of the lights in the !input.
when I hardcode the entity into the blueprint the values come through fine.

    light:
      name: Light(s)
      description: The light(s) to control
      selector:
        target:
          entity:
            domain: light

in the variables section of “actions:” I have the following:

      the_lights: !input "light"
      # light_state: "{{ states(the_lights|first) }}"
      light_state: "{{ states('light.gledopto_gl_d_007p_7ae492fe_level_light_color_on_off') }}"
      # color_temp: '{{ state_attr(the_lights|first,"color_temp")|int }}'
      current_color_temp: '{{ state_attr("light.gledopto_gl_d_007p_7ae492fe_level_light_color_on_off","color_temp")|int }}'

In the commented lines I attempted to use “the_lights” assuming this is a list and selecting “first” to get the state of the first light which would work for me. But got “unknown” for the state and “null” for the color_temp attribute. When I hardcode the light into the same statements it works fine.

Here is the “changed variables” from the automation trace at the condition case statement:

the_lights:
  entity_id: light.gledopto_gl_d_007p_7ae492fe_level_light_color_on_off
light_state: 'on'
current_color_temp: 359

of course the ‘on’ and 359 are for the hardcoded light entity.
I have had a look at some other blueprint examples but have not found the syntax that makes this work. Hopefully it is an easy answer.

1 Like