Insteon SmartLinc

Questions and comments specific to a particular plugin should go here.

Insteon SmartLinc

Postby dt1000 » Mon Feb 28, 2011 5:07 pm

Hello!

Have you ever dreamed about having automated home lighting without dropping a small fortune?
Well stop dreaming small, because the new SmartLinc plug-in for Event Ghost will let you do all that and more!

You can grab the latest (BETA) version here:
http://www.mediafire.com/?afzle5dcq7rpwdo

What does this plug-in do?

Boring version:
- Enables Event Ghost to send and receive messages from an Insteon SmartLinc lighting controller
http://www.smarthome.com/2412N/SmartLinc-INSTEON-Central-Controller/p.aspx

Cool version:
- Dims the lights in your house when you start a movie on XBMC
- Use USB-UIRT to turn off your TV by double tapping light switches
- Combine with other plug-ins and a motion sensor to make your computer speak the weather when you enter the room in the morning
- Use Event Ghost to control intelligent lighting automation based on the level of daylight

Combine this plug-in with these other ones to turn Event Ghost into a fully featured Home Automation system...
USB-UIRT: to control your TV and other home entertainment devices
Sun Tracker: to create intelligent lighting commands that check to see if the sun is up before turning lights on
Schedule Ghost: to automate your home lighting
Weather and Speech: to have your computer speak to you as you walk around the house

:D

Dan

P.S: As this is the first release, there will most definitely be a few bugs. If you find any, let me know. Thanks!
dt1000
 
Posts: 9
Joined: Thu Apr 01, 2010 5:46 am

Re: Insteon SmartLinc

Postby Livin » Thu Mar 03, 2011 5:11 am

does this work with, or do you have plans to support, the Smarthome PLM (modem version)?
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 778
Joined: Wed Oct 08, 2008 4:56 am

Re: Insteon SmartLinc

Postby Livin » Sat Mar 05, 2011 9:26 pm

I forgot I had a 2412N v1 laying around - I'll try it
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 778
Joined: Wed Oct 08, 2008 4:56 am

Re: Insteon SmartLinc

Postby Livin » Sat Mar 05, 2011 11:03 pm

Dan,
I installed your plugin and got it working very quickly. Seems to work fine for me. Though in its current state is has very limited use for me since I already have a full HA app. I would like to know your plans for this plugin - if it is expanded to provide more functionality that would be great, I could get rid of my other app.

Some features that would be useful...

1) Your plugin to program the 2412N with the devices/scenes
- this would allow use of the built-in web UI from the 2412N and make it seamless with EG's config

2) Your plugin to autogenerate a user configurable web UI
- this would eliminate the need to program the 2412N and allow cross device/browser functionality

3) Your plugin to autogenerate all macros (states) for all devices
- thinking this might be necessary for #2 to work, not sure.
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 778
Joined: Wed Oct 08, 2008 4:56 am

Re: Insteon SmartLinc

Postby Livin » Thu Mar 10, 2011 5:22 am

Dan - you around?
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 778
Joined: Wed Oct 08, 2008 4:56 am

Re: Insteon SmartLinc

Postby dt1000 » Sat Apr 02, 2011 5:39 pm

Hello!
Sorry for the delayed response, looks like I forgot to set e-mail notification up properly (slaps forehead). :roll:

Glad you got the plug-in working OK! :D :D :D
To answer your questions...

1) PLM support
I do not have a Smarthome PLM, so there are currently no plans to support it.
If someone knows the Python code to talk to the PLM, I would be happy for them to integrate it into my plug-in.

2) Scene editing
I have done some experimentation with this, but have had no success trying to work out the commands I need to send the SmartLinc to create scenes.
If anyone can get this working using the plug-in's existing custom command functionality, I'd be happy to add the functionality.
I would really like to add this feature!!!

3) Auto-generating a configurable Web UI
That's a little outside the scope of this plug-in. It would be cool, but I'd like to keep things simple for now.

4) Auto-generating macros
What exactly do you mean? I could try and detect all the devices and scenes on the network if I knew the correct Insteon commands...

By the way, what home software are you using to control your SmartLinc? I had a hard time finding a decent home automation package, which is why I decided to write my own!
That and the fact that I wanted to interface my lights with XBMC (it still makes me smile when a movie ends and all the lights in my living room gracefully fade up, as if by magic).

Thanks,
Dan
dt1000
 
Posts: 9
Joined: Thu Apr 01, 2010 5:46 am

Re: Insteon SmartLinc

Postby Livin » Sat Apr 02, 2011 7:07 pm

dt1000 wrote:1) PLM support
I do not have a Smarthome PLM, so there are currently no plans to support it.
If someone knows the Python code to talk to the PLM, I would be happy for them to integrate it into my plug-in.

I did a quick search using 'python insteon' and found a bunch of stuff, including... http://byronet.info/pylights.html

dt1000 wrote:2) Scene editing
I have done some experimentation with this, but have had no success trying to work out the commands I need to send the SmartLinc to create scenes.
If anyone can get this working using the plug-in's existing custom command functionality, I'd be happy to add the functionality.
I would really like to add this feature!!!


dt1000 wrote:3) Auto-generating a configurable Web UI
That's a little outside the scope of this plug-in. It would be cool, but I'd like to keep things simple for now.

I see this as a last step (lowest priority) to make a fully functional HA plugin but since EG has the capability to easily use the web server it would be a nice option for quickly triggering via any device.

dt1000 wrote:4) Auto-generating macros
What exactly do you mean? I could try and detect all the devices and scenes on the network if I knew the correct Insteon commands...

It would be great to have your code read in a user created INI/XML/TXT/etc of all the devices and autogenerate on/off/dim macros for each Device & Scene so we would not need to create each one manually.

dt1000 wrote:By the way, what home software are you using to control your SmartLinc? I had a hard time finding a decent home automation package, which is why I decided to write my own!
That and the fact that I wanted to interface my lights with XBMC (it still makes me smile when a movie ends and all the lights in my living room gracefully fade up, as if by magic).

I was using Homeseer (overpriced & outdated) and now I'm testing mControl v2 (tad buggy & lacks a few basic features I really want - but overall pretty good) so I'm looking forward to trying v3 (currently in beta). I also use XBMC, daily, and my goal is to do as you have with a specific action in XBMC triggering a home automation scene. I put in a feature request many moons ago for XBMC to allow an HTTP command be tied to any action in XBMC (search TRAC or the forum and you will find it)
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 778
Joined: Wed Oct 08, 2008 4:56 am

Re: Insteon SmartLinc

Postby Morvandium » Tue May 03, 2011 3:45 am

Heyo. I'm new to the home automation thing. Bought an old house a year ago, and I had to redo the old electrical, so I added some Insteon devices (5 Icon on/off paddles, 2 6-button on/off switches_ and a SmartLinc. When I recently found out about the open nature of the SmartLinc hardware, it thrilled me even more.

I downloaded the smartlinc plugin for event ghost. I can control my devices with it fine. (I did add my SmartLinc to the device list.) However, it doesn't trigger any events based on incoming data.

