Pzem-004t stops sending value If the power goes out

PZEM-004T stops sending data (eg: PZEM-004T AC power is cut off). The last value is still active and continues to work as if everything is normal.
How do I fix it so that it displays the new value?

By use ESP32

That’s expected because the pzem004 module itself is powered by AC :zap: You might find some hints on how to modify it to be powered by DC with some Google-fu, but it should be obvious that their is nothing to measure if the power (AC) is off :person_shrugging:

If so, I should look at automation. or DC supply To know that the power is out

Surely nothing will work if mains power goes off?

Unless it is on a UPS. I have most of my infrastructure on UPS, so things keep working (we get a lot of outages and have an automatic stand by generator, so the UPS just has to run for a few min normally).

I have a backup power supply for my ESP. I want it to send values ​​during power outages. Because I have backup power for ESP but sent the latest values ​​before the power outage.

And is there value in being able to tell if the power is out or not?

Using a UPS, what does a power outage show?

Ahh, it shows there is no power. But, that is not the reason I have it on the UPS. It is on the UPS so it doesn’t destroy data while it is doing a dirty shutdown due to lack of power AND so that it is more likely to continue working when the generator takes over (since some external services might not be available that are required on boot).

The UPS powers the monitor, but the monitor is monitoring the non-UPS line, which gets transferred to the generator so it also gets monitored.

Very interesting. Where can I see more?