Esp temperature sensor reading Celsius

Hello. All my sensors read Fahrenheit except the one sensor I have connected to and esp32. Any idea why

Conversion method is here.

Thank you for that info. Any idea why this would suddenly change?

I don’t know! :grey_question::grey_question:

Any information about which sensors you use? I can’t think of one which does switch between F and C by either pulling up/down a special pin, but if this happened from itself and did work before it sounds similar to problems where you could switch addresses of a sensor this way. And leaving it free means it could accidently get anything but the assumed state.
Just an idea. Leave some more information about which sensors you do use.

The sensor that is doing this is a DHT. The above mentioned adding a filter is not supported by this sensor. I’m just going to replace it with a sensor that works.

Thanks for all the advise

Hello I have DHT. Just took a look in my ESPHome dashboard logs and see that it is reporting the following. Do you see the same? More than welcome to post logs as that is super helpful to work out what is going on

[21:27:17][C][dht:017]: DHT:
[21:27:17][C][dht:018]:   Pin: GPIO0
[21:27:17][C][dht:024]:   Model: DHT22 (or equivalent)
[21:27:17][C][dht:027]:   Update Interval: 120.0s
[21:27:17][C][dht:029]:   Temperature 'Temperature Roof'
[21:27:17][C][dht:029]:     Device Class: 'temperature'
[21:27:17][C][dht:029]:     State Class: 'measurement'
[21:27:17][C][dht:029]:     Unit of Measurement: '°C'
[21:27:17][C][dht:029]:     Accuracy Decimals: 1
[21:27:17][C][dht:030]:   Humidity 'Humidity Roof'
[21:27:17][C][dht:030]:     Device Class: 'humidity'
[21:27:17][C][dht:030]:     State Class: 'measurement'
[21:27:17][C][dht:030]:     Unit of Measurement: '%'
[21:27:17][C][dht:030]:     Accuracy Decimals: 0

I will try again. When I put the unit of measurement line in the validation says this can’t be used with this sensor type

Compare your code from the other sensors against the one giving the problem.
I’m next to 100% sure the others got a filter with lines similar to this:

  - lambda: return x * (9.0/5.0) + 32.0;
unit_of_measurement: "°F"

Since I can’t easily name a temp-sensor I could buy which does throw °F as default unit.
Well at least not here, nothern hemisphere, planet earth, solar system, milkyway :slight_smile:

I do NOT have a unit of measurement in my yaml file. I DO have a filter and it works. I think it would be good to see you logs as above. Otherwise we are guessing. What humidity and pressure readings are you obtaining? Since we haven’t seen your logs or yaml it is quite difficult to help.