# Expire timer does not always work

**URL:** <https://community.openhab.org/t/expire-timer-does-not-always-work/114568>\
**Category:** Runtime\
**Tags:** expire\
**Created:** [January 18, 2021, 1:38am UTC](https://community.openhab.org/t/expire-timer-does-not-always-work/114568 "2021-01-18T01:38:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Craigers](https://community.openhab.org/user_avatar/community.openhab.org/craigers/32/116508_2.png) [@Craigers](https://community.openhab.org/u/Craigers)\
**Post date:** [January 18, 2021, 1:38am UTC](https://community.openhab.org/t/expire-timer-does-not-always-work/114568/1 "2021-01-18T01:38:18Z")

</div>

- Platform information:
  - Hardware: Supermicro running ESXI
  - OS: Debian 10.7 VM
  - Java Runtime Environment: 11
  - openHAB version: 3.0.0

- Issue of the topic: Expire timer does not work for long time duration
- Please post configurations (if applicable):

I am using a Zwave wallswitch, with the switch connected to a bathroom fan. I have the Expire Metadata set for it with the following code, however it does not work as expected:

> value: 0h20m0s,command=OFF  
> config: {}

Screen snip:

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/e/7/e755898088a7038ad5047109ef9917753a8f697f.png)

I can use this same item but set the Expire to 2 minutes, 3 minutes, 5 minutes, 10 minutes and it works properly. But when it is set to 20 minutes it fails to complete and turn the fan off. Also have set it for 30 minutes and same failure.

Is there any way to see if the Expire timer is activated, and/or what its remaining time is?

Thanks  
Craig

---

<div class="post-metadata">

**Author:** ![Schnulli87](https://community.openhab.org/user_avatar/community.openhab.org/schnulli87/32/28910_2.png) [@Schnulli87](https://community.openhab.org/u/Schnulli87)\
**Post date:** [January 18, 2021, 5:56am UTC](https://community.openhab.org/t/expire-timer-does-not-always-work/114568/2 "2021-01-18T05:56:50Z")

</div>

Hi Craig,

just a quick guess: Remove the “0h .. 0s” in the expire duration and see if that makes it work.

I have/had a few items that use/d expire times in your time range and they all work/ed without a problem.

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [January 18, 2021, 11:35am UTC](https://community.openhab.org/t/expire-timer-does-not-always-work/114568/3 "2021-01-18T11:35:39Z")

</div>

> [@Craigers](#):
>
> I can use this same item but set the Expire to 2 minutes, 3 minutes, 5 minutes, 10 minutes and it works properly. But when it is set to 20 minutes it fails to complete

Expire timer restarts when the target Item receives _any_ update.

I expect your zwave switch is issuing routine status messages every 15 minutes?

Expire does not solve all timing requirements, sometimes you need rules.

---

<div class="post-metadata">

**Author:** ![Craigers](https://community.openhab.org/user_avatar/community.openhab.org/craigers/32/116508_2.png) [@Craigers](https://community.openhab.org/u/Craigers)\
**Post date:** [January 18, 2021, 11:24pm UTC](https://community.openhab.org/t/expire-timer-does-not-always-work/114568/4 "2021-01-18T23:24:23Z")

</div>

Thanks Lars and rossko57.

I cut the command to only contain “20m”, however as soon as I saved it, the 0h and 0s were added back on. I’m using the GUI for all editing and configuration.

I’ll watch the switch item to see if any updates are sent. Thanks for the hint if I may need to implement some rules for Expire functionality.

I will follow up and post what I find out.

Thanks for the pointers.  
Craig

---

<div class="post-metadata">

**Author:** ![John\_Siemon](https://community.openhab.org/user_avatar/community.openhab.org/john_siemon/32/36687_2.png) [@John\_Siemon](https://community.openhab.org/u/John_Siemon)\
**Post date:** [January 19, 2021, 2:13am UTC](https://community.openhab.org/t/expire-timer-does-not-always-work/114568/5 "2021-01-19T02:13:57Z")

</div>

I too am having intermittent failures with Expire Timers, but I am using .item text files. It’s not frequent, but it is real. It happened today. Never had a problem using same item text files in 2.5.x. Because it doesn’t happen all the time, I think it is going to be difficult for me to trace to a root cause. Mine is set to 15s.

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [January 19, 2021, 12:03pm UTC](https://community.openhab.org/t/expire-timer-does-not-always-work/114568/6 "2021-01-19T12:03:39Z")

</div>

> [@John\_Siemon](#):
>
> intermittent failures with Expire Timers

Doing, or not doing, what?

If you suspect unexpected Item updates, you don’t get to see Item state-updated-to-same-value in your `events.log`  
That does make it harder to understand.

But you can capture those with a little rule, example

```php
rule "diagnostic"
when
   myItem received update
then
   logInfo("diagnostic", "Updated to " + myItem.state.toString)
end

```

and look in `openhab.log` for the messages
