You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RRD4J is typically set up with everyMinute persist strategies.
Requesting a historicState() with a target time more recent than actual "most recent" record results in a null return.
Expected behaviour - return most recent record.
Demo (Item is just a Number type persisted everyMinute) -
var xx = nm_Out_temp.historicState(now.minusSeconds(65), "rrd4j")
logInfo("TTEST", "Test Result 65: " + xx.state.toString + " " + xx.getTimestamp.toString)
xx = nm_Out_temp.historicState(now.minusSeconds(40), "rrd4j")
logInfo("TTEST", "Test Result 40: " + xx.state.toString + " " + xx.getTimestamp.toString)
xx = nm_Out_temp.historicState(now.minusSeconds(1), "rrd4j")
logInfo("TTEST", "Test Result 1: " + xx.state.toString + " " + xx.getTimestamp.toString)
sample results, which will vary depending on run time.
2021-01-24 19:12:29.263 [INFO ] [eclipse.smarthome.model.script.TTEST] - Test Result 65: 0.4 Sun Jan 24 19:11:00 GMT 2021
2021-01-24 19:12:29.272 [INFO ] [eclipse.smarthome.model.script.TTEST] - Test Result 40: 0.4 Sun Jan 24 19:11:00 GMT 2021
2021-01-24 19:12:29.277 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'test operation': cannot invoke method public abstract org.eclipse.smarthome.core.types.State org.eclipse.smarthome.core.persistence.HistoricItem.getState() on null
There might be a clue in this surprising random result, where the -40 seconds request appears to have seeked forward in time. Rounding going on?
2021-01-24 19:13:04.528 [INFO ] [eclipse.smarthome.model.script.TTEST] - Test Result 65: 0.4 Sun Jan 24 19:11:00 GMT 2021
2021-01-24 19:13:04.532 [INFO ] [eclipse.smarthome.model.script.TTEST] - Test Result 40: 0.4 Sun Jan 24 19:13:00 GMT 2021
2021-01-24 19:13:04.535 [INFO ] [eclipse.smarthome.model.script.TTEST] - Test Result 1: 0.4 Sun Jan 24 19:13:00 GMT 2021
From the pull requests created after this issue was raised i don't see one that looks like a clear fix, but it would be nice if this can be confirmed. Also this post from Rich seems ot have usefull information.
RRD4J is typically set up with everyMinute persist strategies.
Requesting a
historicState()
with a target time more recent than actual "most recent" record results in anull
return.Expected behaviour - return most recent record.
Demo (Item is just a Number type persisted everyMinute) -
sample results, which will vary depending on run time.
There might be a clue in this surprising random result, where the -40 seconds request appears to have seeked forward in time. Rounding going on?
May be related to NaN issue
openhab/openhab1-addons#5965
The text was updated successfully, but these errors were encountered: