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

Change time interval rounding to 5s #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amosyuen
Copy link

@amosyuen amosyuen commented Jan 19, 2022

Change time interval rounding to 5s which matches iotawatts data log interval. See https://docs.iotawatt.com/en/master/query.html. This allows client to request data more frequently then every 30s.

@llamafilm
Copy link

@amosyuen what problem is this attempting to solve? Are you seeing inaccurate data with the 30 second interval? I'm new to this project, having just installed my first IotaWatt, but so far my data looks good.

@mmiller7
Copy link

Is there any update on this?

It appears the hard-coded 30 seconds instead of referencing the parameter timespan limits the update rate even when a non-default timespan is specified in the update method. This results in inaccurate data being returned with intermediate values that are not actually correct for the real time power draw.

The IoTaWatt built-in web UI has a 5 second refresh interval on displayed data. It should be possible to have a 5 second refresh interval instead of being confined to a 30 second interval.

When will this be fixed?

@mmiller7
Copy link

Actually I think this fix still has a bug in it - 30 seconds worked calculating the difference with an if/else because that is half a minute but I believe the correct way to make a 'diff' would be using mod-operator. I think you wanted diff = seconds % 5

@amosyuen amosyuen force-pushed the patch-1 branch 3 times, most recently from 25b6ad4 to 4481704 Compare March 20, 2023 01:17
@amosyuen
Copy link
Author

@mmiller7 Good catch, fixed the commit. Though not sure if maintainers are ever going to merge this fix in

@mmiller7
Copy link

I have low expectations given how long its been open. Frustrating as I think this bug also would affect everything that uses it as a dependency.

Unrelated, the friend I had helping me understand the Python pointed out the one warning that prints out also is missing the f in front of "Nothing to query, update() called too soon, must wait {timespan}" so it prints a string literal instead of the requested timespan variable contents...but at least that doesn't affect the logical functionality of it.

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

Successfully merging this pull request may close these issues.

4 participants