I am trying to get the last update times of items in a rule, but it always returns the current minute.
I’m using rrd4j, and can successfully display charts using the items, so I know it is persisting correctly.
Here’s the rule:
rule "Test1"
when
Item Test changed
then
logDebug("heatingRule", "TemperatureThermostat is: " + TemperatureThermostat.state)
logDebug("heatingRule", "TemperatureThermostat lastUpdate is: " + TemperatureThermostat.lastUpdate)
logDebug("heatingRule", "RoomStatRelay is: " + RoomStatRelay.state)
logDebug("heatingRule", "RoomStatRelay lastUpdate is: " + RoomStatRelay.lastUpdate)
end
and the output from it:
2017-11-13 11:29:50.459 [DEBUG] [e.smarthome.model.script.heatingRule] - TemperatureThermostat is: 21
2017-11-13 11:29:50.484 [DEBUG] [e.smarthome.model.script.heatingRule] - TemperatureThermostat lastUpdate is: 2017-11-13T11:29:00.000Z
2017-11-13 11:29:50.494 [DEBUG] [e.smarthome.model.script.heatingRule] - RoomStatRelay is: OFF
2017-11-13 11:29:50.503 [DEBUG] [e.smarthome.model.script.heatingRule] - RoomStatRelay lastUpdate is: 2017-11-13T11:29:00.000Z
and rrd4j.persist:
Strategies {
// for rrd charts, we need a cron strategy
everyMinute : "0 * * * * ?"
default = everyChange
}
Items {
gHistory* : strategy = everyChange, everyMinute
gChart* : strategy = everyChange, everyMinute
gMotion* : strategy = everyUpdate, everyMinute
}
Item Test is just a number I can change to trigger the test.
TemperatureThermostat is updated about every fifteen minutes.
I know from looking at many examples that this is working for other people, but I’m now at a loss as to find out why it doesn’t for my setup.
Can anyone offer a pointer?
- Platform information:
- Hardware: RPI 3
- OS: OpenHABian
- openHAB version: 2.2.0~20171109111930-1 (Build #1075)