I’m leaving this boilerplate, even though it is not really important for my question.
- Platform information:
- Hardware: RPI4, openHAB in a docker-container
- OS: Raspbian, kernel 5.10
- Java Runtime Environment: which java platform is used and what version
- openHAB version: 3.1, mainly with GUI rules
I’m trying to brief:
I have a light which I’d like to have turned off automatically after 5 minutes after it has been turned on.
This light is turned on by different switches or by motion detectors.
I’d like to reschedule the turn-off if a motion is detected during the 5 minutes timeout.
How do I implement such a rule with OpenHAB 3.1 with GUI rules? I’m triggering on the transition of the light-state (OFF → ON) or on motion of my detectors. But what to do in the then section?
Of course I did some research and found good stuff. The nicest one was a scripted rule with triggers inside which declared a global variable containing the timer and if it was not null it was reschedule otherwise created. With GUI rules this seems not to be possible any longer.
Then I read about an expire-addon, which is now integrated in OH directly, but I didn’t find an example how to use it with OH 3.1 GUI.
Can I create a temporary cron/timer-item/thing which is deleting itself once fired and is created or edited by my rule to reschedule?