I have an item persisted in mapdb on every update.
Trying to check if the item was updated since a certain time using updatedSince() always returns true.
var update = items.BatteryB1.persistence.lastUpdate('mapdb')
console.log(update)
var before = update.minusMinutes(2)
console.log(before)
console.log(items.BatteryB1.persistence.updatedSince(before, 'mapdb'))
var after = update.plusMinutes(2)
console.log(after)
console.log(items.BatteryB1.persistence.updatedSince(after, 'mapdb'))
2024-09-06 16:44:13.055 [INFO ] [nhab.automation.script.ui.scratchpad] - 2024-09-06T16:18:38+01:00[Europe/London]
2024-09-06 16:44:13.059 [INFO ] [nhab.automation.script.ui.scratchpad] - 2024-09-06T16:16:38+01:00[Europe/London]
2024-09-06 16:44:13.065 [INFO ] [nhab.automation.script.ui.scratchpad] - true
2024-09-06 16:44:13.069 [INFO ] [nhab.automation.script.ui.scratchpad] - 2024-09-06T16:20:38+01:00[Europe/London]
2024-09-06 16:44:13.072 [INFO ] [nhab.automation.script.ui.scratchpad] - true
The last line should be ‘false’. Or am I doing something wrong?
Using an openHABian build, openHAB 4.2.1 on a Pi4 64Bit and openhab-js version: 5.5.0