View unanswered posts | View active topics It is currently Thu May 23, 2013 5:38 pm



Reply to topic  [ 4 posts ] 
 Variables 
Author Message

Joined: Dec 01, 2006
Posts: 47
Location: Sherman Oaks, CA
Post Variables
Hi guys,

I'm new to Indigo, so please forgive me if this is an easy one...

I would like to set up a date/time trigger that only fires only if a certain set of lights is off. The way I see it, I have to define a variable that gets set to a on/off value every time that light gets used, and then check the trigger against that variable.

What I would love to do is use the light itself as a variable. Like "if livingroom lights brightness = 0, then trigger action."

Does this have to be done in Applescript, or is there a way in Indigo 2 that I'm not seeing?

Thanks,
Dan


Sun Dec 03, 2006 10:00 am
Profile

Joined: Sep 21, 2006
Posts: 72
Location: Atlanta, GA
Post Re: Variables
editordz wrote:I would like to set up a date/time trigger that only fires only if a certain set of lights is off.


By "set of lights," do you mean that it is represented by a single device in Indigo, or are there multiple devices you want to check?


Sun Dec 03, 2006 12:24 pm
Profile

Joined: Dec 01, 2006
Posts: 47
Location: Sherman Oaks, CA
Post 
I meant single, but come to think of it, multiple conditions would be nice, too.

-dan


Sun Dec 03, 2006 2:44 pm
Profile

Joined: Sep 21, 2006
Posts: 72
Location: Atlanta, GA
Post 
editordz wrote:I meant single, but come to think of it, multiple conditions would be nice, too.

-dan


If you only need to monitor a single device's state, you can do this with a combination of three trigger actions. (More complex, but no script is required):

1st trigger: When device "livingroom lights" turns off, then enable trigger action (#3 below)

2nd trigger: When device "livingroom lights" turns on, then disable trigger action (#3)

3rd trigger: The trigger and action you originally wanted to perform.

If you want more devices, a trigger that executes an embedded AppleScript is probably the way to go:

Code: Select all
if ((brightness of (device "livingroom lights")) = 0) then
   execute action group "Action Group Name Containing Actions You Want to Perform
end if


Hope this helps.


Sun Dec 03, 2006 6:10 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.