Skip to content

Commit

Permalink
Expanded option72 for Shelly 3EM (ADE7880)) to only count import ener…
Browse files Browse the repository at this point in the history
…gy in today, yesterday and total.
  • Loading branch information
JeroenSt committed Dec 2, 2024
1 parent 341cc87 commit 00d48d1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,14 @@ void EnergyUpdateToday(void) {
if (abs(Energy->kWhtoday_delta[i]) > 1000) {
int32_t delta = Energy->kWhtoday_delta[i] / 1000;
delta_sum_balanced += delta;
Energy->kWhtoday_delta[i] -= (delta * 1000);
Energy->kWhtoday[i] += delta;
Energy->kWhtoday_delta[i] -= (delta * 1000);
#ifdef USE_ADE7880
if (!Settings->flag3.hardware_energy_total || delta > 0) { // Import energy
Energy->kWhtoday[i] += delta;
}
#else
Energy->kWhtoday[i] += delta;
#endif
if (delta < 0) { // Export energy
Energy->kWhtoday_export[i] += (delta *-1);
if (Energy->kWhtoday_export[i] > 100) {
Expand Down

0 comments on commit 00d48d1

Please sign in to comment.