Unable to set input_number from attribute

I have the following simple script to set an input_number from the climate attribute temperature.

alias: New Script
sequence:
  - service: input_number.set_value
    data: "{{ state_attr('climate.lounge','temperature')}}"
    target:
      entity_id: input_number.lounger_temperature_number
mode: single

However when I run this I constantly get

Error: Error rendering data template: Result is not a Dictionary

I can create a component in lovelace and temperature gives the required answer so why not when I try in a script?

Any pointers would be gratefully received. :wink:

alias: New Script
sequence:
  - service: input_number.set_value
    data: 
      value: "{{ state_attr('climate.lounge', 'temperature') }}"
    target:
      entity_id: input_number.lounger_temperature_number
mode: single

Reference: Input Number - Services

1 Like

Thank you. You wouldn’t believe how long I looked at that yesterday and completely missed the missing “Value” :+1:

1 Like