I’m having a few issues with time series especially in the context of DSL rule triggers:
an Item assigned to a given time series becomes NULL when the time series runs out and does not recover when the time series gets updated later again. I must manually re-save that Item in the GUI to get it updated again. That Item is persisted twice, as a member of a group persisted using InMemory service with strategy forecast as well as an individual Item using default rrd4j service, like this:
version: 1
items:
EnergyDayAheadPrice:
type: Number
dimension: EnergyPrice
label: Energy Day-Ahead Price
unit: EUR/kWh
groups:
- gInMemory
tags:
- Point
metadata:
stateDescription:
value: ’ ’
config:
pattern: ‘%.3f %unit%’
I want to trigger a DSL rule by the update (not a change) of the Item assigned to a time series. The issue is that Item gets “updated” everytime the time series gets updated too e.g. by loading new data. There is apparently no way to trigger on the time series time stamp change only?
This behavior is independent from the OH version and exists since time series got introduced. Please advice or let me know what else to provide to further debug this issues.
Your first point is a bug. I am working on a solution for that. It should only happen when you update the timeseries through rules (persistence extensions), not when updated from a binding.
I don’t quite understand your second point. The event that updates the timeseries should have the relevant information about what is being updated. What exactly do you want to achieve?
thanks for looking into this. Yes, that buggy behavior is related to Items assigned to rule generated/modified time series. I’m using JRuby for this.
On the 2nd point - I’m using a time series Item as a trigger in a DSL rule like this:
when
Item SpotPrice received update
then
This is the sequence of events:
2026-03-05 14:45:00.005 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SpotPrice' changed from 0.13076 EUR/kWh to 0.16396 EUR/kWh (source: org.openhab.core.persistence)
2026-03-05 15:00:00.011 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SpotPrice' changed from 0.16396 EUR/kWh to 0.14926 EUR/kWh (source: org.openhab.core.persistence)
2026-03-05 15:08:35.236 [INFO ] [openhab.event.ItemTimeSeriesEvent ] - Item 'SpotPrice' shall process time series with 253 values.
2026-03-05 15:08:35.245 [INFO ] [hab.event.ItemTimeSeriesUpdatedEvent] - Item 'SpotPrice' updated time series with 253 values.
2026-03-05 15:15:00.013 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SpotPrice' changed from 0.14926 EUR/kWh to 0.17736 EUR/kWh (source: org.openhab.core.persistence)
2026-03-05 15:30:00.006 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SpotPrice' changed from 0.17736 EUR/kWh to 0.18746000000000002 EUR/kWh (source: org.openhab.core.persistence)
As you can see the Item gets updated every 15min based on the time series. But sometimes in-between, when the time series gets updated, the Item “receives an update” too, so the rule triggers outside of the 15min cadence. I’d like to suppress that event as a rule trigger.
Switching the trigger to “changed” does not help, as the rule may miss an event of the 15min cadence if there is no change. My workaround right now is to use a cron trigger, but I’d like to run the rule event triggered, not time based triggered.
The second one is a totally different one. There clearly are different events, but DSL is not able to distinguish them. I am not even sure we can in other scripting languages. Anyway, this is out of the scope of persistence, more in the scope of automation and the events available as triggers. I don’t intend to work on that. I hope someone else with more knowledge about that part of the code is willing to look into this.