View unanswered posts | View active topics It is currently Sun May 19, 2013 10:27 pm



Reply to topic  [ 7 posts ] 
 trigger action status in web interface 
Author Message

Joined: Dec 03, 2006
Posts: 11
Post trigger action status in web interface
Hi! Anyhow know how to add the status of trigger actions to the web interface? I'd like the interface to show all of my trigger actions and whether they are enabled or disabled.

Thanks!


Sun Dec 03, 2006 12:33 pm
Profile

Joined: Sep 21, 2006
Posts: 72
Location: Atlanta, GA
Post Re: trigger action status in web interface
Scoot wrote:Hi! Anyhow know how to add the status of trigger actions to the web interface? I'd like the interface to show all of my trigger actions and whether they are enabled or disabled.

Thanks!


While it's not the best solution, perhaps you could periodically run an AppleScript that scans each item in the list to determine whether or not it is active. You could then append "(Enabled)" or "(Disabled)" to the name. Probably not what you were looking for, but it could work.


Sun Dec 03, 2006 7:04 pm
Profile
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 11683
Location: Texas
Post Re: trigger action status in web interface
You could also use AppleScript to loop through all the Trigger (and Time/Date) Actions, and then create Indigo variables and set their value based on the enable/disable state. You could then add those as variable control types on Control Pages.

Regards,
Matt


Mon Dec 04, 2006 9:10 am
Profile WWW

Joined: Dec 03, 2006
Posts: 11
Post Re: trigger action status in web interface
Hmmm, OK, i can handle the script to get status but how would i put that information back onto a control page?

Here's a script I wrote to retrieve the status of my triggers via email. The script is written on a per sender email address basis because I couldnt figure out how to get the original sending address into the TO field of the new email.

Cheers,
Scoot

tell application "IndigoServer"
set status to "Status" & return

set triggerList to every trigger action
repeat with currentTrigger in triggerList
tell currentTrigger
if (name starts with "Intruder") then
set status to status & name & " : " & enabled & return
end if
end tell
end repeat
log status as string
end tell

set theName to "PershingSmartHome"
set theAddress to "mycellphonenumber@vtext.com"
set theSubject to "Indigo Status"
set theBody to status
set theSender to "myemailxxx@mac.com"

tell application "Mail"
set newMessage to make new outgoing message with properties {subject:theSubject, content:theBody & return & return}
tell newMessage
set visible to true
set sender to theSender
make new to recipient at end of to recipients with properties {name:theName, address:theAddress}
end tell
send newMessage
end tell


Tue Dec 05, 2006 12:04 am
Profile

Joined: Dec 03, 2006
Posts: 11
Post Re: trigger action status in web interface
Matt,

I guess I'm hung up on 'adding variable control types'... Is there any more detail on this?

Cheers


Tue Dec 05, 2006 12:06 am
Profile
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 11683
Location: Texas
Post Re: trigger action status in web interface
Code: Select all
set varName to "fooTest"
set varValue to "true"
if not (variable varName exists) then
   make new variable with properties {name:varName, value: varValue}
end if
set value of variable varName to varValue

The above code shows you how to set a variable value and automatically create it if it doesn't exist. Note I'm not suggesting that you append a name onto the variable name, but rather set the variable value to something that represents if it is enabled / disabled. You might want to use "true" and "false" so that you can use the image state on for the variables on the Control Page.

There is not a way (not without hacking the XML database file) to automatically create Control Page elements to show that variable. But, once you run your script and let it create your variables, you can then manually from within Control Page editor create new variable controls.

You then setup your script to run periodically and it will update the variable values which will be reflected on your Control Page.

BTW, I'm adding on my ToDo list (won't happen for initial 2.0 release) to implement a new Control Page element type that reflects the enable/disable state of Trigger and Time/Date Actions. :-)

Regards,
Matt


Tue Dec 05, 2006 6:24 pm
Profile WWW

Joined: Dec 03, 2006
Posts: 11
Post 
Thanks Matt. FYI, I just purchased Indigo 2. It rules.


Sat Dec 09, 2006 12:33 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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.