View unanswered posts | View active topics It is currently Fri Sep 10, 2010 8:29 am



Reply to topic  [ 6 posts ] 
 exio2x4 analog and applescript 
Author Message

Joined: May 27, 2007
Posts: 551
Location: NC
Post exio2x4 analog and applescript
Can applescript change the ON/OFF values of the analog inputs?


Sat Mar 15, 2008 9:24 am
Profile
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 8077
Location: Texas
Post Re: exio2x4 analog and applescript
anode wrote:Can applescript change the ON/OFF values of the analog inputs?

All of the EZIO device input states are read-only since they are inputs. The outputs can be changed, which will cause Indigo to send a command to the EZIO to turn the output on or off. But the EZIO doesn't let you set the input values, so Indigo has those AppleScript fields marked as read-only.

You can read the input values out as either binary or analog. Here is a binary example:
Code: Select all
set secondBinaryInput to item 2 of (get binary inputs of device "EZIO8T")

And here is an analog (integer) example:
Code: Select all
set firstAnalogInput to item 1 of (get analog inputs of device "EZIO8T")

Regards,
Matt


Sat Mar 15, 2008 6:58 pm
Profile WWW

Joined: May 27, 2007
Posts: 551
Location: NC
Post Re: exio2x4 analog and applescript
support wrote:You can read the input values out as either binary or analog. Here is a binary example:

And here is an analog (integer) example:
Code: Select all
set firstAnalogInput to item 1 of (get analog inputs of device "EZIO8T")

Regards,
Matt


I did a copy-n-paste. I'm getting a 'can not get device' error.

I also used "EXIO82X4" (what indigo sees/calls it) "LyncIO" (name I gave it in indigo), and 09.FE.D7, the address


Wed Mar 19, 2008 1:24 pm
Profile
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 8077
Location: Texas
Post Re: exio2x4 analog and applescript
How are you executing the AppleScript? If it is from the Script Editor application, then you need to add a:
Code: Select all
tell app "IndigoServer"

and:
Code: Select all
end tell

around the set firstAnalogInput ... line.

You should be changing "EZIO8T" to the name of the device you entered in the Device dialog (what you choose to call it). The name must be exactly the same for it to work, and should have quotes around it. If you still get an error, then let me know exactly what the error text is.

Regards,
Matt


Wed Mar 19, 2008 1:31 pm
Profile WWW

Joined: May 27, 2007
Posts: 551
Location: NC
Post 
Yup brain fart and that worked.

but another prob. Heres my code. I'm running it locally (form script editor until finished) It does not update the variable unless I go to the Home window and 'get IO stats' then it reads the value from there.

Code: Select all
using terms from application "IndigoServer"
   tell application "IndigoServer"
      set firstAnalogInput to item 1 of (get analog inputs of device "LyncIO")
      set (value of variable "LyncTEMP1") to firstAnalogInput
      set firstAnalogInput to item 2 of (get analog inputs of device "LyncIO")
      set (value of variable "LyncTEMP2") to firstAnalogInput
   end tell
   
end using terms from



Wed Mar 19, 2008 3:55 pm
Profile
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 8077
Location: Texas
Post 
That is correct. You'll want to create a Time/Date Action that periodically sends the Status Request command to the EZIO. That will then poll out the analog input values, which you will then be able to read via your script below.

Alternatively, you can send the status request command from AppleScript. But you will have to add a few second delay before you try to read the analog inputs, as it takes a few seconds for all the INSTEON commands to poll the input states out of the EZIO.

Regards,
Matt


Wed Mar 19, 2008 3:58 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 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.