weymann / OH3-SolarForecast-Drops

Development Drops for openHAB binding SolarForecast
4 stars 0 forks source link

using persistence strategy forecast and forecast item state #6

Open humarf opened 2 months ago

humarf commented 2 months ago

Hello,

I tried this binding with solar forecast and it's working well. But I have two problems. I wonder if this might be a misconfiguration or a problem with the binding:

In case you need additional information let me know.

Thanks and best regards humarf

Here is what I see in the logs:

15:45:03.319 [INFO ] [openhab.event.ItemTimeSeriesEvent ] - Item 'pv_gesamt_estimate_energy' shall process timeseries [Entry[timestamp=2024-04-30T03:35:32Z, state=0 kWh], Entry[timestamp=2024-04-30T04:00:00Z, state=0.005 kWh], Entry[timestamp=2024-04-30T05:00:00Z, state=0.128 kWh], Entry[timestamp=2024-04-30T06:00:00Z, state=0.719 kWh], Entry[timestamp=2024-04-30T07:00:00Z, state=2.719 kWh], Entry[timestamp=2024-04-30T08:00:00Z, state=6.9670000000000005 kWh], Entry[timestamp=2024-04-30T09:00:00Z, state=12.692 kWh], Entry[timestamp=2024-04-30T10:00:00Z, state=18.355 kWh], Entry[timestamp=2024-04-30T11:00:00Z, state=23.318 kWh], Entry[timestamp=2024-04-30T12:00:00Z, state=27.776 kWh], Entry[timestamp=2024-04-30T13:00:00Z, state=31.552 kWh], Entry[timestamp=2024-04-30T14:00:00Z, state=34.037 kWh], Entry[timestamp=2024-04-30T15:00:00Z, state=35.276 kWh], Entry[timestamp=2024-04-30T16:00:00Z, state=35.807 kWh], Entry[timestamp=2024-04-30T17:00:00Z, state=36.018 kWh], Entry[timestamp=2024-04-30T18:00:00Z, state=36.076 kWh], Entry[timestamp=2024-04-30T18:31:33Z, state=36.08 kWh], Entry[timestamp=2024-05-01T03:33:35Z, state=0 kWh], Entry[timestamp=2024-05-01T04:00:00Z, state=0.011 kWh], Entry[timestamp=2024-05-01T05:00:00Z, state=0.267 kWh], Entry[timestamp=2024-05-01T06:00:00Z, state=1.208 kWh], Entry[timestamp=2024-05-01T07:00:00Z, state=3.324 kWh], Entry[timestamp=2024-05-01T08:00:00Z, state=6.819 kWh], Entry[timestamp=2024-05-01T09:00:00Z, state=11.444 kWh], Entry[timestamp=2024-05-01T10:00:00Z, state=16.639 kWh], Entry[timestamp=2024-05-01T11:00:00Z, state=21.741999999999997 kWh], Entry[timestamp=2024-05-01T12:00:00Z, state=26.161 kWh], Entry[timestamp=2024-05-01T13:00:00Z, state=29.506999999999998 kWh], Entry[timestamp=2024-05-01T14:00:00Z, state=31.664 kWh], Entry[timestamp=2024-05-01T15:00:00Z, state=32.808 kWh], Entry[timestamp=2024-05-01T16:00:00Z, state=33.325 kWh], Entry[timestamp=2024-05-01T17:00:00Z, state=33.532000000000004 kWh], Entry[timestamp=2024-05-01T18:00:00Z, state=33.59 kWh], Entry[timestamp=2024-05-01T18:33:16Z, state=33.595 kWh]] 15:45:03.322 [INFO ] [nhab.event.ItemTimeSeriesUpdatedEvent] - Item 'pv_gesamt_estimate_energy' updated timeseries [Entry[timestamp=2024-04-30T03:35:32Z, state=0 kWh], Entry[timestamp=2024-04-30T04:00:00Z, state=0.005 kWh], Entry[timestamp=2024-04-30T05:00:00Z, state=0.128 kWh], Entry[timestamp=2024-04-30T06:00:00Z, state=0.719 kWh], Entry[timestamp=2024-04-30T07:00:00Z, state=2.719 kWh], Entry[timestamp=2024-04-30T08:00:00Z, state=6.9670000000000005 kWh], Entry[timestamp=2024-04-30T09:00:00Z, state=12.692 kWh], Entry[timestamp=2024-04-30T10:00:00Z, state=18.355 kWh], Entry[timestamp=2024-04-30T11:00:00Z, state=23.318 kWh], Entry[timestamp=2024-04-30T12:00:00Z, state=27.776 kWh], Entry[timestamp=2024-04-30T13:00:00Z, state=31.552 kWh], Entry[timestamp=2024-04-30T14:00:00Z, state=34.037 kWh], Entry[timestamp=2024-04-30T15:00:00Z, state=35.276 kWh], Entry[timestamp=2024-04-30T16:00:00Z, state=35.807 kWh], Entry[timestamp=2024-04-30T17:00:00Z, state=36.018 kWh], Entry[timestamp=2024-04-30T18:00:00Z, state=36.076 kWh], Entry[timestamp=2024-04-30T18:31:33Z, state=36.08 kWh], Entry[timestamp=2024-05-01T03:33:35Z, state=0 kWh], Entry[timestamp=2024-05-01T04:00:00Z, state=0.011 kWh], Entry[timestamp=2024-05-01T05:00:00Z, state=0.267 kWh], Entry[timestamp=2024-05-01T06:00:00Z, state=1.208 kWh], Entry[timestamp=2024-05-01T07:00:00Z, state=3.324 kWh], Entry[timestamp=2024-05-01T08:00:00Z, state=6.819 kWh], Entry[timestamp=2024-05-01T09:00:00Z, state=11.444 kWh], Entry[timestamp=2024-05-01T10:00:00Z, state=16.639 kWh], Entry[timestamp=2024-05-01T11:00:00Z, state=21.741999999999997 kWh], Entry[timestamp=2024-05-01T12:00:00Z, state=26.161 kWh], Entry[timestamp=2024-05-01T13:00:00Z, state=29.506999999999998 kWh], Entry[timestamp=2024-05-01T14:00:00Z, state=31.664 kWh], Entry[timestamp=2024-05-01T15:00:00Z, state=32.808 kWh], Entry[timestamp=2024-05-01T16:00:00Z, state=33.325 kWh], Entry[timestamp=2024-05-01T17:00:00Z, state=33.532000000000004 kWh], Entry[timestamp=2024-05-01T18:00:00Z, state=33.59 kWh], Entry[timestamp=2024-05-01T18:33:16Z, state=33.595 kWh]]

