Update README.md (#18150)

changed historicState to persistedState
changed Solcast Thing actions
added note for limit of api calls for free solcast hobbyist plan

Signed-off-by: sihui <10405486+sihui62@users.noreply.github.com>
This commit is contained in:
sihui 2025-01-21 18:43:39 +01:00 committed by GitHub
parent 89187cc645
commit 6287ac197e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,6 +35,7 @@ Each service needs one `xx-site` for your location and at least one photovoltaic
[Solcast service](https://solcast.com/) requires a personal registration with an e-mail address. [Solcast service](https://solcast.com/) requires a personal registration with an e-mail address.
A free version for your personal home PV system is available in [Hobbyist Plan](https://toolkit.solcast.com.au/register/hobbyist) A free version for your personal home PV system is available in [Hobbyist Plan](https://toolkit.solcast.com.au/register/hobbyist)
(Limited to 10 API requests per day).
You need to configure your home photovoltaic system within the web interface. You need to configure your home photovoltaic system within the web interface.
The `resourceId` for each PV plane is provided afterwards. The `resourceId` for each PV plane is provided afterwards.
@ -325,7 +326,7 @@ rule "Exception Handling"
when when
System started System started
then then
val solcastActions = getActions("solarforecast","solarforecast:sc-site:3cadcde4dc") val solcastActions = getActions("solarforecast","solarforecast:sc-site:homeSite")
try { try {
val forecast = solcastActions.getPower(solcastActions.getForecastEnd.plus(30,ChronoUnit.MINUTES)) val forecast = solcastActions.getPower(solcastActions.getForecastEnd.plus(30,ChronoUnit.MINUTES))
} catch(RuntimeException e) { } catch(RuntimeException e) {
@ -354,10 +355,10 @@ rule "Solcast Actions"
val sixDayPessimistic = solarforecastActions.getEnergy(startTimestamp,endTimestamp, "pessimistic") val sixDayPessimistic = solarforecastActions.getEnergy(startTimestamp,endTimestamp, "pessimistic")
logInfo("SF Tests","Forecast Pessimist 6 days "+ sixDayPessimistic) logInfo("SF Tests","Forecast Pessimist 6 days "+ sixDayPessimistic)
// Query forecast TimesSeries Items via historicStata // Query forecast TimesSeries Items via persistedState
val energyAverage = (Solcast_Site_Average_Energyestimate.historicState(now.plusDays(1)).state as Number) val energyAverage = (Solcast_Site_Average_Energyestimate.persistedState(now.plusDays(1)).state as Number)
logInfo("SF Tests","Average energy {}",energyAverage) logInfo("SF Tests","Average energy {}",energyAverage)
val energyOptimistic = (Solcast_Site_Optimistic_Energyestimate.historicState(now.plusDays(1)).state as Number) val energyOptimistic = (Solcast_Site_Optimistic_Energyestimate.persistedState(now.plusDays(1)).state as Number)
logInfo("SF Tests","Optimist energy {}",energyOptimistic) logInfo("SF Tests","Optimist energy {}",energyOptimistic)
end end
``` ```
@ -381,11 +382,11 @@ end
rule "Solacast Updates" rule "Solacast Updates"
when when
Thing "solarforecast:sc-plane:homeSouthWest" changed to INITIALIZING or // Thing status changed to INITIALIZING Thing "solarforecast:sc-plane:homeSite:homeSouthWest" changed to INITIALIZING or // Thing status changed to INITIALIZING
Time cron "0 30 0/2 ? * * *" // every 2 hours at minute 30 Time cron "0 30 0/2 ? * * *" // every 2 hours at minute 30
then then
if(PV_Daytime.state == ON) { if(PV_Daytime.state == ON) {
val solarforecastActions = getActions("solarforecast","solarforecast:sc-plane:homeSouthWest") val solarforecastActions = getActions("solarforecast","solarforecast:sc-plane:homeSite:homeSouthWest")
solarforecastActions.triggerUpdate solarforecastActions.triggerUpdate
} // reject updates during night } // reject updates during night
end end