I used vgehts SmartLincMonitor.jar (project at http://www.vgehts.com/homeautomation/ and mentioned on SmarHome's forums) and there are incoming signals to the SmartLinc (so I must have linked my switches to the SmartLinc correctly) that I were readable over the network.

(disclaimer here: I don't program Python routinely, but I program enough other languages that it doesn't seem that complicated, other than a few nuances. I'll also admit at this point that it's been half a decade since the last network programming I've done. That said, my knowledge of the Python socket library is at best lacking.)

I un-commented line 822 of SmartLinc\__init__.py (the call to asyncore.loop() at the end of __start__ ). EventGhost sees my incoming commands makes events -- (though I have not tested it exhaustively). However (as I'm sure you know), with that line uncommented I cannot successfully initiate a SmartLinc action and EventGhost soon crashes... well, more like it starts responding like zombie with a few reflexes intact.

If it makes any difference I'm running Windows 7. I've tried the software with my laptop plugged into the network and wirelessly (it shouldn't matter).

Anyway, I'm gonna keep learning Python and delving into your source. Once I understand it a bit better (and improve my Python proficiency), who knows what I may be inspired or able to do.

But, until that day arrives, any input would be helpful.
Morvandium
 
Posts: 8
Joined: Tue May 03, 2011 2:53 am

Re: Insteon SmartLinc

Postby Morvandium » Tue May 03, 2011 4:49 pm

Ah, I seem to have figured it out.

It seems that the asyncore.loop() call probably caused the crashing because eg already has an asyncore loop running. Guess that makes sense.

However, eg's asyncore loop needed to be restarted so it would recognize the SmartLinc plugin and start polling the readable() function.

I now call eg.RestartAsyncore() in __start__() of class SmartLinc (where the "#asyncore.loop()" line is).

(I figured out that readable() was never even being called on SmartLincClient() by explicitly adding the function and putting some output and a return value in it... by default it returns True anyway.)

What confuses me is that the plugin did work for others, but not for me. I'd have to take a guess that for some reason the startup sequence for EventGhost is different for us -- based on what plugins we each have. As a result my SmartLinc plugin is loading after the last time that loop is automatically restarted, whereas yours are loading before that event. Again, that's my guess.

But, other network plugins I browsed through do call eg.RestartAsyncore(). Seems you might want to add that line to clean up the functionality.

Yay! Programming is like riding a bike -- you never really forget how. (I've never used an asynchronous loop before -- the last network programming I did was multi-threaded and in C++. This is easy by comparison... now granted, that project was a ground-up file transfer protocol implementation... a little heftier of a job than this.)
Morvandium
 
Posts: 8
Joined: Tue May 03, 2011 2:53 am

Re: Insteon SmartLinc

Postby dt1000 » Wed May 04, 2011 2:34 pm

Hey, Morvandium,
Great to see you enhancing the plug-in.

I've found that sometimes it stops working, and this may well be why.

I'll integrate your fix into the code this weekend and test it out.
If all is well (and it sounds like it should be), I'll be able to upload a new version pronto.

Could you post your new code so I can diff it against the orignial?

Nice work!

:)
dt1000
 
Posts: 9
Joined: Thu Apr 01, 2010 5:46 am

Re: Insteon SmartLinc

Postby Livin » Wed May 04, 2011 3:53 pm

It would be great to see this plugin extended. Most of my house is wired with Insteon (and some Z-wave) ... I use EG to control almost everything on my HTPC (WMC, XBMC, etc) and would love to see this plugin integrate a Device/Group/Event GUI and web UI for controlling via the web server.

just thinking out loud :)
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 778
Joined: Wed Oct 08, 2008 4:56 am

Re: Insteon SmartLinc

Postby Morvandium » Wed May 11, 2011 8:07 pm

Very sorry about the long delay in response. I'm job-searching and have other things going on in my life -- I had to step away from it for a few days.

I also somehow managed to corrupt my eventghost tree to the point that I had start over (I didn't realize it was possible). I'll be saving new versions each time I make a change from here on out.

As to posting code, Is there a preferred space to post the file (offsite?) or should I just upload it all or partially here?

Also, I think some of your insteon code parsing/handling could use some updates too regarding a specific item. I have two On/Off 6 button Insteon switches. (Buttons are on/a/b/c/d/off.) Both of them give inaccurate eventghost report statuses (such as 75% on). I haven't looked into this, but do intend on debugging it at some point.
Morvandium
 
Posts: 8
Joined: Tue May 03, 2011 2:53 am

Re: Insteon SmartLinc

Postby Morvandium » Fri May 13, 2011 6:23 pm

I offered dt1000 some assistance, and he accepted. I may be new to Python, EventGhost, and for that matter the home automation scene, but I am a damn good programmer, though out of practice. We haven't talked about many details, but I'm in the process of doing some code cleaning ... encapsulation, commenting, increasing readability, robustness and scalability. This will at least take me a few more days to complete.
Once done, I'll be moving on to increasing its device support, and we'll see about additional GUI features. GUIs aren't my specialty.

Between me and dt1000 we have dimming devices, ICON switches (on/off), KeyPadLinc (6 button on/off), and the SmartLinc (duh). To increase support for Insteon devices, and to test this support, we need people to test devices we don't have. All that will be required is using EG, the SmartLinc Plugin, SmartLinc, and your Insteon devices. I'll want copy/paste debugging statements with SmartLinc communication data from EG, along with a short statement about anomalous/unexpected/failing behavior.

The following are Insteon devices (I can currently think of) I'd be interested in testing or creating support for:
Thermostats
Motion/occupancy detectors
Photobeam Entry Alert
Garage Door openers
Moisture sensors
any low voltage devices (sprinkler, open/closed sensors, etc.)
drape controllers
freezer failure detectors
any Insteon outlets
any remotes/touchscreens
any other devices (the odder, the better)

ANY x10 devices (there is currently NO X10 support in this plugin).

LATER ON, after we expand this plugin's support, I'd interested in bridge devices... but first, Insteon / X10.

If you'd be interested in helping, speak up! (It will be easy, and you'll likely get support for your device.)

Livin wrote:It would be great to see this plugin extended. Most of my house is wired with Insteon (and some Z-wave) ... I use EG to control almost everything on my HTPC (WMC, XBMC, etc) and would love to see this plugin integrate a Device/Group/Event GUI and web UI for controlling via the web server.

just thinking out loud :)


Would you tell me more about what you envision? Please be detailed (especially about the web UI... because the SmartLinc has an web UI built in... and it can be modifed (search SmartHome's forum's for that, I think... google found it for me before.)
But, how do you see the Device/Group/Event gui being set up? What do the screens look like that you envision to do this?
Morvandium
 
Posts: 8
Joined: Tue May 03, 2011 2:53 am

Re: Insteon SmartLinc

Postby Livin » Tue May 17, 2011 6:53 am

SmartLinc's built-in features are very limited. I have one (v1) but don't use it. I use a 2412S but would be wiling to test your code using the SmarLinc.

In order for EG to be fully functional as an HA controller it will need some key components...
- Devices, Locations, Events (macros), and store/trigger Insteon Groups.
- Each of the above will need to be an object in EG with appropriate/associated properties... on, off, dim levels, trigger history (action, date, time), devices in each Group/Event/etc, etc.

Here's a mockup I did of an HA UI for another more complex app (so some of the items will not translate but most will)...
HA_UImockup.jpg
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 778
Joined: Wed Oct 08, 2008 4:56 am

Re: Insteon SmartLinc

Postby Morvandium » Tue May 17, 2011 10:55 pm

Ah, if you have a V1 SmartLinc, your options are a bit limited due to the smaller memory in it. I looked into modifying the interface for my V2 before I ran into EG. The only reason I didn't just create a new interface was because I found EG and and realized all the possibilities.

The SmartLinc plugin is getting more robust by the hour. I'm about 80% done with my initial re-write.

I like the simplicity and robustness of your UI mockup. I'm a big fan of usability, robustness, and simplicity. (As far as fancy is concerned, fancy to me means "works well and does cool stuff" not "looks pretty.")

When I'm done with the rewrite, then I want to start increasing the intelligence of the plugin -- see what I can do to make it aware of what type of device each is, only options appropriate for it (so, say my Icon on/offs aren't options in the dimming action configurations; or a new action to adjust the button LED brightness for a KeyPadLinc that wouldn't list standard switches which don't use the LED settings).

As support grows and I get a better feel for the whole Insteon system (scenes and the SmartLinc kinda confuse me still; I'm still really in the process of integrating the white-papers into my thought process), then I'll consider a more comprehensive UI like the one you showed me.

Thanks for helping get the creative juices flowing.
Morvandium
 
Posts: 8
Joined: Tue May 03, 2011 2:53 am

Next

Return to Plugin Support

Who is online

Users browsing this forum: abuttino, Dragon470 and 4 guests