Fix PZEM continue energy monitoring when one phase fails (#21968)

This commit is contained in:
Theo Arends 2024-08-15 17:32:11 +02:00
parent bb0db6d8f8
commit 652b9cef87
4 changed files with 12 additions and 10 deletions

View File

@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
### Fixed
- Shutter timing registers overflow (#21966)
- PZEM continue energy monitoring when one phase fails (#21968)
### Removed
- ESP8266 Analog input support using energy driver as only one channel is available

View File

@ -128,6 +128,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
### Fixed
- Shutter timing registers overflow [#21966](https://github.com/arendst/Tasmota/issues/21966)
- PZEM continue energy monitoring when one phase fails [#21968](https://github.com/arendst/Tasmota/issues/21968)
### Removed
- ESP8266 Analog input support using energy driver as only one channel is available

View File

@ -79,11 +79,11 @@ void PzemAcEverySecond(void)
Energy->frequency[PzemAc.phase] = (float)((buffer[17] << 8) + buffer[18]) / 10.0f; // 50.0 Hz
Energy->power_factor[PzemAc.phase] = (float)((buffer[19] << 8) + buffer[20]) / 100.0f; // 1.00
Energy->import_active[PzemAc.phase] = (float)((buffer[15] << 24) + (buffer[16] << 16) + (buffer[13] << 8) + buffer[14]) / 1000.0f; // 4294967.295 kWh
if (PzemAc.phase == Energy->phase_count -1) {
if (TasmotaGlobal.uptime > (PZEM_AC_STABILIZE * ENERGY_MAX_PHASES)) {
EnergyUpdateTotal();
}
}
}
}
if (PzemAc.phase == Energy->phase_count -1) {
if (TasmotaGlobal.uptime > (PZEM_AC_STABILIZE * ENERGY_MAX_PHASES)) {
EnergyUpdateTotal();
}
}
}

View File

@ -81,11 +81,11 @@ void PzemDcEverySecond(void)
Energy->current[PzemDc->channel] = (float)((buffer[5] << 8) + buffer[6]) / 100.0f; // 655.00 A
Energy->active_power[PzemDc->channel] = (float)((buffer[9] << 24) + (buffer[10] << 16) + (buffer[7] << 8) + buffer[8]) / 10.0f; // 429496729.0 W
Energy->import_active[PzemDc->channel] = (float)((buffer[13] << 24) + (buffer[14] << 16) + (buffer[11] << 8) + buffer[12]) / 1000.0f; // 4294967.295 kWh
if (PzemDc->channel == Energy->phase_count -1) {
if (TasmotaGlobal.uptime > (PZEM_DC_STABILIZE * ENERGY_MAX_PHASES)) {
EnergyUpdateTotal();
}
}
}
}
if (PzemDc->channel == Energy->phase_count -1) {
if (TasmotaGlobal.uptime > (PZEM_DC_STABILIZE * ENERGY_MAX_PHASES)) {
EnergyUpdateTotal();
}
}
}