Skip to content

Commit

Permalink
Expanded option72 for Shelly 3EM (ADE7880)
Browse files Browse the repository at this point in the history
Only count import energy in today, yesterday and total when enabling option72 when using Shelly 3EM (ADE7880)
  • Loading branch information
JeroenSt committed Dec 2, 2024
1 parent 341cc87 commit d46bc12
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,13 @@ void EnergyUpdateToday(void) {
int32_t delta = Energy->kWhtoday_delta[i] / 1000;
delta_sum_balanced += 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 d46bc12

Please sign in to comment.