Variable light transition time

Hi all,

I would like to set the transition time (Hue lightbulbs) by an input_number (in minutes).
But this doesn’t seem to work:

action:
  service: light.turn_on
  data_template:
    entity_id: light.hue_white_lamp_1
    brightness: 254
    transition: '{{ states.input_number.transition_time * 60 }}'

What am I doing wrong?

Copy and paste your template in Dev Tools/Templates und you’ll see what you get.

To get the state of the input_number:

{{ states.input_number.transition_time.state }}

This returns a string, so convert it to int or float

{{ states.input_number.transition_time.state | int }}

Then you can multiply

{{ states.input_number.transition_time.state | int * 60 }}
1 Like

Thanks!
Didn’t know how to use the Dev Tools/Templates, now I do :slight_smile: