Closed Rossko57 closed 4 years ago
You said it:
No-one should expect great timekeeping accuracy from expire binding,
For those who do need good time keeping or times under 10s, there is a PR on the openHAB-Scripters Helper Library that implements this Binding that does support subsecond accuracy. https://github.com/openhab-scripters/openhab-helper-libraries/pull/259 This can help get you buy until there is a replacement for this 1.x version binding.
Great response, very encouraging, will ensure openHAB maintains truly high standards.
expire binding, OH2.4 stable, oracle java build 1.8.0_181-b13, Windows 7
expire binding exhibits a one second error in expiration delays, when expressed in seconds.
Demonstration
Number testNum "num [%d]" {expire="10s, command=-1", autoupdate="false"}
small rule to repeat trigger-expire sequence
Begin demo sequence by posting any update to Item testNum
events.log results
State changes represent "start expire timer", commands represent "expired"
We'd expect a few milliseconds taken to process event bus and rule, but there is an unexpected one second component as well. This one second error is consistent across settings for e.g. 1s, 60s, 180s etc.
This one second slippage only seems to happen if the expiry time is specified in seconds. Expiry times given in minutes e.g.
{expire="1m, command=-1"}
are reasonable accurate, to a few milliseconds.I've observed, but not entirely confirmed, that the very first expire time cycle after editing the Item does seem to be on schedule - this is shown in the log snippet. It seems it is subsequent "reschedules" of expire that add the unwanted second.
No-one should expect great timekeeping accuracy from expire binding, but this issue becomes significant for those wishing times in the under-10s area.