Decimals provided by ESPHome device ignored by HA?

Hi,

After updating to HA 2025.7.0 I and ESPHome 2025.6.2 (and recently 6.3) I noticed the sensor data in HA is shown different decimals then send by ESPHome

ESPHome logging shows
[08:40:40][D][sensor:098]: ‘Water usage Batch’: Sending state 1.00000 L with 0 decimals of accuracy

HA development tools → Current entity states
sensor.water_usage_batch
esp08 Water usage Batch
1.0 unit_of_measurement: L
icon: mdi:water
friendly_name: esp08 Water usage Batch

Previously the value was 1 in stead of 1.0

The same for a temperature sensor:
ESPHome:
[11:47:01][D][sensor:098]: ‘esp13_temperature’: Sending state 28.43750 °C with 1 decimals of accuracy

sensor.esp13_temperature
esp13 esp13_temperature
28.4375 state_class: measurement
unit_of_measurement: °C
device_class: temperature
friendly_name: esp13 esp13_temperature

I first thougt that HA was ignoring the decimal option send by ESPHome, but that does not make sense looking at the data of the temp. sensor.

Please fix as I present the data on some displays and then info does not fit on it.
Thanks,

1 Like

There’s extensive debate around this HERE.

1 Like

I read the discussion.
I just wonder there’s an option in ESPHome sensor called “accuracy_decimals:” if it’s ignored & raw data is sent.

Yes - the raw data is sent. Read the main topic linked above if you want to see if it’s going to change.

Well, all i can say is that it seems that it’s obsolete now…

omg ok thank you for this! I thought i was going crazy.

I have a dallas temp sensor picking up the temp of my pool, and rounded to 1 decimal place.

i then have another esp8266 outputting to a display the pool temp in the bedroom and suddenly its displaying a whole whack of decimals throwing the formatting on the display all off.

guess ill live with it for now, follow this thread, and home its fixed soon.

It won’t be any fix, because this was a planned decision of devs, for compatibility’s sake. So you’ll have to “fix” your entities by yourself, either with rounding inside HA, or supposely it works if you use (some kind of) lambda in esphome module - but i didn’t explore that yet, so i can’t give you more info.

Protoncek mentioned fixing the entries in HA. In case the OP (or anyone looking at this thread later) is wondering, that is done in the entity details. If you open an entity and then click on the gear icon, you’ll see something like this where you can change the decimals shown for a numeric entry. This is a global change.

Note however that this setting doesn’t affect templates in HA. There are intentions to change that, though, as i’ve read elsewhere.

It was closed.

1 Like

for me even after changing the Display precision i still get decimal

it doesn’t make sense to me.
esphome sends the value with 0 decimals of accuracy and the entity in the integration shows the value with 0 decimals.

but HA changes it to 1 decimal accuracy.
adding a round filter in esphome doesn’t fix it, nor accuracy_decimals.
haven’t tried lambda yet.
changing the display precision doesn’t do anything, even changing to more than 1 decimal, it stays the same, always x.0
to me that’s a bug.

It doesn’t make sense to me either, but that’s supossedly how it should be… :thinking:

But, to be honest, if i set precision to, say, 1 in esphome then esphome should send value:
sending state 29.1 with 1 decimal precision
and not
sending 29.1000000 with i decimal precision (rounded with round filter)
or even
sending 29.1345322 with i decimal precision (rounded with accuracy_decimals)

So far i didn’t find a way to send a value from esphome with only 1 decimal, it’s always sent with “plenty”… if nothing else, with trailing zeroes…accuracy_decimals doesn’t help, round filter doesn’t help…