I want to get the average temperature of my swimmingpool.
logInfo("testrule", "temp -1h: " + Pool_Temp.historicState(now.minusHours(1)).state as DecimalType)
logInfo("testrule", "temp avg 1h: " + Pool_Temp.averageSince(now.minusHours(1)).state as DecimalType)
but the result is always null or something else depending on the command usage…
2020-04-05 10:51:57.679 [INFO ] [ipse.smarthome.model.script.testrule] - temp -1h: 7.3
2020-04-05 10:51:57.684 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ' test': 'state' is not a member of 'org.eclipse.smarthome.core.library.types.DecimalType'; line 13, column 55, length 47
I use influxDB for persistance:
Strategies {
everyHour : "0 0 * * * ?" everyDay : "0 0 0 * * ?" // if no strategy is specified for an Item entry below, the default list will be used default = everyChange
}
Items {
g* : strategy = everyChange, restoreOnStartup //persist all direct members of the group 'group' //item : strategy = everyChange, everyHour // persist the item 'item' //otherItem // no strategy set, so use default strategy for item 'otherItem' * : strategy = everyChange, restoreOnStartup // persist every item
}
persistance is working:
I tried a couple of averageSince command variants found in the forum, but all failed. can someone give me a hint whats wrong here?
thx