kdeyev / eyeonwater

HACS repository for EyeOnWater integration
MIT License
26 stars 6 forks source link

No history imported w/ import_historical_data service #82

Open some-guy-23 opened 10 months ago

some-guy-23 commented 10 months ago

Added this integration today, able to see current values. However, when I call the import_historical_data service, no historical data is added as far as I can tell. I've tried both high values and as low as 1 day. I don't see any errors reported in the logs looking at HA Core.

Happy to try to troubleshoot / look further if pointed in the right direction!

kdeyev commented 10 months ago

Hi, We have 2 different sensors per meter, so we are working around one HA core issue. Please double-check that you are looking at a sensor with a "statistic" suffix.

some-guy-23 commented 10 months ago

Hi, I originally checked both sensors and there was no data (even after 15 minutes). I took a look today though, and now the statistics sensor has 1 month of data.

Does the sensor support long term statistics in HA? I tried to import a little over 1,000 days.

kdeyev commented 10 months ago

Sorry for the delay. Please take a look at the readme of the project, there is an explanation of how to import statistics via Developer tools -> Services

some-guy-23 commented 10 months ago

Right, that's the service I called. What I mean by statistics is "long term statistics" vs "recorder" (shorter term) in Home Assistant. The most history I've seen on the "statistics" entity is 31 days, which is what I have the "recorder" days set to in HA. So, just wondering if that is intended, or if it is supposed to be able to import long term statistics as well.

When I call the service w/ longer periods, like 90 days, I don't see any of those statistics being pulled in.

kdeyev commented 8 months ago

@some-guy-23 , well, it's weird. Could you please check home assistant logs?

some-guy-23 commented 8 months ago

@kdeyev sure, here is from the debug logs, for 186 Days (~6 Months) value for importing -

2024-01-27 10:42:46.660 INFO (MainThread) [custom_components.eyeonwater.coordinator] 4439 data points will be imported

So, seems like it is fetching the data correctly at least, but then failing to actually convert it / add it to Home Assistant statistics?

kdeyev commented 8 months ago

@some-guy-23 if you don't see any error messages, so probably it was delivered to HA. I just successfully imported 900 days of water consumption history and it took like 5 minutes. Maybe it worth to try it again (after checking that the integration is up to date).

some-guy-23 commented 8 months ago

Updated to latest version and attempted a couple more times, but still no joy. I just see that initial line in logging that it finds the data points, but something seems to be failing after that. Not sure if there's other logging I could enabled to help track it down?

kdeyev commented 7 months ago

The best suggestion I could give - please try to use Python package pyonwater directly and see what historical data is fetched, I hope it will give us better understanding of what's going on. There is an example in the repo.