Skip to content

Commit

Permalink
Add command SetOption162 1 to disable adding export energy to energ…
Browse files Browse the repository at this point in the history
…y today (#22578)
  • Loading branch information
arendst committed Dec 3, 2024
1 parent 4046cd8 commit 62e4bf1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file.
- Shelly 2PM Gen3 template {"NAME":"Shelly 2PM Gen3","GPIO":[9472,3458,576,225,4736,224,640,608,1,1,193,0,0,0,0,0,0,0,192,32,1,1],"FLAG":0,"BASE":1,"CMND":"AdcGpio4 10000,10000,4000"}
- Shelly i4 Gen3 template {"NAME":"Shelly i4 Gen3","GPIO":[0,0,0,4736,32,195,194,193,1,1,192,0,0,0,0,0,0,0,0,0,1,1],"FLAG":0,"BASE":1,"CMND":"AdcGpio3 10000,10000,4000}
- Show Active Power Total with any multi-phase energy monitoring (#22579)
- Command `SetOption162 1` to disable adding export energy to energy today (#22578)

### Breaking Changed
- ESP32 ArtNet switches from GRB to RGB encoding (#22556)
Expand Down
3 changes: 2 additions & 1 deletion RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
## Changelog v14.3.0.7
### Added
- Command `WebColor20` to control color of Button when Off
- Command `SetOption161 1` to disable display of state text (#22515)
- Command `SetOption161 1` to disable display of state text [#22515](https://github.com/arendst/Tasmota/issues/22515)
- Command `SetOption162 1` to disable adding export energy to energy today [#22578](https://github.com/arendst/Tasmota/issues/22578)
- DALI support for short addresses (gear) and groups
- DALI command `DaliGear` to set max found gear to speed up scan response
- DALI command `DaliGroup` to add gear to groups
Expand Down
4 changes: 3 additions & 1 deletion tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,9 @@ void EnergyUpdateToday(void) {
int32_t delta = Energy->kWhtoday_delta[i] / 1000;
delta_sum_balanced += delta;
Energy->kWhtoday_delta[i] -= (delta * 1000);
Energy->kWhtoday[i] += delta;
if (!Settings->flag6.no_export_energy_today || (delta > 0)) { // SetOption162 - (Energy) Do not add export energy to energy today (1)
Energy->kWhtoday[i] += delta;
}
if (delta < 0) { // Export energy
Energy->kWhtoday_export[i] += (delta *-1);
if (Energy->kWhtoday_export[i] > 100) {
Expand Down
4 changes: 3 additions & 1 deletion tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,9 @@ void EnergyUpdateToday(void) {
int32_t delta = Energy->kWhtoday_delta[i] / 1000;
delta_sum_balanced += delta;
Energy->kWhtoday_delta[i] -= (delta * 1000);
Energy->kWhtoday[i] += delta;
if (!Settings->flag6.no_export_energy_today || (delta > 0)) { // SetOption162 - (Energy) Do not add export energy to energy today (1)
Energy->kWhtoday[i] += delta;
}
if (delta < 0) { // Export energy
RtcEnergySettings.energy_export_kWh[i] += ((float)(delta / 100) *-1) / 1000;
}
Expand Down
7 changes: 4 additions & 3 deletions tools/decode-status.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@
"(MQTT) Disable publish ModbusReceived MQTT messages (1), you must use event trigger rules instead",
"(Counter) Enable counting on both rising and falling edge (1)",
"(LD2410) Disable generate moving event by sensor report - use LD2410 out pin for events (1)",
"",
"","","","",
"(GUI) Disable display of state text (1)",
"(Energy) Do not add export energy to energy today (1)",
"","","",
"","","","",
"","","","",
"","","",""
Expand Down Expand Up @@ -340,7 +341,7 @@
obj = json.load(fp)

def StartDecode():
print ("\n*** decode-status.py v14.3.0.5 by Theo Arends and Jacek Ziolkowski ***")
print ("\n*** decode-status.py v14.3.0.7 by Theo Arends and Jacek Ziolkowski ***")

# print("Decoding\n{}".format(obj))

Expand Down

1 comment on commit 62e4bf1

@jeroenst
Copy link
Contributor

@jeroenst jeroenst commented on 62e4bf1 Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setoption162 is for Today, Yesterday and Total energy, not just for today. I will test option 162 ASAP. Thank you!

Please sign in to comment.