-
Notifications
You must be signed in to change notification settings - Fork 6
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
Rogue negative value in energy dashboard #30
Comments
@bsp9493 thank you for reporting the issue! |
Yes, that appears to be the issue.dOn Aug 18, 2023, at 9:27 AM, Konstantin Deev ***@***.***> wrote:
@bsp9493 thank you for reporting the issue!
Is the negative value magnitude equal to the actual water meter reading?
I may need to add more logs into the source code and release another beta
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I just got this integration set up in the Beta version that attempts to fix this, I am having the same issue. |
Unfortunately, I cannot reproduce the problem on my end, I saw it a couple of times, but I was not able to understand the root.
And I released this code in |
Got this error on the new beta release
|
Sorry, my bad. |
Just release v2.0.1-beta.3. |
The issue actually may have been resolved with your changes, Ill will report back if I have the issue again, but it seems to be looking correct now. |
Great, then I know where was the issue: the integration never sorted to data points and it probably caused the wrong import. |
Crap.. it was resolved but I checked again and it looks like it happened again. Here is the logged data set, its huge.
|
The data looks ok. |
Please try v2.0.1-beta.6 |
Looks good on my enddOn Aug 18, 2023, at 7:34 PM, Konstantin Deev ***@***.***> wrote:
Please try v2.0.1-beta.6
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Mine is still not right, I did a couple of restarts and reloaded the integration, @bsp9493 you may want to check back in a few because mine looked okay, and then went back to negative. |
Oh…Yes, you r right, initial start up was ok, Went back and it’s back:(dOn Aug 18, 2023, at 7:59 PM, ParkerAnderson9 ***@***.***> wrote:
Mine is still not right, I did a couple of restarts and reloaded the integration, @bsp9493 you may want to check back in a few because mine looked okay, and then went back to negative.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Please try v2.0.1-beta.7 |
Nope… same result.As far as I can figure the negative value looks to be the negative of my fatal meter reading PLUS my daily usage.Ie -(600000 litres total usage)+ 4000 litres daily usage (my sprinklers were on)=-596000dOn Aug 18, 2023, at 10:39 PM, Konstantin Deev ***@***.***> wrote:
Please try v2.0.1-beta.7
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
My total usage in stats is approx 600000 LBeta 7 showed ~ (-)600000LBeta 8 shows ~ (-) 580000LSo something changed.It’s like the - number is somehow a leftover amount that gets posted as the most current reading in the energy dashboarddOn Aug 18, 2023, at 10:48 PM, David Morhun ***@***.***> wrote:Nope… same result.As far as I can figure the negative value looks to be the negative of my fatal meter reading PLUS my daily usage.Ie -(600000 litres total usage)+ 4000 litres daily usage (my sprinklers were on)=-596000dOn Aug 18, 2023, at 10:39 PM, Konstantin Deev ***@***.***> wrote:
Please try v2.0.1-beta.7
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@bsp9493 |
Same:(I should be getting another update (from Eyeonwater) soon… Will check back then.l, but beta 9 the same:(Any debug logging I can turn on that might help?Could it be an issue with where energy dashboard is getting its numbers from??!I’m using mariadb as my recorder, not the homeassistant default.dOn Aug 19, 2023, at 7:45 AM, Konstantin Deev ***@***.***> wrote:
@bsp9493
Thank you for the effort.
I still have no idea what's wrong, but I keep doing some blind fixes in the hope to mitigate the issue.
Could you please try v2.0.1-beta.9?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@ParkerAnderson9 Thank you for the answer. |
It seems that it is still having issues on v2.0.0, I think Im getting closer to understanding why, but I am not sure what the correct fix would be, it definitely has something to do with it trying to correct for the initial value 30 days ago, I modified the code and imported all of the data from when I purchased my house, which started somewhere around 132k gallons, and then because it re-imports every restart I set it back to 30 days, but now since it doesnt have the history on those 132k gallons it is a struggling to figure out what is going on, if I modify the statistics I can get it to read correctly until I restart, it is quite strange.. I am not sure what I can do to help, It has been a long time since I have messed with Python, but I might be able to help debug what is going on. Thank you for being on top of helping out with these issues |
Here is an example I finally got of what it has done.. Data Export[ { "id": 327861, "created": null, "start": null, "mean": null, "min": null, "max": null, "last_reset": null, "state": 307987.1, "sum": -660004.5000000001, "metadata_id": 108, "created_ts": 1692475210.614239, "start_ts": 1692471600.0, "last_reset_ts": null }, { "id": 327734, "created": null, "start": null, "mean": null, "min": 132000.5, "max": 132000.5, "last_reset": null, "state": null, "sum": 132000.5, "metadata_id": 108, "created_ts": 1692469961.6563652, "start_ts": 1654232400.0, "last_reset_ts": null }, { "id": 327733, "created": null, "start": null, "mean": null, "min": 132000.5, "max": 132000.5, "last_reset": null, "state": null, "sum": 132000.5, "metadata_id": 108, "created_ts": 1692469961.6553204, "start_ts": 1654236000.0, "last_reset_ts": null }, { "id": 327732, "created": null, "start": null, "mean": null, "min": 132000.5, "max": 132000.5, "last_reset": null, "state": null, "sum": 132000.5, "metadata_id": 108, "created_ts": 1692469961.6542974, "start_ts": 1654239600.0, "last_reset_ts": null }, { "id": 327731, "created": null, "start": null, "mean": null, "min": 132000.5, "max": 132000.5, "last_reset": null, "state": null, "sum": 132000.5, "metadata_id": 108, "created_ts": 1692469961.6532383, "start_ts": 1654243200.0, "last_reset_ts": null }, { "id": 327730, "created": null, "start": null, "mean": null, "min": 132000.5, "max": 132000.5, "last_reset": null, "state": null, "sum": 132000.5, "metadata_id": 108, "created_ts": 1692469961.652198, "start_ts": 1654246800.0, "last_reset_ts": null }, { "id": 327729, "created": null, "start": null, "mean": null, "min": 132000.5, "max": 132000.5, "last_reset": null, "state": null, "sum": 132000.5, "metadata_id": 108, "created_ts": 1692469961.651176, "start_ts": 1654250400.0, "last_reset_ts": null }, { "id": 327728, "created": null, "start": null, "mean": null, "min": 132000.5, "max": 132000.5, "last_reset": null, "state": null, "sum": 132000.5, "metadata_id": 108, "created_ts": 1692469961.650135, "start_ts": 1654254000.0, "last_reset_ts": null }, { "id": 327727, "created": null, "start": null, "mean": null, "min": 132002.5, "max": 132002.5, "last_reset": null, "state": null, "sum": 132002.5, "metadata_id": 108, "created_ts": 1692469961.649115, "start_ts": 1654257600.0, "last_reset_ts": null }, { "id": 327726, "created": null, "start": null, "mean": null, "min": 132020.5, "max": 132020.5, "last_reset": null, "state": null, "sum": 132020.5, "metadata_id": 108, "created_ts": 1692469961.6480951, "start_ts": 1654261200.0, "last_reset_ts": null } ] |
I think just doing a delete on that negative record actually cleaned up everything, it would definitely be good to figure out why it is being created in the first place, but so far it seems to be looking good. |
Ok, my best guess is that it happens because the integration reimports the same data points again and again. |
Yeah, that sounds like what it could be, not sure if you can check if things are imported already. |
I think I saw some similar code that stored the last imported timestamp in a config (somewhere else). |
Hi @kdeyev I did not report the "problem" to HA developers, in fact, I'm not sure if there is a problem. Clearly we are moving in a shady space:
Of course it would be nice to integrate some of HA-historical-sensors into HA-core, for now I know 3 integrations relaying on HA-historical-sensors and I have ideas for some more, clearly there is a use case. Going back to the bug issue: I'm still having trouble trying to express what is the problem and how to present a reproducible case. The fact (as far I know) that statistic generation cannot be triggered doesn't help debugging. Anyway, even with this considerations I'm open to report an issue for HA-core but now sure how. |
Hacs works fine, I can interact with every addin except the Eyeonwater water.
Eyeonwater shows an update, I get no action when I click
I have also tried redownloading eyeonwater directly from github and replacing (still get same issue)
If I try via hacks, that is where I get the unknown error.
This error message shows up in log
Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/hacs/repositories/integration.py:173
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 8:07:13 PM (1 occurrences)
Last logged: 8:07:13 PM
[547416489536] Error handling message: Unknown error (unknown_error) xxxxxx from 192.168.x4.x2 (Mozilla/5.0 (iPhone; CPU iPhone OS xxx like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Home Assistant/2023.4 (io.robbie.HomeAssistant; build:2023.460; iOS 16.6.0) Mobile/HomeAssistant, like Safari)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
await func(hass, connection, msg)
File "/config/custom_components/hacs/websocket/repository.py", line 40, in hacs_repository_info
await repository.update_repository(ignore_issues=True, force=True)
File "/config/custom_components/hacs/utils/decorator.py", line 28, in wrapper
result = await function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hacs/repositories/integration.py", line 126, in update_repository
if manifest := await self.async_get_integration_manifest():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hacs/repositories/integration.py", line 173, in async_get_integration_manifest
raise HacsException(f"No {RepositoryFile.MAINIFEST_JSON} file found '{manifest_path}'")
custom_components.hacs.exceptions.HacsException: No manifest.json file found 'custom_components/None/manifest.json'
d
… On Aug 21, 2023, at 7:39 PM, Konstantin Deev ***@***.***> wrote:
@bsp9493 <https://github.com/bsp9493> It sounds weird. Could you please try to reinstall the HASC custom repository?
—
Reply to this email directly, view it on GitHub <#30 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ALBI77HVHZICK6LKC5XELYTXWQLXDANCNFSM6AAAAAA3VW6AVI>.
You are receiving this because you were mentioned.
|
@bsp9493 Could you try to remove the repository from the HACS? |
I’d manually go in there and delete any files left behind in the folder “eyeonwater” as well. |
@kdeyev I have an Idea that seems to be working for me, I set the state_class to SensorStateClass.TOTAL instead of total_increasing, and it actually seems to work, I havent found any negative effects so far, unless you know of any, we might want to have some other people try it that way maybe? |
Unable to remove it… can’t do anything with it:(Will have to research how to manually remove a repository from hacs:(dOn Aug 22, 2023, at 6:22 PM, disforw ***@***.***> wrote:
I’d manually go in there and delete any files left behind in the folder “eyeonwater” as well.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@disforw I looked at the documentation you shared and it sounds like we misused the |
If that is the case then I accept responsibility for this. I used total_increasing because a meter will never restart from 0 and never decrease. |
I think this will potentially need more than just switching it to total, I am working on testing it now, I think We may need to set the inital state to the lowest value read, or to 0. |
Yes, ours should never decrease, but I am afraid that misinterpreted the statistics delay and starts a new "billing cycle" with 0.
I've release v2.0.4-beta.1 |
I just installed 2.4-beta1 and will check it out for the next 24 hours. |
Just got the first successful hourly statistic update to write correctly, I had to make sure the initial state and short term statistic sum and state were 0, and it wrote a correct value in the long term statistic, if there is a way to create an initial state and short term statistic of 0 that and setting the state class to TOTAL may be the solution for this integration. It has actually seemingly been solid for 3 hours now, every hourly update inserts the correct data, not seeing negative values anymore. |
I see a negative value when using 2.4-beta1. Can you create a pr with your changes? |
It may happen that you see a negative value because HA had some state in the DB (that what @ParkerAnderson9 mentioned before) |
Hi All, |
Not sure…Getting smaller negatives, and history doesn’t seem to be populating.dOn Aug 24, 2023, at 8:52 PM, Konstantin Deev ***@***.***> wrote:
Hi All,
Any feedback about 2.4-beta1? Should I release it?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I got v2.0.2 to work by setting the state class to TOTAL and by manually setting in the Database, an initial state of 0 before all other states, and then an initial short term statistic of 0 before all other records as well, if there is a way to do that when the integration gets the data for the first time I believe it will write everything correctly after. |
Yes, agree… 2.02 appears to be populating correctly going forwarddOn Aug 25, 2023, at 8:13 PM, ParkerAnderson9 ***@***.***> wrote:
I got v2.0.2 to work by setting the state class to TOTAL and by manually setting in the Database, an initial state of 0 before all other states, and then an initial short term statistic of 0 before all other records as well, if there is a way to do that when the integration gets the data for the first time I believe it will write everything correctly after.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Sorry currently using 2.0.3dOn Aug 25, 2023, at 9:38 PM, David Morhun ***@***.***> wrote:Yes, agree… 2.02 appears to be populating correctly going forwarddOn Aug 25, 2023, at 8:13 PM, ParkerAnderson9 ***@***.***> wrote:
I got v2.0.2 to work by setting the state class to TOTAL and by manually setting in the Database, an initial state of 0 before all other states, and then an initial short term statistic of 0 before all other records as well, if there is a way to do that when the integration gets the data for the first time I believe it will write everything correctly after.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
2.0.5 seems to be working consistently with no issues:) |
Great! Thank you for the update. |
fixed in v2.2.0 |
Newest integration seems to be working well. Thanx for all the work on this!!!
One issue still present. While the history of the entity looks to be fine, the most current reading in the energy dashboard is a huge negative value. As updates come in from water meter, this value moves to be the most current.
I have no errors in the logs, and I am unable to locate any rogue data points that would cause this.
If I go to previous day(s) everything is populated correctly.
Any suggestions where to look?
The text was updated successfully, but these errors were encountered: