Heat curve / Automation to set temperature with multiple input number choices

Hi,

I’m creating a heat curve automation in several steps in Home Assistant to control a floor heating system.

Use case:

  • The electric 2kW heater in the system is controlled via a switch on/off
  • An ESPHome device measuring water temperature going out in the system and going into the system (towards heater).
  • I would like to control the switch based on the water temperature going into the system.
  • As the water temperature needs to be different based on the outside temperature, I need to heat the water differently, therefore a heat curve is needed.
  • I would like to manually set the temperature that the ingoing water should have based on the outside temperature. I thought using input sliders for this (see picture below)

Problem:
How do I create an automation or similar to depending on outside temperature selects the corresponding heat curve value as set in the input sliders. My idea was to create a automation that sets a value in a template sensor to the wanted ingoing water temperature depending on outside temp, but Im lost and dont understand how to do this… =) please help

Then use this template sensor as a simple automation to change goal temperature in a generic thermostat that is already working…

image

Is this an electric heater?

Yes it is. a 2kW heater.

Made up all the entity IDs and embedded the template into the action rather than using a separate sensor:

triggers:
  - trigger: state
    entity_id: sensor.outside_temperature
actions:
  - action: climate.set_temperature
    data:
      temperature: >
        {% set in_dict = 
          {-15: 'input_number.t_minus_15', 
           -10: 'input_number.t_minus_10', 
            -5: 'input_number.t_minus_5', 
             0: 'input_number.t_0', 
             2: 'input_number.t_2', 
             4: 'input_number.t_4', 
             6: 'input_number.t_6', 
             8: 'input_number.t_8', 
            10: 'input_number.t_10' } %}
        {% set in_eid = in_dict.get(in_dict.keys()|select('>=', states('sensor.outside_temperature')|float(0))|first,'input_number.t_10') %}
        {{ states(in_eid)|float(0) }}
    target:
      entity_id: climate.water_heater

Does a lookup to convert outside temperature into an input number entity ID, then looks up the associated desired water temperature.

Hi,

Amazing. Big thanks! So far it works perfectly. Will test it over the night and see how things go =)