'On Script' taking a bit too long to fire

Moderator: leecollings

Post Reply
User avatar
leecollings
Posts: 167
Joined: Tuesday 30 June 2015 18:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: United Kingdom
Contact:

'On Script' taking a bit too long to fire

Post 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 990 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 990 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?
User avatar
jvdz
Posts: 2445
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

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

Post 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
User avatar
leecollings
Posts: 167
Joined: Tuesday 30 June 2015 18:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: United Kingdom
Contact:

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

Post 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
User avatar
Siewert308SW
Posts: 294
Joined: Monday 29 December 2014 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

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

Post 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.
Setup:
- DS923+ Docker
Domoticz Latest Stable
Mosquitto / ZwaveJSUI @ Aeotec Z-Stick Gen5+ / PiHole Unbound
P1 USB Gas/Power, HW watermeter
- A lot of Zwave switches, contacts, plugs, smoke/Co2 ect
- DiY 7.5kWh Solar Storage @ GitHuB
User avatar
leecollings
Posts: 167
Joined: Tuesday 30 June 2015 18:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: United Kingdom
Contact:

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

Post 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?
User avatar
leecollings
Posts: 167
Joined: Tuesday 30 June 2015 18:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: United Kingdom
Contact:

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

Post by leecollings »

Any ideas anyone? Would like to try and diagnose this to get the script firing as quickly as possible.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest