Skip to content

Commit

Permalink
Fix energy total counters
Browse files Browse the repository at this point in the history
Fix energy total counters (#9263, #9266)
  • Loading branch information
arendst committed Sep 9, 2020
1 parent a89f208 commit 8bac498
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
- Change White blend mode to using command ``SetOption 105`` instead of ``RGBWWTable``
- Fix ESP32 PWM range
- Fix display power control (#9114)
- Fix energy total counters (#9263, #9266)
- Add command ``SetOption102 0/1`` to set Baud rate for Teleinfo communication (0 = 1200 or 1 = 9600)
- Add command ``SetOption103 0/1`` to set TLS mode when TLS is selected
- Add command ``SetOption104 1`` to disable all MQTT retained messages
Expand Down
1 change: 1 addition & 0 deletions tasmota/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### 8.4.0.3 20200823

- Fix energy total counters (#9263, #9266)
- Change references from http://thehackbox.org/tasmota/ to http://ota.tasmota.com/tasmota/
- Add command ``PowerDelta1`` to ``PowerDelta3`` to trigger on up to three phases (#9134)
- Add Zigbee web ui widget for Lights
Expand Down
4 changes: 2 additions & 2 deletions tasmota/xnrg_01_hlw8012.ino
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ void HlwEverySecond(void)
unsigned long hlw_len;

if (Hlw.energy_period_counter) {
hlw_len = 10000 * 1000 / Hlw.energy_period_counter; // Add *1000 to fix rounding on loads at 3.6kW (#9160)
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 += ((Hlw.power_ratio * Settings.energy_power_calibration) * 1000 / hlw_len) / 36;
Energy.kWhtoday_delta += (((Hlw.power_ratio * Settings.energy_power_calibration) / 36) * 100) / hlw_len;
EnergyUpdateToday();
}
}
Expand Down

0 comments on commit 8bac498

Please sign in to comment.