switch a device to off after some time.

Hello,

I would like to make a scene which triggers when a device is switched on. Than I would like the scene to switch that device off after something between 30 minutes and one hour.

Everytime that scene is activated I want the device to switch off after a different amount of time , but between the 30 minutes and 60 minutes , and everytime different.

Is there a Luup code for this? (I’am using UI5)

Thanks,
Cor

You could write this in LUA using a random number generator to generate the random part of the delay,
But if Vera reboots during that interval … the delayed action will not run,

You can do this with PLEG … You can have a schedule with 30 minutes off interval and a 30 minute random off interval,
The resulting off interval will be between 30 and 60 minutes.

@ RichardTSchaefer:

Ah cool , I didn’t know this was an option within PLEG , let me try some in the following days.

Thanks,
Cor