This is my item configuration: Number:Energy pv_gesamt_estimate_energy "FC Gesamt Schätzung [%,.1f kWh]" (gForecast) {channel="solarforecast:fs-site:homeSite:energy-estimate", unit="kWh"}

This is my persistence configuration: ` Items {

gEveryChange* : strategy = everyChange, restoreOnStartup

gEveryUpdate* : strategy = everyUpdate, restoreOnStartup

gHourPersist* : strategy = everyHour, restoreOnStartup

gDayPersist*  : strategy = everyDay, restoreOnStartup

gForecast*    : strategy = restoreOnStartup, forecast

} `

weymann commented 2 months ago

I think there's only one problem and that's the persistence.

  • from release notes of openhab 4.1 I have learned that items processing timeseries iterate through the values provided switching to the predicted states at the right time. This does not happen. Item state is null all the time. Any idea what could be wrong?

The iTimeSeries items stay at null values if the underlying persistence doesn't work. As you showed in the logs the item is updated properly but it stays null because the value at the right time cannot be found in persistence. This isn't implemented by the binding - this is openHAB magic.

  • forecast items receives timeseries data on a regular bases. From oh logs I can see that the timeseries is processed ok. I can access the values via thing actions as described without problem. I'm using JDBC with mariadb backend. I created a group with persistence strategy forecast and the fc item is member of that group. I would expect that a table is created persisting the forecast values. But there is nothing - not even a table. Do you have any idea what could be wrong? I am on openhab 4.1.2.

Versioning and config looks fine so I can only assume what's going wrong 1) you've JDBC AddOn for MariaDB installed 2) configuration of http://1.2.3.4:8080/settings/addons/persistence-jdbc-mariadb/config is correct 3) persistence config shows content from .cfg file http://1.2.3.4:8080/settings/persistence/jdbc 4) other items than TimeSeries are stored correctly

If every point listed is fine maybe decreasing log-level of addon in config url of 2) can help. Otherwise it's better to post this topic in the forum and ask for help from maintainers who are taking care of this persistence addon