Page 1 of 1

'On Script' taking a bit too long to fire

Posted: Monday 28 March 2016 12:36
by leecollings
I have a simple script that runs when my doorbell is pressed, but for the reason I want it, it's taking too long until it fires.
It's a simple script that sends a Pause command to my Sky HD box so that the TV is paused when the doorbell is pressed.

At the moment, it's just entered in the 'Script On' field when editing the doorbell switch.
Doorbell settings
Doorbell settings
Screen Shot 2016-03-28 at 11.34.53 am.png (224.38 KiB) Viewed 989 times
And the contents of the script file look like this
SkyHD script
SkyHD script
Screen Shot 2016-03-28 at 11.36.27 am.png (53 KiB) Viewed 989 times
In the log, the script is taking about 4-5 seconds until it fires, leaving the Skybox to pause when the doorbell sound has pretty much finished.

Is this natural behaviour of the 'On Script'? any ideas maybe with the contents of the script file?

Re: 'On Script' taking a bit too long to fire

Posted: Monday 28 March 2016 12:57
by jvdz
Do you have other events being triggered by the change state of the doorbell switch?
For example: All script_device_xxx.lua are ran each time a device changes state.

Jos

Re: 'On Script' taking a bit too long to fire

Posted: Monday 28 March 2016 13:00
by leecollings
Nope, well not that I'm aware of. This is the only script I have, there are no scripts in blocky or anything else. I literally only have this doorbell, some weather station data, and one light switch set up at the moment.

So I don't think, it's like an overloading of anything.

Running on a Raspberry Pi also

Re: 'On Script' taking a bit too long to fire

Posted: Monday 28 March 2016 17:13
by Siewert308SW
I do notice something thats looks like this but it's caused by something else.
When i have a lua with the following if/else and otherdevices == then a switch is triggered right away.

Code: Select all

if (devicechanged['Dark']  == 'On' and otherdevices['Lights']   == 'Off')		
	
then
		commandArray['Scene:Lights']='On'
end
But when i have the same lua otherdevices ~= then it takes up to 5 seconds before a switch is triggered.
When doing the same for a uservariable it even takes up to 8 seconds until a script/switch is triggered.

Code: Select all

if (devicechanged['Dark']  == 'On' and otherdevices['Lights']   ~= 'On')		
	
then
		commandArray['Scene:Lights']='On'
end

Code: Select all

if (devicechanged['Dark']  == 'On' and uservariables['Lights']   ~= 'True')		
	
then
		commandArray['Scene:Lights']='On'
end
Looks like Domoticz freaks out on the ~= state.
I know for sure it aint a other script that's is running as it also happens with just one script available.
If i remember it well then this behaviour is here since Mar 23.
First thought where other scripts, second thought was me fiddling around with Bluetooth experiments.
So got a fresh system today but same happens again.

Re: 'On Script' taking a bit too long to fire

Posted: Tuesday 29 March 2016 9:55
by leecollings
Based on my original issue, this doesn't apply to me though does it? I'm not using any kind of script like that. All I'm doing is getting a terminal command to run essentially when the doorbell is pressed.

Could it possibly be that the doorbell push button, is actually sending out the RF command a few seconds after it's pressed? Is there any way I could tell this?

Re: 'On Script' taking a bit too long to fire

Posted: Tuesday 05 April 2016 17:00
by leecollings
Any ideas anyone? Would like to try and diagnose this to get the script firing as quickly as possible.