Is there no way in ESPHome to set a climate thermostat definition to Fahrenheit?

I’m trying to do some cool stuff with the climate bang-bang / thermostat options in ESPHome

I defined my thermostat like this:

climate:
  - platform: bang_bang
    name: "Cooling Controller"
    sensor: my_temperature
    default_target_temperature_low: 80
    default_target_temperature_high: 100
    cool_action:
       -- stuff to execute
    idle_action:
       -- other stuff to execute

but when it came up it showed this:
image

80°C ==> 176°F – but I wanted 80°F!

:frowning:

All my temperatures in this ESPHome YAML are in Fahrenheit, not Celsius, but there doesn’t seem to be any documentation on how to set the thermostat so it reports in Fahrenheit.

I reviewed each of these and couldn’t find references on how to make this work:

I did find a little note at the top of the last page that says:

All climate platforms in ESPHome inherit from the climate configuration schema. In ESPHome, °C is assumed for all temperature values. Some platforms allow conversion or setting in °F , this is specified separately.

What does it mean? Where is the ‘climate configuration schema’ defined? Anyone know?

Maybe try

    default_target_temperature_low: 80 °F
    default_target_temperature_high: 100 °F

Thanks @koying, that was a really great suggestion. I tried it out and it actually automatically converted the values internally when I looked at the “Validate YAML” option:

- platform: bang_bang
  name: Attic Fan East Cooling Controller
  sensor: atticfaneast_temperature
  default_target_temperature_low: 26.666666666666668
  default_target_temperature_high: 37.77777777777778

However, after installing it the climate sensor still showed the conversion problem (from all values!):
image

It really seems like it should have at least set the low/high values correctly. :frowning:

Surely a refresh problem.
There is no relation between 26.6 °C and 173.5°F

That’s true but it’s definitely converting the wrong direction because the ESPHome climate system definition is taking 26.6 as 80°C:
image

Then, I think, turning it from Celsius back to Fahrenheit in HA. These conversions make my head hurt…

I think I had played with the climate controls for a little while which may be where the 173.5 value came from – it seems that re-flashing the firmware on the ESPHome device doesn’t overwrite the previously programmed values! I need to figure out how to have these customized values forgotten every flash if there’s a way.

This actually worked. I just had to undo the separate conversion on the lone temperature sensor that I was using to put it into Fahrenheit so that the whole ESPHome YAML was defined in Celsius. Once I did that it showed me the values I expected in HA:

image

It still keeps whatever values you had previously changed, I’m not sure there’s a way to force the firmware flash to overwrite those values but at least this is working correctly now.

Thanks again @koying for pointing me in the right direction!

2 Likes

I have the same issue. My raw values are in F and now ESPhome and/or HA does a double conversion and I end up with 140F instead of 60F.

I have tried changing the units of min_temperature, max_temperature and temperature_step but nothing changed.

Is there anything else I need to do?
Or do I need to add code that converts the F raw sensor values first to C?