Set Delay Time to Less Than a Second

Posted on
Tue Dec 06, 2016 9:13 pm
ukie offline
Posts: 69
Joined: Oct 15, 2010

Set Delay Time to Less Than a Second

Is there any way to set a time interval, specifically the delay to less than a second?
Is this possible through scripting?
My attempts have been fruitless.
I need to set a very short delay for CynicalSecuritySpy interactions with a security camera.

Posted on
Tue Dec 06, 2016 9:31 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Set Delay Time to Less Than a Second

The Indigo Server's smallest delay resolution is 1 second. You can implement your own delay shorter than that via scripting, but note the precision won't be guaranteed given the distributed nature of the Indigo Server + Plugins + SecuritySpy. They all run in their own processes and have their own queue handling of events. Depending on what you are doing though you might find acceptable results with much smaller delays.

Image

Posted on
Tue Dec 06, 2016 10:46 pm
ukie offline
Posts: 69
Joined: Oct 15, 2010

Re: Set Delay Time to Less Than a Second

Hello Matt,

I was looking at this page http://wiki.indigodomo.com/doku.php?id= ... g_tutorial
and tried to use the following command:
indigo.device.turnOn("Light", duration=2, delay=0.5)

but the "delay" variable in the function does not take a value less than 1.

All I need to do is turn on a light half a second (or less) after camera motion is detected.

Please advise.

Posted on
Tue Dec 06, 2016 11:14 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Set Delay Time to Less Than a Second

If you want a fast flash (after an initial 2 second delay?) you could just turn it on and immediately off:

indigo.device.turnOn("Light", duration=2)
indigo.device.turnOff("Light", duration=2)

Image

Posted on
Wed Dec 07, 2016 12:01 am
ukie offline
Posts: 69
Joined: Oct 15, 2010

Re: Set Delay Time to Less Than a Second

The "duration=2" should actually be "duration=300" (5 minutes)

I need the light to turn ON and stay ON.
But I need it to turn on just after (100-500 ms) the trigger is tripped (This is for light exposure reasons with SecuritySpy and how it captures thumbnails).

Posted on
Wed Dec 07, 2016 7:02 am
FlyingDiver offline
User avatar
Posts: 7217
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Set Delay Time to Less Than a Second

So immediately is no good, it has to be at least 100ms later?

Code: Select all
import time
time.sleep(0.1)
indigo.device.turnOn("Light", duration=300)

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Dec 07, 2016 2:58 pm
ukie offline
Posts: 69
Joined: Oct 15, 2010

Re: Set Delay Time to Less Than a Second

Just what I needed.
Thank you!

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests

cron