- Platform information:
- Hardware: Mac Mini (2012) 16GB RAM
- OS: Mac OS Catalina 10.15.8
- Java Runtime Environment: OpenJDK Runtime Environment Temurin-21.0.6+7 (build 21.0.6+7-LTS)
- openHAB version: 5.2.0.M5
- Issue of the topic:
I discovered this evening that - only recently (within the last few days at most) one particular persistence value seems to have got “stuck” in openhab’s head - and stuck in a way that has survived not just stopping and starting openhab, but even a full system reboot. I use an influxdb persistence service for various things including weather data from my home weather station, and today I noticed that it was giving erroneously high values for the rainfall measured in the last 10 minutes. This happens whether I use persistedState() to fetch the historic value and calculate against the current value, or use deltaSince() to have persistence do the calculation for me. In either case, the value given by openhab’s persistence queries for the day’s accumulated rainfall value from 10 minutes ago has - at least today - failed to move from 0.8mm (which it was mid afternoon, but it’s rained quite a bit since then). If I go into influxdb’s web interface or grafana, it shows that the correct value has been stored in the database all day: it is only openhab’s retrieval of that value which returns the wrong value. Furthermore, it seems isolated to just that parameter. If I do the calculation using Rain_Year (the rainfall for the year so far, which is persisted in exactly the same way), then I get the correct value.
Following is a screenshot of the graph from influxdb’s web interface, with the target over the time when the rainfall value was actually 0.8mm.
Since the last time it was working correctly, the following has happened:
- the influxdb process stopped working, leading to me rebooting the system to clear it.
- I upgraded to 5.2.0.M5 from 5.2.0.M1
As far as I can see, everything has been working fine since then… until this weird “stuck value” behaviour today.
Here is a test rule and the output from it running:
val referenceTime = now.minusMinutes(10)
val rainYearDelta = Rain_Year.deltaSince(referenceTime)
val rainfallDelta = Rainfall.deltaSince(referenceTime)
logInfo("weatheralert.rules","referenceTime = " + referenceTime.toString)
logInfo("weatheralert.rules","rainYearDelta = " + rainYearDelta.toString)
logInfo("weatheralert.rules","rainfallDelta = " + rainfallDelta.toString)
00:00:00.071 [INFO ] [.core.model.script.weatheralert.rules] - referenceTime = 2026-06-13T23:50:00.024753+10:00[Australia/Melbourne]
00:00:00.072 [INFO ] [.core.model.script.weatheralert.rules] - rainYearDelta = 0 mm
00:00:00.072 [INFO ] [.core.model.script.weatheralert.rules] - rainfallDelta = 8.4 mm
At the time that script ran, the actual daily rainfall figure was 9.2mm, and no rain had fallen in the previous 10 minutes. So you can see that it thinks 10 minutes ago the daily rainfall figure was 0.8mm, despite it actually being 9.2mm. I get the corresponding result if I use the persistedState() function instead.
So as far as I can see:
- influxdb has the right data
- the persistence service is (generally) working, and I get apparently correct values from all other persistence queries including performing the same query on a different measurement
- querying this one measurement consistently returns the wrong value, and the erroneous result is always the same wrong value even when the underlying data changes.
I don’t even know where to start looking for the cause of this!
