-
Notifications
You must be signed in to change notification settings - Fork 13
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
[solcast] "all-day" API request optimization #15
Comments
Hi Matthias, Other options include:
|
Hi Stefan, for my implementation I use a modified crontab with 5-minute periods. Otherwise it would not make sense to calculate exact values. Now that I dig more in the code I see that you round timestamps more often than I thought, e.g. also for issue time which leads to an anomaly in the first daytime call in my implementation. Just some notes to your comments. Extending the day_period will not work in summer since there are no credits left during the day. It is not even enough for 15-minute periods Anyway, I will publish my current implementation as pull request. Just for better discussion. It still contains some debug print() calls which I needed to understand the current code better. |
Hi Matthias, |
Hi Matthias, Whilst your pull request looks clean in principle, I'm still struggling with the alignment
It might actually be sufficient to call Solcast every 30min (which works for the full 24h with 50 credits). We could still go to 15min intervals on an extended day, something like this:
What I don't like in my current implementation is that I start on next 15min interval after sunrise ... it would make better use of the data, if that was aligned to xx:00 and xx:30 for the above reasoning. Then, with preSunRise = -12h and postSunSet = 12h, you'd cover the full day in 30min intervals. (Of course, the config file entries would need be a little more obvious) |
Hi Stefan, thanks for all the detailed explanations. This means to achieve what I want, I just need a crontab entry
and
in solcast_light_config.ini to skip all the optimization logic in solcast.py. No code change required. I'll close the PR and issue since it does not give any new benefit. Thanks again for your time. |
Newest release v2.10 contains an |
Thanks for your effort. Today I found time to update to the latest version. Now I am using "24h" mode. 👍 |
As far as I understood the solcast code, it downloads the latest forecast data only between sunrise and sunset (except of force mode).
It might be useful to have also updates during the night to be able to plan power usages for the next day, e.g. to fill a washing machine and to program a timer for the next day.
This is especially needed in winter time where the sunrise is after a working day usually starts. Currently there is only quite old forecast data from the last day before sunset available.
My suggestion to improve the usage of solcast is as follows:
Some ideas to choose the enlargement factor for intervals between sunset and sunrise:
I just calculated the intervals with extreme examples (8-hour day and 16-hour day) and different factors. A factor of 4, i.e. download interval at night is 4 times larger than during the day, makes most sense to me.
Here are some examples for 48 API requests distributed over the day
The formula to calculate the above intervals
I already implemented this in a fork which runs since today. After some testing I can create a pull request if there is interest.
The text was updated successfully, but these errors were encountered: