I have had a ESPHome device running for about 2 years now that measures the level of water in my sump pump and reports that value in meters. I have not modified the device for a very long time.
I noticed today that HA was showing the value in ‘ft’. Now, I am certain I never changed it to feet, so I can only assume some update to HA has changed the default units? The ESPHome YAML for the device is, and has always been, setting the units to meters:
# Calculation of sump water level based on sensor current
- platform: template
name: "${friendly_name} Level"
id: level_actual
update_interval: 1s
accuracy_decimals: 3
internal: false
state_class: measurement
device_class: distance
unit_of_measurement: m
I went into the entity settings and changed the units from the dropdown to ‘m’. And so the preview of the history (which I recall uses statistics data and not the states data) is showing that all values are now correct:
But when looking at this history tab (which shows the states data when it exists), all the old data is not converted from the “feet” values except for the values in the past ~15 minutes since I changed the units from the dropdown menu:
So…
1: Did something change where HA will select “preferred” units for certain entities?
2: When the units are changed via the dropdown, does HA change what is now recorded in the recorder database and in the long term statistics database?
3: When the units are changed via the dropdown, is HA supposed to change historical data that has already been recorded to the recorder database and the long term statistics database?
Seems like something is very wrong here.
Edit: Since I am feeding this data into InfluxDB, I looked at this in Grafana and can see that the entity changed units on Feb 18th 2024. I am still looking to figure out why, or if I updated something on that date.