Teleinfo use Apparent Power as Active Power approximation (#19756)

This commit is contained in:
s-hadinger 2023-10-16 08:20:07 +02:00 committed by GitHub
parent d3784a26ab
commit 8467b41290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file.
- MAX31855/MAX6675 sensors driver support up to 6 (#19329) - MAX31855/MAX6675 sensors driver support up to 6 (#19329)
- ESP32 analog from `analogRead()` to calibrated `analogReadMilliVolts()` (#19732) - ESP32 analog from `analogRead()` to calibrated `analogReadMilliVolts()` (#19732)
- I2S refactoring in preparation for core 3 (#19749) - I2S refactoring in preparation for core 3 (#19749)
- Teleinfo use Apparent Power as Active Power approximation
### Fixed ### Fixed
- ESP32 shutter frequency (#19717) - ESP32 shutter frequency (#19717)

View File

@ -334,11 +334,11 @@ void DataCallback(struct _ValueList * me, uint8_t flags)
AddLog(LOG_LEVEL_DEBUG, PSTR("TIC: Power %s=%s, now %d"), me->name, me->value, (int) power); AddLog(LOG_LEVEL_DEBUG, PSTR("TIC: Power %s=%s, now %d"), me->name, me->value, (int) power);
if (ilabel == LABEL_PAPP || ilabel == LABEL_SINSTS1 || (ilabel == LABEL_SINSTS && Energy->phase_count == 1)) { if (ilabel == LABEL_PAPP || ilabel == LABEL_SINSTS1 || (ilabel == LABEL_SINSTS && Energy->phase_count == 1)) {
Energy->apparent_power[0] = power; Energy->active_power[0] = Energy->apparent_power[0] = power;
} else if (ilabel == LABEL_SINSTS2) { } else if (ilabel == LABEL_SINSTS2) {
Energy->apparent_power[1] = power; Energy->active_power[1] = Energy->apparent_power[1] = power;
} else if (ilabel == LABEL_SINSTS3) { } else if (ilabel == LABEL_SINSTS3) {
Energy->apparent_power[2] = power; Energy->active_power[2] = Energy->apparent_power[2] = power;
} }
} }