View unanswered posts | View active topics It is currently Fri Apr 25, 2014 12:20 am



Reply to topic  [ 5 posts ] 
 Getting Indigo to "control" an independent AppleScript 
Author Message

Joined: Oct 22, 2007
Posts: 12
Post Getting Indigo to "control" an independent AppleScript
I faced a challenge and came up with a kludgey solution, but wonder if there is a more elegant answer.

I am working to integrate a bunch of non-insteon automation and a/v gear (for example, a Nuvo Grand Concerto whole-house system). I am working on an AppleScript that controls the Nuvo via Serial Bridge. But I want to be able to control the Nuvo from within an Indigo Control Page (e.g., click a "mute" icon and have the Nuvo mute).

I had already created a bunch of state variable inside my AppleScript, with a parallel set inside Indigo (with logic to have my script update the Indigo variables, as appropriate).

I had the idea to extend this concept into a "message bus" with three Indigo variables: "scriptReadyForCommand," "indigoWantsToSendCommand" and "Payload." The idea is to have the script poll Indigo as pat of its core polling loop (which mainly scans the serial ports looking for stuff from devices). Inside Indigo control pages, I assign an AppleScript to certain actions (like clicking the "mute" button) and then queue up the appropriate command via my "bus" variables. My standalone script "sees" this on the next polling cycle and pulls down the payload variable and parses/processes as appropriate.

I can't directly send bytes over the serial ports from within Indigo because only one script at a time can use a serial port. I also wanted to maintain at least a bit of an abstraction layer to streamline things.

The above seems to work fine, but I am wondering if I (due to inexperience) am approaching this all wrong and should be doing this in a better / more conventional way.

Any thoughts?

Thanks!

-Chris


Mon May 10, 2010 10:52 am
Profile
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 13243
Location: Texas
Post Re: Getting Indigo to "control" an independent AppleScript
Hi Chris,

Your solution sound good to me.

We are, right now, working on an Indigo plug-in architecture that will make 2-way communication with hardware much simpler. It is Python based instead of AppleScript, but with the hooks we are adding (for Indigo 5.0) it will be much easier to accomplish the level of integration you need.

_________________
Image


Mon May 10, 2010 2:17 pm
Profile WWW

Joined: Oct 22, 2007
Posts: 12
Post Re: Getting Indigo to "control" an independent AppleScript
Sounds great. Can't wait. As an aside, you guys are awesome.


Tue May 11, 2010 9:06 am
Profile

Joined: May 27, 2007
Posts: 694
Location: NC
Post Re: Getting Indigo to "control" an independent AppleScript
support wrote:Hi Chris,

Your solution sound good to me.

We are, right now, working on an Indigo plug-in architecture that will make 2-way communication with hardware much simpler. It is Python based instead of AppleScript, but with the hooks we are adding (for Indigo 5.0) it will be much easier to accomplish the level of integration you need.


You guys are still keeping AS though?


Wed Jun 02, 2010 3:31 am
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 8364
Location: Austin, Texas
Post Re: Getting Indigo to "control" an independent AppleScript
Yes, we're definitely keeping AppleScript. We're just adding this plugin API as a way to add more native-like support for devices and actions.

_________________
Jay (Indigo Support)
Image


Wed Jun 02, 2010 6:56 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 0 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.