Automogator - Perl client for Indigo (and more)

Posted on
Thu Mar 04, 2010 3:26 pm
seanadams offline
Posts: 489
Joined: Mar 19, 2008
Location: Saratoga, CA

Automogator - Perl client for Indigo (and more)

Hi everyone,

As I hinted before, I have been working on some software libraries which make it possible to interface Indigo with a variety of other systems, such as alarm panels, AV equipment, etc. Today I have put together a first release of these tools, collectively dubbed "Automogator".

http://www.seanadams.com/ha/automogator

The focus of this initial release is the Indigo component, which includes complete (as documented, anyway) support for the Indigo control protocol. This means you can create a program which communicates bidirectionally with Indigo, responding instantaneously to any events of interest.

The other components in this release (Aprilaire, Cat2000, Elk, NEC, Pentair) all work, but are in various stages of completion and may lack documentation or examples. If you are interested in getting any of these particular devices work with Indigo I can provide example code by request.

At the risk of stating the obvious, this software is presently geared towards the experienced perl developer - it is not a packaged solution for any particular application. It is possible that I might adapt this to the forthcoming Indigo plugin architecture (improving ease of use)... depending on what form that eventually takes.

Sean

Posted on
Thu Mar 04, 2010 8:56 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Automogator - Perl client for Indigo (and more)

Sean: How does the aotomogator (and what does that name mean?) interface to Indigo?

Posted on
Thu Mar 04, 2010 9:51 pm
seanadams offline
Posts: 489
Joined: Mar 19, 2008
Location: Saratoga, CA

Re: Automogator - Perl client for Indigo (and more)

berkinet wrote:
Sean: How does the aotomogator (and what does that name mean?) interface to Indigo?


It's just a ridiculous name I came up with. It's talking to indigo on port 1176, which is a persistent TCP connection on which XML-structured data is exchanged back and forth. This is the same protocol used by the Indigo GUI client to communicate with the Indigo server.

Posted on
Fri Mar 05, 2010 5:08 pm
eme jota ce offline
Posts: 618
Joined: Jul 09, 2009
Location: SW Florida

Re: Automogator - Perl client for Indigo (and more)

seanadams wrote:

Wow!
Thanks for leading the way.
Hope to see some of this reach the point and click crowd, eventually.
(Sounds like Matt and Jay are opening the doors to these types of possibilities in Indigo 5.)

Posted on
Fri Mar 05, 2010 7:25 pm
chrisla23 offline
Posts: 97
Joined: Sep 16, 2009

Re: Automogator - Perl client for Indigo (and more)

Good work!

I got it working in about 20 minutes, so it is pretty close to point and click.

-Chris

Posted on
Fri Mar 05, 2010 7:45 pm
seanadams offline
Posts: 489
Joined: Mar 19, 2008
Location: Saratoga, CA

Re: Automogator - Perl client for Indigo (and more)

chrisla23 wrote:
Good work!

I got it working in about 20 minutes, so it is pretty close to point and click.

-Chris


Cool... but indigo_example.pl just a demo (see comments in that script). Is there one of the other components that you have a use for?

Posted on
Fri Mar 05, 2010 7:52 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Automogator - Perl client for Indigo (and more)

One of my interests is controlling my DENON AVR - it supports an ascii based protocol over a two-way telnet or rs-232 interface. I think you mentioned you are controlling an audio system. Would that be appropriate to use as a model for this type of application, and if so, could you post the POE module and an example wrapper script.

Posted on
Fri Mar 05, 2010 9:13 pm
seanadams offline
Posts: 489
Joined: Mar 19, 2008
Location: Saratoga, CA

Re: Automogator - Perl client for Indigo (and more)

berkinet wrote:
One of my interests is controlling my DENON AVR - it supports an ascii based protocol over a two-way telnet or rs-232 interface. I think you mentioned you are controlling an audio system. Would that be appropriate to use as a model for this type of application, and if so, could you post the POE module and an example wrapper script.


Yes - I have done this for Rotel (three Rotel products, actually) but it still needs a little work. It will be very similar to what you want to do with the Denon.

Posted on
Mon Mar 08, 2010 7:07 pm
chrisla23 offline
Posts: 97
Joined: Sep 16, 2009

Re: Automogator - Perl client for Indigo (and more)

> Cool... but indigo_example.pl just a demo (see comments in that script). Is there one of the other components that you have a use for?

One idea that comes to mind is keeping Inidgo in Sync with my SNMP controllable APC PDUs for my server rack. It already has the Indigo side of the state information, that would just need to be glued to an SNMP trap handler.

Also the power meter and Spa integration looks interesting.

Posted on
Tue Sep 07, 2010 8:03 am
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Automogator - Perl client for Indigo (and more)

Hi Sean,

I just wanted to thank you for automogator! I've been using it for a few months now and it's been working flawlessly. I've programmed quite a bit of perl before but never POE. It was a bit of a learning curve but it was worth it.

I made one addition to the code, I added a 'ReplacedDevice' callback to the Indigo module so it would notify my modules of changes in device states. Next I'd like to add the ability for it to save the 'FolderID' of variables. Currently when I change a variable that's been organized into a sub-folder it will dump out into the root once it's been touched by automogator.

I've written two modules so far. One interfaces to some RS485 boards I've got scattered throughout the house for basic I/O, and the other interfaces to a DSC alarm IT-100 interface board. Next I'm going to write a cacti module so certain device states can be easily passed to cacti for graphing. This way I could see a timeline of all my device usage throughout the day. If I associate a wattage with each device I could then plot some rudimentary power consumption graphs too.

I've currently got cacti graphing temperatures in each room of the house. I used digitemp with some maxim DS18B20 temperature sensors mounted to the phone jacks in each room. I used the unused telephone wires in each jack to create the one wire network which the sensors use to communicate with the computer. I'll also be using automogator to pull this data into indigo variables so it can better determine how to heat and cool the house. If anyone's interested in more details let me know and I'd be happy to share.

Thanks again Sean!

Travis

Posted on
Tue Sep 07, 2010 8:58 am
seanadams offline
Posts: 489
Joined: Mar 19, 2008
Location: Saratoga, CA

Re: Automogator - Perl client for Indigo (and more)

Excellent. I guess I should set up github so we can work together - in the mean time see if you can merge the 20100809 build which includes folder support and implicit creation of variables on modification. I have also added support for control page creation, which I used to great effect for setting up multi-room audio controls. The example is indigo_vaux.pl - problem discussed in another thread although I hadn't posted a follow-up yet.

Posted on
Tue Sep 07, 2010 10:14 am
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: Automogator - Perl client for Indigo (and more)

I guess I should have updated to the latest code before writing that post. :oops:

I rolled my changes into the latest Indigo.pm which can be downloaded here:
http://www.frightideas.com/hobbies/Indigo.pm

The only changes made were the addition of a ReplacedDevice callback which works exactly the same as the ReplacedVariable callback. I added it so I could monitor changes of Indigo devices. I have an 8 output rs485 board I use to control sprinklers, as well as a few other outputs that are spread around. I created x10 devices in Indigo to represent these and then monitor the state changes with automogator.

This can sometimes be accomplished by representing the device as an Indigo variable that automogator watches. But Indigo's internal sprinkler controller cannot be used with a variable, and variables also are not represented on Indigo's dynamically-created web pages as lights or switches. In those cases I prefer to use a device to represent them.

I'll clean up my code for the DSC IT-100 alarm module and pass it on so you can include it with automogator. For now I'll included a picture of the control page that represents it. The virtual LCD shows the actual LCD messages sent by the alarm.

Image

Travis

Posted on
Mon Sep 20, 2010 9:34 am
jashaffner offline
Posts: 59
Joined: Jan 14, 2007

Re: Automogator - Perl client for Indigo (and more)

Installed POE (cpan -i POE). Ran your indigo_example.pl and it could not locate your Indigo.pm. What am I missing?

Posted on
Mon Sep 20, 2010 9:43 am
seanadams offline
Posts: 489
Joined: Mar 19, 2008
Location: Saratoga, CA

Re: Automogator - Perl client for Indigo (and more)

Sorry I was being sloppy with my include paths. Try running it from one directory level up.

cd ..
examples/indigo_example.pl

Posted on
Mon Sep 20, 2010 10:27 am
jashaffner offline
Posts: 59
Joined: Jan 14, 2007

Re: Automogator - Perl client for Indigo (and more)

I did not download the rest of the files, just two, Indigo.pm and indigo_example.pl and both are in same directory in which I ran "perl indigo_example.pl".

Who is online

Users browsing this forum: No registered users and 4 guests