Hi @JimT ,
I noticed the time-series Item is running 1h behind. My OH instance on Docker runs on UTC:
root@dba4bb64487a:/openhab# date
Sun 07 Apr 2024 09:10:53 AM UTC
This is what I get from the HTTP item:
2024-04-07 10:35:39.279 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HTTP_URL_Thing_Preise_copy' changed from NULL to {"elements":[{"begin":"2024-04-07T10:00:00+01:00","end":"2024-04-07T11:00:00+01:00","price":-0.325},{"begin":"2024-04-07T11:00:00+01:00","end":"2024-04-07T12:00:00+01:00","price":-0.994},{"begin":"2024-04-07T12:00:00+01:00","end":"2024-04-07T13:00:00+01:00","price":-2.679},{"begin":"2024-04-07T13:00:00+01:00","end":"2024-04-07T14:00:00+01:00","price":-2.006},{"begin":"2024-04-07T14:00:00+01:00","end":"2024-04-07T15:00:00+01:00","price":-0.504},{"begin":"2024-04-07T15:00:00+01:00","end":"2024-04-07T16:00:00+01:00","price":-0.016},{"begin":"2024-04-07T16:00:00+01:00","end":"2024-04-07T17:00:00+01:00","price":0.692},{"begin":"2024-04-07T17:00:00+01:00","end":"2024-04-07T18:00:00+01:00","price":9.146},{"begin":"2024-04-07T18:00:00+01:00","end":"2024-04-07T19:00:00+01:00","price":10.839},{"begin":"2024-04-07T19:00:00+01:00","end":"2024-04-07T20:00:00+01:00","price":10.64},{"begin":"2024-04-07T20:00:00+01:00","end":"2024-04-07T21:00:00+01:00","price":8.995},{"begin":"2024-04-07T21:00:00+01:00","end":"2024-04-07T22:00:00+01:00","price":7.746},{"begin":"2024-04-07T22:00:00+01:00","end":"2024-04-07T23:00:00+01:00","price":7.206}],"next_offset":null,"last_modified":"2024-04-06T10:45:03+00:00"}
This is the resulting time-series from the rule:
2024-04-07 10:50:57.755 [INFO ] [hab.event.ItemTimeSeriesUpdatedEvent] - Item 'PreisTS' updated timeseries [Entry[timestamp=2024-04-07T09:00:00Z, state=-0.325], Entry[timestamp=2024-04-07T10:00:00Z, state=-0.994], Entry[timestamp=2024-04-07T11:00:00Z, state=-2.679], Entry[timestamp=2024-04-07T12:00:00Z, state=-2.006], Entry[timestamp=2024-04-07T13:00:00Z, state=-0.504], Entry[timestamp=2024-04-07T14:00:00Z, state=-0.016], Entry[timestamp=2024-04-07T15:00:00Z, state=0.692], Entry[timestamp=2024-04-07T16:00:00Z, state=9.146], Entry[timestamp=2024-04-07T17:00:00Z, state=10.839], Entry[timestamp=2024-04-07T18:00:00Z, state=10.64], Entry[timestamp=2024-04-07T19:00:00Z, state=8.995], Entry[timestamp=2024-04-07T20:00:00Z, state=7.746], Entry[timestamp=2024-04-07T21:00:00Z, state=7.206]]
This is the related Number item:
2024-04-07 11:00:00.001 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PreisTS' changed from NULL to -0.325
I guess something is (still) wrong with the time offsets:
"begin":"2024-04-07T10:00:00+01:00","end":"2024-04-07T11:00:00+01:00","price":-0.325}
actually means 10AM…11AM my time zone which is CE(S)T.
What do I need to change in the rule to make it fit?
timestamp = ZonedDateTime.parse(element["begin"])
.with_zone_same_instant(ZoneId.system_default)
Thanks!