Page 1 of 1

Delay in shutting off devices in a group

Posted: Thursday 19 January 2017 11:50
by SteGe
Hi all,

hope you can help me out with this one! At my house I have a Raspberry Pi with rfxtrx433e. Every night at some time (depending who is at home, and if there are surtain triggers on or off) I switch a couple of lights, grouped by a group, off. But sometimes not all the lights are going off. I suggest it happens because of to quick sended signals to my 433 switches (kaku look-a-likes).

The script to shut off the lights is in LUA. But is there a solution to put a delay in shutting off each device in the group? I've searched for it but couldn't find a delay option in LUA itself. So perhaps there is an other solution for this problem. I have put them into a group because of not always every light is going off. When I resend it to the lights the one which isn't going off will turn off eventually. And it isn't always the same one...

Re: Delay in shutting off devices in a group

Posted: Thursday 19 January 2017 11:55
by Egregius
First: it's better to check if the device is on before sending on off signal. That way you prevent sending unnescessary commands.
Second: Not sure about lua, but in php you can easily sleep (seconds) or even usleep (microseconds).

Re: Delay in shutting off devices in a group

Posted: Thursday 19 January 2017 12:05
by Siewert308SW
Some how and is known for some time delay times in Scenes aint working that well.
But in Groups they do, you can create a group with some lights and set a ON or OFF delay.

Like the screenshot below:
In one of my groups the light will be triggered with a delay of two seconds when ON or OFF.

Image

In lua you can do it like:

Code: Select all

	commandArray[1]={['Schemerlamp']='On AFTER 5'}	
	commandArray[2]={['Wandlampen']='On AFTER 10'}
	commandArray[3]={['Sta lamp']='On AFTER 15'}	
	commandArray[4]={['Vaas lamp']='On AFTER 20'}	

Re: RE: Re: Delay in shutting off devices in a group

Posted: Tuesday 24 January 2017 9:45
by SteGe
Egregius wrote:First: it's better to check if the device is on before sending on off signal. That way you prevent sending unnescessary commands.
Second: Not sure about lua, but in php you can easily sleep (seconds) or even usleep (microseconds).
I already do that at first. But when I mentioned that not all the lights where turned off I have tried to shut down the whole scene.

sent by tapatalk

Re: RE: Re: Delay in shutting off devices in a group

Posted: Tuesday 24 January 2017 9:49
by SteGe
Siewert308SW wrote:Some how and is known for some time delay times in Scenes aint working that well.
But in Groups they do, you can create a group with some lights and set a ON or OFF delay.

Like the screenshot below:
In one of my groups the light will be triggered with a delay of two seconds when ON or OFF.

Image

In lua you can do it like:

Code: Select all

	commandArray[1]={['Schemerlamp']='On AFTER 5'}	
	commandArray[2]={['Wandlampen']='On AFTER 10'}
	commandArray[3]={['Sta lamp']='On AFTER 15'}	
	commandArray[4]={['Vaas lamp']='On AFTER 20'}	
Thanks, will try the array option you meantioned. Could use it on multiple scripts I have.

Could you explain what the exact purpose of the off on delay is? I have tried to understand it by the wiki and the manual but couldn't get a clear discription about the exact working.

sent by tapatalk