Fix Shelly3EM energy calculation

This commit is contained in:
Theo Arends 2022-03-23 11:48:04 +01:00
parent a88e28a11a
commit b6b53516e0
1 changed files with 2 additions and 1 deletions

View File

@ -482,7 +482,7 @@ void Ade7880Cycle(void) {
Energy.data_valid[phase] = 0;
Energy.voltage[phase] = (float)Ade7880ReadVerify(ADE7880_AVRMS + (phase * 2)) / 10000; // 0x43C1 - 0x0024CC94 = 241.1668 V
Energy.current[phase] = (float)Ade7880ReadVerify(ADE7880_AIRMS + (phase * 2)) / 100000; // 0x43C0 - 0x00002D6D = 0.11629 A
Energy.active_power[phase] = (float)Ade7880ReadVerify(ADE7880_AWATT + phase) / 100; // 0xE513 - 0xFFFFF524 = -27.79 W (wrong calibration)
Energy.active_power[phase] = (float)Ade7880ReadVerify(ADE7880_AWATT + phase) / 100; // 0xE513 - 0xFFFFF524 = -27.79 W
Energy.apparent_power[phase] = (float)Ade7880ReadVerify(ADE7880_AVA + phase) / 100; // 0xE519 - 0xFFFFF50D
Energy.frequency[phase] = 256000.0f / Ade7880ReadVerify(ADE7880_APERIOD + phase); // 0xE905 - Page 34 and based on ADE7880_FREQ_INIT
Ade7880.active_energy[phase] = Ade7880ReadVerify(ADE7880_AWATTHR + phase); // 0xE400 - 0xFFFFFF8F = -0.112 kWhr ??
@ -516,6 +516,7 @@ void Ade7880EnergyEverySecond(void) {
Energy.kWhtoday_delta[i] += Energy.active_power[i] * 1000 / 36;
}
}
EnergyUpdateToday();
}
bool Ade7880SetDefaults(const char* json) {