ESP32 AM2301 Tasmota Celsius to Fahrenheit to Celsius issue

Good morning all.

I have a Rocket Controller ESP32R4v3 board running on TASMOTA 14.5.0 and using GPIO 23 have an AM2301 inputting temp.

On the Tasmota webUI I wanted temp to be displayed in Fahrenheit so used the console command

setoption8 1

Result:

Tasmota in Fahrenheit:

But I suppose ESPHome the Tasmota integration in Home Assistant assumes the value sent from Tasmota is always in Celsius so having Fahrenheit set in Home Assistant shows 64 F as 135F (as I’m assuming HA Tasmota assumes all temp data is coming over as Celsius).

I can use the HA Tasmota integration GUI to change to Celsius to give me the right Fahrenheit number but then there is the *C next to the value.

Is there a way to fix this to where I can keep both Tasmota webUI (and syslog output for later log captures) set to F and HA can also reflect that number accurately? (put an F next to the value vs. C).

Example DewPoint set to F, Temp set to C to show the delta:

Tasmota webUI

To start with, is this board flashed with Esphome or Tasmota?

It is flashed with Tasmota

Ok.
So what’s the role of Esphome here?

I misspoke, via MQTT its the Tasmota integration that is displaying the entities.

I did try following this Rocket Controller tutorial

with some additional other guidance to use ESPHome builder to flash the ESP32 to run via ESPhome but all I managed to do was soft brick the ESP and had to use the Tasmota flashing tool to start over fresh (hence loosing Rocket Controller’s custom “ASTRA” dashboard and whatever else they might have packaged in their version of Tasmota).

So just sticking with MQTT and Tasmota integration.

Edited tag to configuration, away from ESPhome.

Hello,

Assuming you are using the Tasmota HA integration, those value have unique ID’s , so if you go into the gear icon of the entities you should be able to set F or C. sometimes it is confused no matter what you so and you will have to create a template sensor based on that number and convert the numbers to be correct. I’s happened to me.

How do I do that?

I have Tasmota set to output as F which seems to confuse HA.

In the GUI I have this drop-down:

If I select C, the number is accurate for F. If I select F, then I assume HA is applying the C to F formula (F= (C) x 5/9 +32) and something like 75F actual is displayed as 167F.

Is there some way to make a custom additional value for that drop down for F ‘special’ and it simply applies F to the numeric being reported, no conversions? Also, how do I make this customization resilient to updates?

This where in the GUI, from a Blog post I did years ago.

I’m confused- I think your vid is just going over how in HA you can now have a drop down when right clicking to tell HA to a) convert the units and b) it puts the unit type at the end of the number (ex: 78 F).

My issue is that the tasmota integration assumes temp values coming over MQTT will always be in C, but within the tasmota device itself I had run the command in console to have tasmota convert and output as F.

This is throwing the conversion way way off in HA.

I have at least found in Developer tools where I can comment out the unit display, so instead of 78 C (but its really 78 F) it displays simply as 78 (because if I used the drop down conversion option it will apply C to F math to a value already coming in as F).

Good bye F or C

Because this drop down applies the wrong conversions (it assumes whats coming over the wire is C)
Dewpoint still has it (didn’t mod it yet)

Temp no longer has drop down

But not does not have F or C next to it, its just a number.

I give up.

I’m sure there is some YAML file (I have no idea where the tasmota integration files can be found) that could get changed to fix this nature but “The juice is not worth the squeeze” (especially without knowing how it would survive updates) so in the tasmota device console I changed “SetOption8 1” to “SetOption8 0”.

image

And now natively in Tasmota its back in C and no longer output natively as F:

So now the options in HA will work/be calibrated.

Though I am curious if I address this bug mentioned in Tasmota’s github of the Home Assistant integration, if when changing things like C to F in Tasmota it can write changes to YAMLs so that the integration adapts correctly.

@Karosm

Its flashed to ESPhome now haha. I really like Tasmota but once I got to needing to setup door sensors and MQTT their status out, decided its time to try ESPhome.

Pretty neat, have all four relays and buttons going, 4 door sensors, BME680 and AM2302 for different locations.

That’s the way!

1 Like