Scripting for time before dark

Posted on
Mon Nov 18, 2013 8:27 am
greenhornet offline
Posts: 61
Joined: Jan 22, 2011

Scripting for time before dark

I need a little help with scripting for some conditions. I would like to have a script that tells Indigo to work if it's several hours before dark, or dark. The only variable I see in my list for time of day is "isdaylight." There are a couple of scenarios where this comes in handy, including having lights come on in rooms where it gets a little dark before the sun goes down. How do I accomplish this in the conditions window?

Posted on
Mon Nov 18, 2013 9:55 am
jay (support) offline
Site Admin
User avatar
Posts: 18225
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Scripting for time before dark

I'm not sure a condition is what you're looking for - if you want to have a schedule execute at some fixed time before sunset then you'll just create a schedule with a time specifier of Sunset +X minutes. A condition only operates at the time a schedule or trigger fires and I think you need to specify when the schedule fires (not if it should execute the actions at execution time).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Nov 18, 2013 10:31 am
jalves offline
Posts: 747
Joined: Jun 16, 2013

Re: Scripting for time before dark

Not to second guess the expert, but shouldn't that be Sunset -X minutes if the OP want's this to happen before sunset?

Running Indigo 2023.2 on a 24" iMac M1), OS X 14.4
Jeff

Posted on
Mon Nov 18, 2013 11:59 am
greenhornet offline
Posts: 61
Joined: Jan 22, 2011

Re: Scripting for time before dark

Jay,
these are for triggers. I have motion sensors that I use to turn lighting scenes on. I don't want those scenes working during the day (with the exception of a little before dark). There is no schedule option for a trigger, which is why I was asking about scripting. If there is a better way, I'm open.

Posted on
Mon Nov 18, 2013 4:28 pm
ckeyes888 offline
Posts: 2425
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Scripting for time before dark

Why not just use a schedule for the sunset + or - to set a variable true/false and use
that as a condition in your trigger.

Carl

Posted on
Mon Nov 18, 2013 10:54 pm
jay (support) offline
Site Admin
User avatar
Posts: 18225
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Scripting for time before dark

In that case, I agree with Carl - use schedules to set a variable when you want the triggers to be enabled then use that variable in the condition.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 15 guests