I have a Esp8266 running esphome connected to two PZEM004T v3 reading the parameters of two lines. The entire setup has a power backup so that even when the lines which are read by the pzemoo4t are offline, the esp8266 setup is powered.
The system work fine expect the following issue. When there is a power cut, instead of reading the voltage and other parameters as zero, the device maintains the last non zero reading.
i,e for example if the voltage was 220 when the power was cut, instead of updating voltage to 0v, it would just maintain 220v.
How can I solve this to make sure that when there is a power cut, zero values are reported?
sensor: - platform: pzemac address: 1 modbus_id: mbus current: name: "I1-Current" voltage: name: "V1-Voltage" energy: name: "E1-Energy" id: l1_energy accuracy_decimals: 4 internal: true filters: - lambda: return x * 0.001; unit_of_measurement: kWh power: name: "P1-Power" frequency: name: "L1 Frequency" internal: true power_factor: name: "L1 Power Factor" internal: true update_interval: 10s