-
Notifications
You must be signed in to change notification settings - Fork 43
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
Incorrect today energy resulting in double amount #245
Comments
This seems to be a similar issue to #126, but just for today_energy |
I created a PR #246, but I think there has to be a better solution. |
It makes total sense to implement a filter indeed, thank you for this. I'd suggest a check in apsystemssocket.py around line 121; when self.qty_of_online_inverters > 0 and self today_energy != 0 then data["today_energy"] = self.today_energy Is that an idea? Btw, I'm running a proxy also and found out the ECU indeed seems to sometimes create these weird values that need filtering. |
That was my first thought as well but I am not familiar enough with the logic of what turns on the inverters on/off. I was worried there could be scenarios where the inverters are off then back on again during the productive period of a day. But I realize now as I am typing this that won't be an issue since we aren't setting a value for today_energy at all. I'll raise a new PR soon. |
That's right, I haven't considered the code change in detail yet - busy with regular work. Taking all scenarios into account, we should be fine with this solution (including the reset of the today_energy initiated by the ECU). Your contribution is highly appreciated Thnx! |
I just realized in my logs when I updated my #246 to have the logic based off that a bad reporting of I considered leaving in the tracking cache date and resetting cached today_energy to 0. But that could be its own can of worms and would best be its own PR, if at all, rather than part of this fix. |
I've recently gotten 2 days of odd results that seem similar to this issue. Didn't have logging on so have no more details. Will try to get some. |
Did you try the beta version allready? |
Yeah I'm on the beta |
Hello, how do I install the beta version? I'm using 1.4.1 and I'm having this same problem. |
Hacs > select overflow menu right from the repository > select redownload > enable the switch Show beta versions |
I downloaded the beta version, but the integration still shows version 1.4.1.... is that really the case? |
Firmware: ECU_R_PRO_2.1.17
Replicated on 1.3.1 and 1.4.1
This happens pretty regularly, every 2nd day or so I would say.
From the logs the issue seems to be that there is a query that returns today_energy as the correct amount, then one that returns zero, and then the next that returns the correct value again.
My guess is that since the state class is total_increasing having it go back down to zero and then back up is causing issues?
Does it maybe make sense to just add a filter that on the same day if today_energy suddenly returns 0 just ignore that query?
I am attaching the full logs, but adding some excerpts to help make it easier.
home-assistant_apsystems_ecur_2024-03-26T08-08-13.633Z.log
Correct response:
Next query returning today_energy = 0
Next response again correct:
Including some screenshots to help visualize what I mean:



The text was updated successfully, but these errors were encountered: