(SOLVED) Reset item when it hasn't changed in a while


i’m struggling with a sample rule found in the wiki:

This rule sample would do something when the value has been the same (0) for 10 seconds. It’s kind of what i need, but i want to reset the item when it hasn’t changed and i don’t know the value.

What do i need to adapt?

Best regards,

Sounds like the Expire binding might do what you want

1 Like

That sounds very right to my situation. I’m calculating the power of my heating system by measuring the time between counter ticks - but if there are no ticks, the value doesn’t get reset to 0 and stays at the last value.

But i do want to wait for the heating to update the counter ticks if it runs and do not want the item to be reset to 0 if there are valid updates. Does this apply to my situation @watou?

:warning:️ If another binding is repeatedly updating the state of the item to be the same state it already was, the expiration timer will continue to be reset into the future. Dedicating an item to the expiration function (so it doesn’t receive repeated updates from another binding) would avoid unwanted behavior, should it apply in your case.

Does a simple postUpdate() to the item from a rule reset the expiration timer then?

I guess this says it perfectly:

The expiration time will be started or restarted every time an item receives an update or command other than the specified “expire” update/command.

Any future expiring update or command is cancelled if the item receives an update or command that matches the “expire” update/command.

Will try it and post my results here :slight_smile:

1 Like

Does exactly what it says it will and fits like a glove :smile:

Thanks @rossko57 and @watou!

1 Like