iobroker-community-adapters / ioBroker.pvforecast

Forecast for your photovoltaic plant in ioBroker
Other
26 stars 14 forks source link

[Bug]: updated FC values only considered with instance restart - periodic calls fetch outdated values #176

Closed n4pstarr closed 1 month ago

n4pstarr commented 1 month ago

I'm sure that

Used integration

Solcast

The problem

Hi all,

with changing from Forecast.Solar to Solcast I'm first of all happy with the gain of preciceness of solar FC that Solcast offers. But I'm suffering from forecast values not being updated.

Attached, you can see that the values showing in the log on 14:00 were updated to the objects already late in the morning (07:26 -I perform and instance restart at dawn as a small workaround already).

The CSV and JSON from toolkit.solcast.com.au contain updated values - different ones from the API call of the adapter.

As soon as I restart the instance, the values visible in the CSV/JSON are fetched and booked to the objects. By only updating future values and initializing the ones of the past of the current day, this is no suitable option to get a proper daily sum.

Log: grafik

Objects: grafik

CSV: grafik (note: that's only one array (10.8 kWp) - the other one is very small (0.7 kWp) and can be ignore)

Log after instance restart: grafik

Updated objects: grafik

As a restart updates the values, a full consumption of API calls mustn't be the reason.

Thanks in advance 4 any help!

BR Chris

iobroker.current.log (in debug mode!)

grafik

Version of nodejs

20.17.0

Version of ioBroker js-controller

6.0.11

Version of adapter

3.0.0

github-actions[bot] commented 1 month ago

Thanks for reporting a new issue @n4pstarr!

  1. Please make sure your topic is not covered in the documentation
  2. Please attach all necessary log files (in debug mode!), screenshots and other information to reproduce this issue
  3. Search for the issue topic in other/closed issues to avoid duplicates!

    Otherwise this issue will be closed.

alx785 commented 1 month ago

@n4pstarr i don´t know why there is no automatic refresh when you chose solcast, like it is in forecast.solar but for me the following workaroud helps to get new data from the api: use a script that cron´s the refresh button. That button is located in the service folder. Try not to refresh to often, because of the maximum count of calls per day. For me it works nice with a daily cron job from 7:00 till 19:00 every two hours.

image

klein0r commented 1 month ago

At the moment, the data is just fetched once a day:

https://github.com/iobroker-community-adapters/ioBroker.pvforecast/blob/3ef9743f113e0c4a53a7f1841748131e5b1d66a3/main.js#L241-L244

The reason is, that the response doesn't contain values in the past. Which leads to "unfilled" states.

klein0r commented 1 month ago

use a script that cron´s the refresh button.

States with role button shouldn't be controlled with false. "Umschalten" is not correct. Just set true.

alx785 commented 1 month ago

@klein0r Thank you for that little hint and your work Matthias!

n4pstarr commented 1 month ago

@alx785 : thanks a lot fot that hint. Thats's a workaround - but a fine one ;)