Using input_number as setting temperaure

Hi

In an action in my automations I am calling this service;

- service: climate.set_temperature
      data:
        entity_id: climate.baggang_gulvvarme
        temperature: "{{ states('input_number.gulvarme_stuen') | float }}"

If I test the template {{ states(‘input_number.gulvarme_stuen’) | float }} it returns 26.0. But when I call this service with this automation I get this error;
Invalid data for call_service at pos 2: expected float for dictionary value @ data[‘temperature’]

But the template is returning a float, so I cannot see where it whent wrong.

I am running HA 0.102.3 in Docker.

data: needs to be data_template:

Also everything under service: is not aligned right. Is that just some weirdness from pasting?

2 Likes

I use pretty much as yourself (nearly got) and Tediore corrected.

# name: Heat Temperature Set
  - alias: au_heat_temperature_set
    trigger:
      - platform: state
        entity_id: input_number.in_heat_temp_control_val
    action:
      - service: climate.set_temperature
        data_template:
          entity_id: climate.house_heat
          temperature: "{{ states('input_number.in_heat_temp_control_val') | float }}"

Though my input_number.in_heat_temp_control_val changes throughout the day according to conditions. (door open, unoccupied, night, day and evening) 24/365

1 Like