View unanswered posts | View active topics It is currently Wed Jun 19, 2013 9:38 am



Reply to topic  [ 3 posts ] 
 Newbie - Insteon Motion Sensor in AppleScript 
Author Message

Joined: Apr 05, 2011
Posts: 5
Post Newbie - Insteon Motion Sensor in AppleScript
I am new to using Applescript in Indigo. I have written a few scripts, but I just replaced an X10 Motion Sensor with an Insteon one. In my old Script, I did some functions triggered by motion and conditioned by the Dawn/Dusk detector being on or off (along with some other things).

I just don't know the proper way to test the on state of my new motion sensor in the script with button 1 and button 2...

I used to do this:
if (on state of device "OUT_SW_Garage Lights" is false and on state of device "OUT_DD_Garage is True) then

the DD is the Dawn Dusk detector. How do I test it button 2?


Tue Apr 05, 2011 8:29 am
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6851
Location: Austin, Texas
Post Re: Newbie - Insteon Motion Sensor in AppleScript
If you're wanting to track dawn/dusk state according to what the Motion Sensor is reading, then you'll need to use a variable to hold that state (the INSTEON Motion Sensor doesn't hold any states - we create a virtual ON/OFF state for the convenience of users but we don't create one for daylight/dark). Create two triggers which fire when they see Group/Button 2 ON and Group/Button 2 OFF respectively - they should set the variable (named, say, "ms_is_dark") to "true" and "false". Then in your script you just test the variable to see if it's true (which would indicate it's dark).

_________________
Jay (Indigo Support)
Image


Tue Apr 05, 2011 9:39 am
Profile WWW

Joined: Apr 05, 2011
Posts: 5
Post Re: Newbie - Insteon Motion Sensor in AppleScript
okay thank you. So in other words, I really can't run the same script and just change the syntax? The variable will work for me though! Thank you!


Tue Apr 05, 2011 9:50 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.