Duration based OFF trigger to an item

Hi,
in my OH 1.8 i had timer rules set that after a specifc set of minutes - when my heating in bathroom has received an Item change to ON that this is been switched back to OFF after 30 minutes. With the Design Interface on OH4 i am struggeling to find this condition and to create this rule. Is this still something that has to be coded somewhere else?

I think this is a common request, that is used in different scenarios, like stair lights, motion detection, …

So i hope someone already solved this :slight_smile:

thanks
Karsten.

This can be solved easily with blockly.
Just setup a rule with your condition and in blockly use a timer block…

You can be lazy and just use expire in the metadata like this:

1 Like

Just to add to what’s been suggested and summarize:

  1. For the most part what you did in OH 1.8 is still a viable approach. However there will likely be some small syntax differences so the code will need to change.
  2. If you want to move your rules and you are not a programmer, @hmerk’s suggestion is a good one.
  3. If you always want this to turn off after 30 minutes, the Expire Item metadata that @ubeaut suggests is the easiest implementation.

Definitely be sure you go through the Getting Started Tutorial. If you want to take advantage of all the new stuff since OH 2.0 you really need to approach it as if you don’t have any experience with OH at all. You’ll find that there is a lot of knowledge that will transfer over but you can’t always count on that.

The docs for OH 4 are much better than OH 1’s docs ever were. Though they are still reference docs. so you still need to put things together to answer your question sometimes.

What solution did you end up using?

and I might add that there are even two add-ons from @rlkoshak that extend the capability of the expire-feature: Restart Expire and Expire Updater. Just search for “expire” in the Add-on Store.