kWh reset issues

ok, i know this error/ problem has been around for a long time. but i can’t seem to find a permanent fix, or a consistent cause of the error.

I self host Emoncms on a Debian VM,
VM is shutdown for full disk backup every night, at the same time every night.
most times the Kwh feeds continue as normal, randomly i have to post process them to fix the resets in them.
I also use Home assistant and feed the data to the Energy Monitoring there, and of course the KWH resets really throw all that data out.

i have 3 emonTX3’s transmitting to my Debain VM with EmonESP’s
i have MQTT enabled in the EmonESP and published to HA broker, but dont use that data for anything, but quite happy to if that could be a solution.

My EmonCMS install is all up to date, latest versions.

any thoughts on how to finally fix this without having to post process? and to feed consistent reliable data to Home Assistant.

thank, Melv.

What do you use from those transmissions? The four energy values (in Wh, not kWh) are accumulated in the emonTx V3 (assuming you are using the emonLibCM version), so those are totally separate from an energy value accumulated in emonCMS, and so will not only survive a transmission failure to your Debian machine but continue to accumulate while that machine is shut down each night. What will cause a reset and start the accumulation from zero is a restart of the emonTx V3. As you’re probably aware, energy accumulated in emonCMS can be retained when the incoming value resets to zero. I don’t know anything about HA etc, so I suggest you look to see if it has the capability of something similar but involving selecting the ‘best’ of the two accumulated energies (the emonTx’s or emonCMS’s) and continuing with whichever it deems the “correct” value (and presumably adding a constant to the “wrong” value to bring it up to date). It might be something an HA expert will be able to advise on.

I use the data from the TX3’s in Emoncms to keep track of power usage of each circuit.

its been a long time ( years) since i did any firmware updates on the emontx3’s themselves. but i do not have any accumulative Wh inputs being sent from the EmonESP’s.
All my cumulative feeds are generated from the 4 CT inputs and process modifiers to generate the applicable feeds.
Hence when i have a VM reboot, something happens ( not consistently) to reset the Kwh feeds and require a post process event to rebuild them.

Which emonTx do you have, V3.2 or V3.4?

My notes say that the emonLibCM version of the sketch for the emonTx V3.4 was first released in October 2019, and I’m fairly certain that the energy values were included in the first issue. They were not included in the default software for the emonTx V3.2 as far as I’m aware, though I do have a sketch called “emonTxV3_continuous_kwhtotals_noeeprom” based on Robin Emley’s PV Router which does report energy values.

I did understand what your problem was, I don’t understand enough about the 3rd party applications to suggest a cure, what I was suggesting is a possible alternative if you or someone more knowledgeable than I could not trace the source of your problem. If you’re not using emonLibCM, I’d suggest you might - not necessarily, depending on the type of loads you have - get more accurate data if you update to the latest sketch and recalibrate your emonTx’s. If you have emonTx V3.2s, you’d need to completely disable the radio and ensure you only use the ESP8266 for data transmission. The emonLibCM software will run on an emonTx V2 and both emonTx V3 versions, but a few pin changes might be necessary.

my emontx3’s were purchased back in may 2017.
so whichever version that is.
i’ll try and find a bit of time to grab 1 out and refresh my memory of exactly what i have physically and firmware wise.