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

[solarforecast] suspend API calls over night #16728

Open
weymann opened this issue May 8, 2024 · 4 comments
Open

[solarforecast] suspend API calls over night #16728

weymann opened this issue May 8, 2024 · 4 comments
Assignees
Labels
enhancement An enhancement or new feature for an existing add-on

Comments

@weymann
Copy link
Contributor

weymann commented May 8, 2024

Copied from weymann/OH3-SolarForecast-Drops#2

Thanks for the great work on the binding. Saves me a ton of JSON fiddling! ;)

Would it be possible to define a period of no polling? So you could spare precious API calls over night, when there's no need to update information? Possible having the chance to either:

  1. define a switch-item, which tells the binding to do API-Calls or suspend them
  2. define Astro-binding items/channels which trigger local dusk/dawn periods?

ad 1
I could then use whatever means to turn that item ON or OFF (possibly using Astro-binding)

ad 2
I could then just use a fully configured Astro-binding to use for suspending

@weymann weymann added the enhancement An enhancement or new feature for an existing add-on label May 8, 2024
@weymann weymann self-assigned this May 8, 2024
@weymann
Copy link
Contributor Author

weymann commented May 11, 2024

The throttling of the free Solcast account is very strict and contains ~24 calls per day. 2 calls are necessary per plane so this will result into the default update frequency of 2 hours.

Community discussion is already raised to find a better strategy like here and here. Also this enhancement was raised in my drop repo and I tranferred it to openHAB addons repo.

My proposal:

  • user has the opportunity to switch off bindings regular schedule with advanced configuration parameter refreshManual
  • user can implement his own strategy in rules and triggerUpdate via Rule Action
  • example is given in readme with update after startup plus 2 hours update only during daytime

@lsiepel
Copy link
Contributor

lsiepel commented May 11, 2024

Maybe offer three modes?

  1. Even, each 2 hours one call
  2. Daytime, each hour from 8:00, and last at 19:00 ?
  3. Manual

@weymann
Copy link
Contributor Author

weymann commented May 11, 2024

Maybe offer three modes?

To be very honest I don't want to offer modes. Too much strategy possibilities and then binding is dependemt on Astro binding plus I've to maintain them.

  • maybe you want one update after midnight even if sun is down
  • maybe one update after sunrise and then hourly
  • maybe you want more frequent updates in winter - shorter day time => more frequent updates possible

I'm personally fine with the given refreshInterval of 2 hours but if any user wants something different they can start with the example rule and then evolve.

@lsiepel
Copy link
Contributor

lsiepel commented May 11, 2024

Maybe offer three modes?

To be very honest I don't want to offer modes. Too much strategy possibilities and then binding is dependemt on Astro binding plus I've to maintain them.

  • maybe you want one update after midnight even if sun is down
  • maybe one update after sunrise and then hourly
  • maybe you want more frequent updates in winter - shorter day time => more frequent updates possible

I'm personally fine with the given refreshInterval of 2 hours but if any user wants something different they can start with the example rule and then evolve.

That is ok, effectively two ‘modes’ (auto vs manual) is already giving a lot of flexibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

No branches or pull requests

2 participants