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

Reduce the polling interval to every minute instead of 10mins #25

Open
gurrier opened this issue Oct 25, 2023 · 3 comments
Open

Reduce the polling interval to every minute instead of 10mins #25

gurrier opened this issue Oct 25, 2023 · 3 comments

Comments

@gurrier
Copy link

gurrier commented Oct 25, 2023

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
The NEM is a 5 minute market but the integration appears to only update every 10 minutes or so.
This misses some of the price changes that can be beneficially used for automations.

Describe the solution you'd like
A clear and concise description of what you want to happen.
Polling on every minute (or preferably use API Push if possible to retrieve updated values as soon as OpenNEM is aware of them.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
I can see the price changes at AEMO website to be able to manually compare and check timings

Additional context
Add any other context or screenshots about the feature request here.

@gurrier
Copy link
Author

gurrier commented Oct 26, 2023

I can see that the json is updated roughly 70 seconds after the start of the 5minute interval. Would be a ideal if it were aware of this typical behaviour to schedule the next update poll.
https://data.opennem.org.au/v3/stats/au/NEM/power/7d.json

@gurrier
Copy link
Author

gurrier commented Oct 26, 2023

I found the hard-coded update interval in /config/custom_components/opennem/init.py

DEFAULT_SCAN_INTERVAL = datetime.timedelta(minutes=10)

Would be great to have this defaulted to a lower value given the 5 minute nature of the National Electricity Market.

Even better would be to have some way of having it more regulalry check near the start of the 5 minute interval until it finds the updated JSON files, then sleep for about 5 minutes.

@bacco007
Copy link
Owner

bacco007 commented Oct 26, 2023 via email

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

2 participants