Skip to content

Commit

Permalink
Fix PZEM continue energy monitoring when one phase fails (#21968)
Browse files Browse the repository at this point in the history
  • Loading branch information
arendst committed Aug 15, 2024
1 parent bb0db6d commit 652b9ce
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions tasmota/tasmota_xnrg_energy/xnrg_05_pzem_ac.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions tasmota/tasmota_xnrg_energy/xnrg_06_pzem_dc.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
Expand Down

1 comment on commit 652b9ce

@sheminasalam
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have checked this commit but I am facing the following problems.

  1. At power loss of single phase, even when the open phase(L2 in the image below) shows 0 volts, the other phases(L1 & L2) jumps between 0 and original value. It becomes normal only when the power is restored.
    wer

  2. At startup, if one phase is down, it wont work.

Please sign in to comment.