My electricity counter has already measured 190 million units. This result does not fit into a 32 bits float: reads jumps hundreds of units on each update, which does not happen every second as it should but only after I have consumed enough electricity to make the change noticeable with the resolution of a 32 bit float.
The counter has 10 years, so switching to a signed 32 bit integer or a double float should give me enough resolution to hold the readings for the remaking of my life.
Is there any plan in ESPHome to support integer or double sensors to improve the accuracy?
Right now I have to pass readings around as text, which makes numeric sensor filters unavailable, requires custom handling everywhere to convert it to/from a number, making things super complex.
I can’t answer your specific question regarding registers in ESPhome but have you looked at the pulse_meter integration:
When used for calculating energy in kWh this creates a “total increasing” sensor which still functions correctly even when the pulse_meter gets reset (e.g. on a reboot) or in the case of a rollover of the counter.
My electricity counter does not use light pulses but an infrared serial port using some binary protocol that post every second energy consumption as a 64 bit integer in Watts-hour (and more)