from your questions I assume we’re talking about different persistences. This change stores the raw forecast data in jsondb /var/lib/openhab/jsondb/solarforecast.json. This has nothing to do with item persistence. To make it more clear let’s check the use case openhab restart
Current released version
Binding startup - 2 API calls to get solcast data
TimeSeries items updated only with future forecast data
a) In case of InMemory persistence past data is lost! Future data is updated
b) In case of InfluxDB past & future is persitet in database
Marketplace version
Binding startup - restore solcast data from jsondb = zero API calls!
same behavior as before
What do you mean exactly with startup?
Do you really mean openhab restart or start of the day?
If you mean openhab restart it’s described as above - InMemory will loose all it’s past data competely. That’s more than a gap.
If you mean start of the day there will be no gaps at all.
thanks for explaining. I was not aware about the possibility of storing data in jsondb. This certainly helps to regain current data.
With restart I indeed mean OH restart where all InMemory data is gone. If it can be restored from jsondb, great. What is the system was down for multiple days so the data stored in jsondb “expired”? I’m asking for a way to get the data for the full current day in case the is no data available locally.
BTW, historic data is persisted in rrjd4 in my case as all Items get persisted by default.
Let me try the Marketplace version and play with it.
In this case 2 API calls will be performed. This is the only scenario where I cannot “guess the actuals” This scenario only occurs if the system is down for more than 7 days.
There’s always the full day available. You can check this with the rule actions getForecastBegin and getForecastEnd. Note: It’s showing UTC date time, not your local date time. You can execute them via UI which is quite handy!
Yesterday, I installed your Solar Forecast PV binding from the market place. I then created a Hobby account for Solcast, got my API and Roof id and the binding worked. This morning I found that it had stopped sometime during the night owing to too many requests.
After finding this thread, I upgraded by OpenHabian 4.0 to the the latest 4.3.2 and installed the .JAR version given at the top of the thread. I have recreated the Solcast Site and Solcast PV Plane things but they are currently showing “Not Yet Ready” and “Error:Coms” as a direct call to the url from the Solcast site still gives “Too many requests”.
Assuming this clears tomorrow (does the counter reset at any specific time?), I still cannot see how to use the information. When it was working yesterday, I managed to import the Actual, Remaining and Total Energy values into my model. Are these values related to the current day with Actual being what I should have generated each time the data is accessed (150mins) etc. ?
What I would like to have is a set of forecasts of the energy available for each of the next 6 hours ahead so that I can proactively manage a number of loads such as EV charger, Pool pump, Washing machine etc. to maximize the amount of electricity I use in house rather than supplying to the grid. Is this possible with this binding?
Sure, if you’ve installed on older version you’ll run quickly out of the call budget restricted to 10 calls per day per PV plane.
Budget is resetted by Solcast for all users at 0:00 UTC. It’s described in readme and shown as tooltip on the item.
Hopefully this is also well described in readme.
While the green highlighted channels are showing actual/today values the blue channels are showing the future. You can visualize them using this tutorial.
The items attached to channels are nice to create a dashboard and graphs but I personally don’t use them for calculations.
You can easily transform the example into next 6 hours energy forecast adapting the endTimestamp. Feel free to define start point, end point and duration of your energy query.
// Query forecast via Actions
val solarforecastActions = getActions("solarforecast","solarforecast:sc-site:homeSite")
val startTimestamp = Instant.now
val endTimestamp = Instant.now.plus(6, ChronoUnit.HOURS)
val sixHourForecast = solarforecastActions.getEnergy(startTimestamp,endTimestamp)
logInfo("SF Tests","Forecast Average 6 hours "+ sixHourForecast )
Thank you for your quick reply. I have found the new documentation on the readme link you posted to GitHub. I will look at it later today. In the meantime, my system started working this morning. At the moment, I am only looking at the average values. Actual, Remaing and Total Energy together with Actual Power give sensible values. Energy Forecast, Power Forecast and latest update all show NULL.
The API Request Count is {“200”:6,“other”:0,“429”:1}, so the binding has made 6 requests from 8:30 till 11:45 am this morning when I reinstalled the new binding. The graph of the Energy values shows that they are being updated very 30min, not the 150min set as default in the Solar PV plane thing. Why is the binding making so many requests? I expect it will stop working soon.
I’m also having problems with calculation of tomorrow’s forecast. I have looked at the discussion above but still the rule is not running.
My rule is:
configuration: {}
triggers:
- id: "1"
configuration:
itemName: ForecastSolar_Site_Todays_Energy_Forecast
type: core.ItemStateUpdateTrigger
conditions: []
actions:
- inputs: {}
id: "2"
configuration:
type: application/vnd.openhab.dsl.rule
script: >-
val solarforecastActions =
getActions("solarforecast","solarforecast:sc-site:homeSite:1d1d6127c4")
val energyState =
solarforecastActions.getEnergyOfDay(LocalDate.now.plusDays(1))
Solcast_Site_Tomorrow.postUpdate(energyState as Number)
val solarforecastActions1 =
getActions("solarforecast","solarforecast:sc-site:homeSite:1d1d6127c4")
val energyState1 =
solarforecastActions1.getEnergyOfDay(LocalDate.now.plusDays(2))
Solcast_Site_DayAfterTomorrow.postUpdate(energyState1 as Number)
logInfo("SF Tests","{}",energyState as Number)
type: script.ScriptAction
and in the log file I have the following error:
2025-03-24 20:32:43.337 [ERROR] [.handler.AbstractScriptModuleHandler] - Script execution of rule with UID '1bb9dfb927' failed:
val solarforecastActions = getActions("solarforecast","solarforecast:sc-site:homeSite:1d1d6127c4")
val energyState = solarforecastActions.getEnergyOfDay(LocalDate.now.plusDays(1))
Solcast_Site_Tomorrow.postUpdate(energyState as Number)
val solarforecastActions1 = getActions("solarforecast","solarforecast:sc-site:homeSite:1d1d6127c4")
val energyState1 = solarforecastActions1.getEnergyOfDay(LocalDate.now.plusDays(2))
Solcast_Site_DayAfterTomorrow.postUpdate(energyState1 as Number)
logInfo("SF Tests","{}",energyState as Number)
1. The method getEnergyOfDay(LocalDate) is undefined for the type ThingActions; line 4, column 194, length 14
2. The method getEnergyOfDay(LocalDate) is undefined for the type ThingActions; line 8, column 436, length 14
@weymann. Yes, this did the trick. For some reason I had 4.2.0 jar file. Many thanks for your help.
I removed the binding and reinstalled it. Now for some reason the channel lists for Solcast Site, Solcast PV plane, Forecast Site and Forecast PV plane are empty, see e.g. the screen copy for Solcast Site
Okay, but if’s working why do you reinstalled the bundle? Bindings are mostly coupled with the running OH version because there are dependencies.
Any trace output after reinstalling the binding?
For analysis which OH version do you run and which binding version (Marketplace, official version/ addons folder) did you install?
I’m running OH4.3.3. and for some reason I had 4.2.0 jar file in the addons folder. I deleted this file and then I restarted OH. When I looked at the Add-on Store Solarforecast binding was not installed so I installed the binding under Add-on Store.
I’m having again some issues with this great binding. For some reason my forecast data is not persisted in InfluxDB any more. I have checked that my other Items are persisted correctly and my influxdb.persist file has the Solcast Items. My both Things (Solcast Site and Solcast PV Plane) are online. Any ideas?
From the graph showing a week it’s hard for me to see a 1 hour drift. Can you please zoom in into the graph, espacially showing which time the forecast starts and which time the forecast ends?
In your previous post you deleted items and recreated them. Please double check if the new items are still configured to be persisted into influxdb.
Don’t know how you configured this. Maybe in a influxdb group or items directly configured in influxdb binding?