Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loss of energy total data by updating to 12.4.0 #18024

Closed
wohack opened this issue Feb 22, 2023 · 11 comments
Closed

Loss of energy total data by updating to 12.4.0 #18024

wohack opened this issue Feb 22, 2023 · 11 comments
Assignees
Labels
bug Type - Confirmated Bug fixed Result - The work on the issue has ended

Comments

@wohack
Copy link

wohack commented Feb 22, 2023

When updating from e.g. 12.0.2 or 12.3.1 to 12.4.0 the energy total value is lost. At low values the value is 0 after the update, at high values it is about 40 times smaller.
Screenshot after update 2023-02-22 192556
Screenshot before update 2023-02-22 192403
Screenshot after update 2023-02-22 193948
Screenshot before update 2023-02-22 193626

@Elektrik1
Copy link

+1, exactly the same situation.

@tidde88
Copy link

tidde88 commented Feb 23, 2023

same here

@arendst
Copy link
Owner

arendst commented Feb 24, 2023

Gents I need the requested information when you'all openend this issue. Without it would be guessing what's going on.

@arendst arendst self-assigned this Feb 24, 2023
@wohack
Copy link
Author

wohack commented Feb 24, 2023

It happens during a standard update. Installed was on most of my devices 12.0.2 DE
http://ota.tasmota.com/tasmota/release-12.0.2/tasmota-DE.bin.gz
on two devices 12.3.1 DE, but one of them with a Tuya MCU.
http://ota.tasmota.com/tasmota/release-12.3.1/tasmota-DE.bin.gz
I upgraded them to minimal.bin
http://ota.tasmota.com/tasmota/release/tasmota-minimal.bin.gz
and then in the next step to 12.4.0 DE
http://ota.tasmota.com/tasmota/release/tasmota-DE.bin.gz
Nothing special. I recognized that the data was lost on all devices that have the energy total calculated in the software.
The device with the Tuya MCU still has the correct values because the data is stored in the MCU.
After getting awareness of whats happening I updated two other devices where you can see the screenshots.
Allways from 12.0.2 to 12.4.0 as you can see on the bottom of the screenshots
The energy total values are different after the update. energy today and energy yesterday are unchanged.
0.067 to 0.000 on the one and 16.651 to 0.300 on the other.
After the screenshots I opened the ticket.

@arendst
Copy link
Owner

arendst commented Feb 24, 2023

Since v12.4.0 the internal energy totals representation should have been divided by 100 to accomodate larger total values. For a user this should have been "invisible". Tests we did indeed provided the expected results.

What do you see if you set EnergyRes 5? It shows more resolution and might show instead of 0.067 to 0.000, 0.00067

@arendst
Copy link
Owner

arendst commented Feb 24, 2023

I think I know where it goes wrong.

When a newer version tasmota is installed it checks if the version number has changed and if so performs settings changes supported by the newer version.

In this case it performs the new energy total calculation in both settings AND RTC storage.

The minimal version is supposed the be not updating settings and that works fine except this time I also made the energy total change in RTC memory which is now executed twice. Once by the minimal version and once by the final version.

As I test without the intermediate minimal version I didn't see this double divide.

I'll do some tests and will change the minimal version not to update both settings AND RTC storage.

arendst added a commit that referenced this issue Feb 24, 2023
Fixed EnergyTotal divided twice during minimal upgrade step regression from v12.3.1.3 (#18024)
@arendst
Copy link
Owner

arendst commented Feb 24, 2023

@arendst arendst added bug Type - Confirmated Bug fixed Result - The work on the issue has ended labels Feb 24, 2023
@Jason2866
Copy link
Collaborator

@arendst Did this bug only affected esp8266 devices?

@arendst
Copy link
Owner

arendst commented Feb 24, 2023

Not sure. I expect safeboot not to update the RTC but perhaps it's best I push the fix to master and generate new safeboot/factory images too.

@arendst
Copy link
Owner

arendst commented Feb 25, 2023

Done. It's now fixed in latest master release from February 24th for all binaries.

ZioFabry pushed a commit to Biomine-Sustainable-Mining/Tasmota that referenced this issue Feb 25, 2023
Fixed EnergyTotal divided twice during minimal upgrade step regression from v12.3.1.3 (arendst#18024)
@wohack
Copy link
Author

wohack commented Feb 26, 2023

I agree, tested on multiple devices, it's fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type - Confirmated Bug fixed Result - The work on the issue has ended
Projects
None yet
Development

No branches or pull requests

5 participants