Generic thermostat max value from input_number

Hi there.

Trying to create a generic thermostat that would pick the max value from input_number. Cannot get it to work. What I’m doing wrong here? I’m sure it’s something simple…

climate: 
  - platform: generic_thermostat
    name: Eeli_thermostat
    heater: switch.deltaco_sh_p01e_socket_1
    target_sensor: sensor.ewelink_th01_temperature
    min_temp: 19
    max_temp: "{{ states('input_number.tavoitelampotila') | float(0) }}"

HA refuses to reboot and gives following error:

  • The system cannot restart because the configuration is not valid: Invalid config for [climate.generic_thermostat]: expected float for dictionary value @ data[‘max_temp’]. Got “{{ states(‘input_number.tavoitelampotila’)|float(0) }}”. (See ?, line ?).

Thanks!
-kari

As shown in the docs the required data type for the value of max_temp is a float… templates are not supported. Configuration variables that accept templates will be marked with the word “template” as can be seen in this example

Thanks for the answer. So I guess there’s no any workaround?

The idea is, my son has a radiator in his room, which itself is not smart at all. This radiator is connected to a smart plug. There’s also a separate temperature sensor in the room. I’d like to be able to switch the smart plug on once the room temperature goes below a set value. This value would be given as an input_number.

Thanks,
-k

That is not what the max_temp option does. It only defines the maximum range your thermostat can be set to. So set that to the maximum temperature you will ever set the room to.

Then, simply select a set temperature of the generic thermostat in a dashboard climate control card (instead of using an input number) and the generic thermostat will switch your smart plug off and on to maintain that temperature.

You can automate enabling/disabling the thermostat with a schedule helper if you want it to only work at certain times of the day.

Or if you only want to enable the thermostat when the temperature gets a lot lower than the set point, use an automation with a numeric state trigger to enable the climate device. You can compare input numbers to your temperature sensor in a numeric state trigger without using templates.

Ahh now I got it… I don’t understand why I got so mixed up in the first place.

It’s like you said, and then of course I can access the thermostat attributes like any other actual thermostat I have. I’m not using the traditional thermostat cards to control my room temperatures, but Mini Graph Cards and can set the target temperature from there (attribute: temperature). No helpers needed, that’s obvious now.

image

Thanks,
-k

1 Like