Problem with Persistence historicState and maximumSince

Hi,

I have two items where the persistence doesn’t work (historicState and maximumSince)

The items are:

Number:Length RainD “Gesamtniederschlag [%.1f %unit%/d]” (gWetter) {channel=“weatherunderground:weather:local:current#precipitationDay”}
Number:Length RainH “Aktueller Niederschlag [%.1f %unit%/h]” (gWetter) {channel=“weatherunderground:weather:local:current#precipitationHour”}

Database is influxdb.
When i check the DB…all values are there. I can use Grafana to display a the values but when i try to use this values in a rule

rainYesterday = RainD.historicState(now.minusHours(24), "influxdb")

i get this:
[pse.smarthome.model.script.dev.rules] - DevLog: org.openhab.core.persistence.internal.QueryablePersistenceServiceDelegate$1@b40126 org.openhab.core.persistence.internal.QueryablePersistenceServiceDelegate$1@1bda89

with this rule

rainYesterday = RainD.maximumSince(now.minusHours(24), "influxdb")

i receive this
[pse.smarthome.model.script.dev.rules] - DevLog: org.eclipse.smarthome.model.persistence.extensions.PersistenceExtensions$1@b8a37b org.eclipse.smarthome.model.persistence.extensions.PersistenceExtensions$1@1df7207

With other Items i´ve now Problems with the historicState and maximumSince

THX
Oliver

The item type is Number:Length. What value does the persictence store?

Hi,

at the moment 3,4 and 5

Try

rainYesterday = RainD.historicState(now.minusHours(24), "influxdb").state

same …
2018-06-15 13:30:31.769 [INFO ] [pse.smarthome.model.script.dev.rules] - Devlog: org.openhab.core.persistence.internal.QueryablePersistenceServiceDelegate$1@1db7edd org.openhab.core.persistence.internal.QueryablePersistenceServiceDelegate$1@1d57e5c

UPDATE:
don´t now why but with
rainYesterday = RainD.historicState(now.minusHours(24), "influxdb").state.toString
it works

maybe someone can explaint it to me. I put a Number (not Number:Length ) Item into the influxdb.
to get it out i´ve to convert it to string?:confused:

1 Like

I got a quite similar problem with the influxdb. Evrything new setup with current versions.

I can see clearly see ESPConnected going up and down with the connected devices. Inside my rule the maximumSince will always report the ACTUAL value and not the historical one.

Group:Number:SUM ESPConnected “ESP Connected [%d]”

ESPConnected.maximumSince(now.minusMinutes(60),“influxdb”).state

2018-08-22 19:34:24.834 [INFO ] [clipse.smarthome.model.script.Garden] - Connected devices = 16 from 16
2018-08-22 19:34:40.503 [INFO ] [clipse.smarthome.model.script.Garden] - Connected devices = 17 from 17
2018-08-22 19:35:03.808 [INFO ] [clipse.smarthome.model.script.Garden] - Connected devices = 16 from 16