Problem with Persistence historicState and maximumSince

(Oliver K.) #1


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:
[] - 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
[] - 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


(Harry) #2

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

(Oliver K.) #3


at the moment 3,4 and 5

(Harry) #4


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

(Oliver K.) #5

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

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: