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

Question: Incorrect statistics when MQTT was down over new year #535

Open
bj00rn opened this issue Apr 24, 2024 · 8 comments
Open

Question: Incorrect statistics when MQTT was down over new year #535

bj00rn opened this issue Apr 24, 2024 · 8 comments

Comments

@bj00rn
Copy link
Contributor

bj00rn commented Apr 24, 2024

Had my MQTT bridge down over Christmas and when I started it again (on 9th of January) wrong values seem to have been recorded in statistics.

I got negative statistic for export/import corresponding to the total production/consumption.

I guess the fix is to correct the statistic manually. It would be interesting to know why this happened in the first place.

Is this expected statistics behaviour when a sensor has been unavailable?
image

@bj00rn
Copy link
Contributor Author

bj00rn commented Apr 24, 2024

Edit: I resolved the problem and removed all the incorrect negative statistics for all total increasing sensors.

@argoyle
Copy link
Collaborator

argoyle commented Apr 25, 2024

Hmmm, it shouldn't happen just because the sensor goes unavailable I think. Those are strictly increasing sensors if I don't misremember and those are reset if the values decrease. Could be that you were bitten by the problem some others have had that the EnergyHub decreased some sensor values in some update.

@bj00rn
Copy link
Contributor Author

bj00rn commented Apr 25, 2024

Hmmm, it shouldn't happen just because the sensor goes unavailable I think. Those are strictly increasing sensors if I don't misremember and those are reset if the values decrease.

Could be that you were bitten by the problem some others have had that the EnergyHub decreased some sensor values in some update.

Hard to tell since state (kept for two weeks) has been cleared from state tables and moved to statistics by now. When I removed the statistics outliers the statistic recovered fine though. I highly suspect this is related to MQTT bridge coming back online. I will try checking what the EH is reporting.

@brandgul01
Copy link

brandgul01 commented May 14, 2024

I might have a similar problem. installed MQTT bridge via mosquito yesterday and had a gap in maybe two weeks with no statistics saved. Before I connected directly with HAs client to Energyhubs broker. Today my energy-view is bananas. I found a large minus stat in mars with the method you used bjOOrn and removed it. but it didn't solve the problem. If I look at the sensors individually everything looks ok to me but added to HA internal energy page it doesn't make sense at all. I will try to continue to solve this, with the limited HA knowledge I have.
Skärmavbild 2024-05-14 kl  23 13 58
Skärmavbild 2024-05-14 kl  23 09 00
Skärmavbild 2024-05-14 kl  23 08 52

@argoyle
Copy link
Collaborator

argoyle commented May 15, 2024

The energy dashboard uses the long term statistics (which of course is based on the sensor values). It stores differences over a given time period for the sensor values. Some of the sensors are of the "strictly increasing" type and when a value is received from the EH that is lower than the previous value the sensor is reset which will cause a spike. The value should be strictly increasing from EH as well but I know that there was a problem for some users in a firmware update version some time back.

@bj00rn
Copy link
Contributor Author

bj00rn commented May 15, 2024

@brandgul01 adjust all weird looking statistic entries to 0 fixed it for me. You probably forgot some. Once you have found the exact time the process is straightforward

@brandgul01
Copy link

@bj00rn I used the button "find extreme values". Very useful. Will go through all again. Also strange that I get no values on the home-icon. But I guess it's caused by the same fault.
@argoyle Thanks for your input as well. If the problem is on the EH-side with a suddenly changed value to the negative I guess it's impossible for anyone then Ferroamp to adjust that. Should be possible to see in the web portal stats though.

@brandgul01
Copy link

Update: Found an extra extreme value, changed it to "0" and now everything works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants