mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 11:16:34 +00:00
Add Energy Log level 4 message when (Calculated) Apparent Power is less than Active Power indicating wrong calibration (#20653)
This commit is contained in:
parent
4f62a0deab
commit
c5b92d3ab1
@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
## [14.2.0.1]
|
||||
### Added
|
||||
- Energy Log level 4 message when (Calculated) Apparent Power is less than Active Power indicating wrong calibration (#20653)
|
||||
|
||||
### Breaking Changed
|
||||
|
||||
@ -13,9 +14,12 @@ 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)
|
||||
- Energy calculation (#20653)
|
||||
|
||||
### Removed
|
||||
- ESP8266 Analog input support using energy driver as only one channel is available
|
||||
- Energy force Active Power equals Apparent Power when (Calculated) Apparent Power is less than Active Power (#20653)
|
||||
- Energy force Power Factor to be always 1 or lower (#20653)
|
||||
|
||||
## [Released]
|
||||
|
||||
|
@ -121,14 +121,18 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
|
||||
|
||||
## Changelog v14.2.0.1
|
||||
### Added
|
||||
- Energy Log level 4 message when (Calculated) Apparent Power is less than Active Power indicating wrong calibration [#20653](https://github.com/arendst/Tasmota/issues/20653)
|
||||
|
||||
### Breaking Changed
|
||||
|
||||
### Changed
|
||||
|
||||
### Fixed
|
||||
- Energy calculation [#20653](https://github.com/arendst/Tasmota/issues/20653)
|
||||
- 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
|
||||
- Energy force Active Power equals Apparent Power when (Calculated) Apparent Power is less than Active Power [#20653](https://github.com/arendst/Tasmota/issues/20653)
|
||||
- Energy force Power Factor to be always 1 or lower [#20653](https://github.com/arendst/Tasmota/issues/20653)
|
||||
- ESP8266 Analog input support using energy driver as only one channel is available
|
||||
|
@ -1191,17 +1191,30 @@ void EnergyShow(bool json) {
|
||||
else if (0 == Energy->current[i]) {
|
||||
apparent_power[i] = 0;
|
||||
}
|
||||
/*
|
||||
if (apparent_power[i] < Energy->active_power[i]) { // Should be impossible
|
||||
Energy->active_power[i] = apparent_power[i];
|
||||
}
|
||||
|
||||
power_factor[i] = Energy->power_factor[i];
|
||||
if (isnan(power_factor[i])) {
|
||||
power_factor[i] = (Energy->active_power[i] && apparent_power[i]) ? Energy->active_power[i] / apparent_power[i] : 0;
|
||||
if (power_factor[i] > 1) {
|
||||
if (power_factor[i] > 1) { // Should not happen (Active > Apparent)
|
||||
power_factor[i] = 1;
|
||||
}
|
||||
}
|
||||
*/
|
||||
power_factor[i] = Energy->power_factor[i];
|
||||
if (isnan(power_factor[i])) {
|
||||
power_factor[i] = (Energy->active_power[i] && apparent_power[i]) ? Energy->active_power[i] / apparent_power[i] : 0;
|
||||
}
|
||||
if (apparent_power[i] < Energy->active_power[i]) { // Should be impossible
|
||||
if (apparent_power[i]) {
|
||||
if ((power_factor[i] > 1.005) && (power_factor[i] < 2.0f)) { // Skip below 0.5% and don't expect 50% differences
|
||||
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("NRG: Calibrate as Active %3_fW > Apparent %3_fVA (PF = %4_f)"),
|
||||
&Energy->active_power[i], &apparent_power[i], &power_factor[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
reactive_power[i] = Energy->reactive_power[i];
|
||||
if (isnan(reactive_power[i])) {
|
||||
|
@ -1533,17 +1533,30 @@ void EnergyShow(bool json) {
|
||||
else if (0 == Energy->current[i]) {
|
||||
apparent_power[i] = 0;
|
||||
}
|
||||
/*
|
||||
if (apparent_power[i] < Energy->active_power[i]) { // Should be impossible
|
||||
Energy->active_power[i] = apparent_power[i];
|
||||
}
|
||||
|
||||
power_factor[i] = Energy->power_factor[i];
|
||||
if (isnan(power_factor[i])) {
|
||||
power_factor[i] = (Energy->active_power[i] && apparent_power[i]) ? Energy->active_power[i] / apparent_power[i] : 0;
|
||||
if (power_factor[i] > 1) {
|
||||
if (power_factor[i] > 1) { // Should not happen (Active > Apparent)
|
||||
power_factor[i] = 1;
|
||||
}
|
||||
}
|
||||
*/
|
||||
power_factor[i] = Energy->power_factor[i];
|
||||
if (isnan(power_factor[i])) {
|
||||
power_factor[i] = (Energy->active_power[i] && apparent_power[i]) ? Energy->active_power[i] / apparent_power[i] : 0;
|
||||
}
|
||||
if (apparent_power[i] < Energy->active_power[i]) { // Should be impossible
|
||||
if (apparent_power[i]) {
|
||||
if ((power_factor[i] > 1.005) && (power_factor[i] < 2.0f)) { // Skip below 0.5% and don't expect 50% differences
|
||||
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("NRG: Calibrate as Active %3_fW > Apparent %3_fVA (PF = %4_f)"),
|
||||
&Energy->active_power[i], &apparent_power[i], &power_factor[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
reactive_power[i] = Energy->reactive_power[i];
|
||||
if (isnan(reactive_power[i])) {
|
||||
|
@ -208,16 +208,15 @@ void HlwEverySecond(void) {
|
||||
Hlw.cf1_current_pulse_length = 0;
|
||||
Hlw.cf_power_pulse_length = 0;
|
||||
} else {
|
||||
uint32_t hlw_len;
|
||||
|
||||
if (Hlw.energy_period_counter) {
|
||||
|
||||
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("HLW: EPC %u, CFlen %d usec"), Hlw.energy_period_counter, Hlw.cf_pulse_length);
|
||||
|
||||
hlw_len = 10000 * 100 / Hlw.energy_period_counter; // Add *100 to fix rounding on loads at 3.6kW (#9160)
|
||||
uint32_t hlw_len = 10000 * 100 / Hlw.energy_period_counter; // Add *100 to fix rounding on loads at 3.6kW (#9160)
|
||||
Hlw.energy_period_counter = 0;
|
||||
if (hlw_len) {
|
||||
Energy->kWhtoday_delta[0] += (((Hlw.power_ratio * EnergyGetCalibration(ENERGY_POWER_CALIBRATION)) / 36) * 100) / hlw_len;
|
||||
// Energy->kWhtoday_delta[0] += Energy->active_power[0] * 1000 / 36;
|
||||
EnergyUpdateToday();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user