Creating a Temperature sensor from a number

I have a pool ventilation system that manages the pool including water temp.

The entity is number.variheat_water_temp_set_point

For display and management purposes i want to use a generic thermostat which will show the sent temp and current temp.

The issue is the generic thermostat needs a temp sensor to run as opposed to a number.

How can i convert number.variheat_water_temp_set_point to a temperature sensor ?

And once done will can this be tied both ways so that a change in number refects in the sensor and a change in the sensor reflects in the number ?

This is required as the set temp can be set on HA or the unit itself.

I have goolged and played but sadly got nowhere.

Thank you

You don’t change sensors.

You could probably create a template sensor (with device_class: temperature) which reflects the number as temperature, however tied both ways is tricky, you’ll end up with an endless loop, unless you’re careful (maybe using last_changed as safeguard?).

I dunno, tbh :slightly_smiling_face:

The prime use case is

Change Temp Sensor - push change to number.variheat_water_temp_set_point

If the temp is changed on the unit then the next time i change it form HA it will in effect correct itself.

I dont follow what the thermostat must have a temp sensor and cant just manipulate number.variheat_water_temp_set_point directly - but i did not write the code for HA!

I put this in the config file
template:

  • sensor:
    • name: "Pool Set Temperature "
      unit_of_measurement: “°C”
      state: ‘{{ number.variheat_water_temp_set_point | round(1, default=28) }}’

but it did not create a sensor.

What would the correct code be please?

Generic Thermostat minimally requires a source of temperature and a switch to control a source of heat (or cooling). The source of temperature is typically a sensor entity that reports the ambient room temperature. It’s not an entity whose value you can set in Home Assistant’s UI (or programmatically).

I suggest you change the Template Sensor’s configuration to this:

template:
  - sensor:
      - name: Pool Set Temperature
        unit_of_measurement: '°C'
        device_class: temperature
        state: "{{ states('number.variheat_water_temp_set_point') | round(1, default=28) }}"

If I understand your question correctly, you are asking for the wrong thing.

XY problem - Wikipedia.

It seems like you already have an actual physical thermostat, which you want represented in HA. If you want HA to send the setpoint to the real thermostat, then generic thermostat is not what you need. That is used when you have a switch controlling a heating device and a current temperature.

If you want HA to relay the setpoint to the actual thermostat, then think you need something like:

With that you can relay the setpoint to the real thermostat.

Thank you. I will try both of the above.

The reality is i dont want a thermostat at all ! It is just that the graphic representation of the thermostat and how it works is what i want if that makes sense.