INSTEON support - trying to start a central thread for request

I already had the older Hub (2242-222) and decided to try out the new Hub (2245-222) for the integration with Harmony and to try out the new API. After messing around with it for a couple days and sniffing the traffic from the Windows app I thought I share some of what I found.

Insteon has stated that the new hub needs to be connected for it to work and this is mostly correct. If you link items like switches or remotes to responders, they will still work if the network is unplugged. However it looks like all the mobile apps rely on using the cloud service to send command and receive status updates.

The new Hub seems to basically work as a relay device. It looks like the Hub and the clients all connect to a couple Pubnub channels to receive and publish commands. There are two channels, one appears to be for the Hub itself and one is for the any commands/events.

When the Windows app connects it authenticates with the Insteon api getting all the info about the account and the devices that are setup. It also makes a call to request the authentication token and the channel names on Pubnub for the specific Hub ID.

The app uses the rest api to subscribe to the two channels get the event status. The events stream seems to show everything the hub does. I paired a mini remote buttons to 4 empty scenes and I was able to see the different insteon events for a single tap, double tap, long press, etc.

Each event in the stream is tagged with a message id which is the epoch timestamp along with a sequential id number. Looking at the history of the events, it only stores the last 100 events. Looking at the stream for the Hub I also saw the history of when upgraded the Hub and the PLM firmware along with the web addresses for the firmware files.

I’ve been playing around with the official API as well which does have an event stream endpoint but I was never able to get it to work properly. Tapping into the pubnub stream I’m hoping to make a smartapp to tie in the insteon devices and provide realtime status for the various devices. This method would depend on still having internet connectivity.

The old local HTTP api on the hub still works for sending commands and getting the bufferstatus so it is also possible to have local commands as backup if there is no network. The api though makes it much easier to discover all the devices and get a realtime status of devices.

Having a lot of Insteon I am wondering if the Smart Things hub could replace what my system is doing for me. I dislike the interface on my Insteon ISY but love the power.

I built a new home about a year ago and put 75 Insteon switched in it. I also have about 10 insteon motion detectors and 12 wall controllers etc. I control this system with the ISY994i device. I can say that it is very (very) powerful. It automates everything and you can build very complex rules. Basically my house “hides” it’s automation from me. If I forget to turn off a light it will turn them off for me. It will turn on the outside lights if it is raining and below freezing so my barn lights don’t overload with ice. It fades down specific lights so I have enough time to move from one room to the other before it goes dark. It sets night lights if it detects motion in certain areas. With that power comes a very clunky interface that runs on Java. It is not for everyone - it’s not even for 10% of the public - but for people that can run it it is perfect once it is set up. It’s hard to explain how these rules work and how complex you can set them - but it is almost unlimited. I don’t have this system tied to a phone app - because much of it is automated - and there are wall controllers everywhere. Insteon hardware has been rock solid (having been a Leviton Green Line switch customer in the last house) over everything else I have tried. I even have custom printed buttons and wall plates so I can hit “goodnight” and my kid’s room will slowly fade the lights after 20 min to a night light level and then turn off in 30 min and not let him turn them back on for about an hour (only on weekdays and skipping holidays). I can double press a button and turn on his WiiU for an hour - Double press another and he gets 2 hours. The lights in the room will flash on and off so he knows he has ten minutes remaining.

I would love an easier system - but still need all the power. I’m not sure if that is possible but would love it. Insteon offers a lot of horsepower in terms of its’ ability to customize - and it integrates with my Elk alarm system giving it the ability to detect many other variables.

Outside of those two systems that are integrated - I have a lot of Lutron Serena shades - nest thermostats - a dedicated Samsung DVR security system - and Big Ass Fans with Sense Me. I’m unsure how adding these systems to my lighting system would improve the overall setup…

I would love to test out another system - but am unsure if I can live with limited ability. From my understanding - The Insteon switches store the information in the hardware and not the hub. The hub acts as a controller for external variables (weather / time / counters / etc.) but the core is stored on the switch side. It also handles all the addressing etc.

It would be awesome to have a SmartThings to Insteon hub LAN interface with full control. Everybody wins.

So I’ve not had time to continue work on this Insteon LAN bridge lately, but here’s a link to my solution. I have a local insteon webservice running talking to a PLM. You need to have your insteon devices linked to the PLM already to use in ST. You can then install the ST app and it will discover the insteon devices for you. Refresh of device status is handled by the local web server. It receives the insteon events and passes them on to ST. This way things are ‘refreshed’ when they happen, not on some schedule.

There’s still lots to do.

1 Like

I was going the SmartThings route because Echo would connect to SmartThings and then I could connect to Sonos and Insteon for voice command. Well Echo now connects to the Insteon Hub directly and it works pretty well. So I’m suddenly good.

subscribed

subscribed

Thanks for sharing this. Have you been able to use the restAPI to get the events? I can only get the device activation events using the restAPI, but not the device on/off events.

Specifically, this is the code (python) that I’m using. I think the problem is that this URL is only good for device activations and not on/off event. The documentation does not mention URL we should use to get events associated with device on/off. If you find out please let me know.

from urllib2 import Request, url open
headers = {
  'Content-Type': 'text/event-stream',
  'Authentication': 'APIKey my_api_key',
  'Authorization': 'Bearer my_token'
}
request = Request('https://connect.insteon.com/api/v2/houses/my_house_ID/stream', headers=headers)

response_body = urlopen(request).read()
print response_body

I’ve had no luck using the steam endpoint at all. I keep getting the same 403 forbidden error when it tries to redirect me. I tried submitting a ticket to the developer portal way back in September but never received a reply. I’ve just been trying it with the Postman app and some other sites though, i’ll give your python code a try to see if I have any better luck.

As a work around I’m looking at sending email alerts to pushingbox.com which can then fire off a HTTP command to an endpoint in a smartapp.

If you are getting 403 it means that your token isn’t right. Trying co trolling a device with your token and API key first t make sure your credentials are correct. I can get streaming to work for device activations but not for on/off events.

I wonder if something is just messed up with my account. So I tested it out again with Postman and was able to get a token and successfully send commands to devices. If i try to get to the activation stream I just get a 403 back.

I tried using www.hurl.it to debug it and it looks like I initially get a 307 where it redirects me to https://clstr01-connect.insteon.com/v1/alerts/stream?insteon_id=(my hub ID) and there I get a 403.

With the response headers being:
Connection: keep-alive
Content-Length: 0
Content-Type: text/html;charset=utf-8
Date: Mon, 30 Nov 2015 17:46:40 GMT
Server: nginx/1.4.6 (Ubuntu)
Status: 403 Forbidden
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block

It’s like it’s blocking me because they didn’t allow cross site scripting. I’m curious if yours redirects as well. I think I may have to contact insteon support and get them to remove the hub from my account and maybe start over.

Hi everyone,
Been working round my house adding everything to zwave and have come across the same problems you guys seem to have been aware of for a while. The fan with a light seems to be the most pesky.

I had an idea (but is a little expensive)…based on the INSTEON fanlinc.

So could we use 1 of these in the wall switch:

Then ‘behind’ the fan add one of these for the lights:

And also ‘behind’ the fan this for the fan:

I know its not particularly orthodox having a switch hidden behind the fan, but I wondered if this would allow a scene control style faceplate switch, that actually controls the fan and lights together. you could either provide always on power to the fan (and use zwave to adjust the fan/light) OR use the scene controller as a master switch to provide an all off.

In the scene control you would then assign:
On - Turn Light ON
Off - Turn Light OFF
Fan Off - Turn Fan OFF
Fan Low
Fan Med
Fan High
All Off

Total cost = $124.80 + tax

Thoughts?

1 Like

Sounds like a nice solution. Yes, a little pricey and more work than this should be - but this is probably the most appealing workaround I’ve seen. Only need to deal with 1 switch in the wall, and one box up in the fan/light - which you;d have to do anyway for a remote. And it’s nice to have all the buttons on the wall. Can always pickup an inexpensive zwave remove as well to keep next to a bed – or an Amazon Dot for the room. Thanks!

I have not been able to find the answer to the one question I have. What happens if I put a micro switch behind an insteon wall switch?
I have two Insteon switches in a box that control my outside porch and garage carriage lights. I like the look and feel of the Insteon switches. But I want the ST control. Is it possible to put a dual micro switch like an Aeon Labs in my box? Yes I could just replace the switches with Leviton Zwave and I probably will. But I have other places in the house where this could be useful too.
Like figuring out what to do about this. http://www.smarthome.com/insteon-2401bt50-popular-50-button-set-for-keypadlinc-white.html?src=Froogle&gclid=CjwKEAjw_ci3BRDSvfjortr--DQSJADU8f2jE4bpBu87BagHZ3BT6LeAVPPnlvPpKE66xLkaDl2LMBoCnsTw_wcB
This controls one light locally and the rest are remote buttons. I want the local to be ST. I want to keep the other 7 buttons the way they are. So could I put a micro switch behind this? My thought is, it should work. But if anyone has tried it, I would love to know before I go through the trouble. Also, is the wiring any different?

Count me in as another person with 40+ Insteon devices, most of which are installed in walls in small (old house) boxes that require small switches. Have both an Insteon hub pro and a PLM. (Using Indigo for controller.) Would love to have all these devices in SmartThings!

Putting a micro switch behind an Insteon wall switch won’t do what you want, which is, I assume, to be able to use either system to control the lamp or device. Your choices would be to either wire them in parallel, in which case you have to turn off both to turn the device off, or you’d wire them serially in which case they’d both have to be on to turn the device on (plus, connected like that, one of the switches would depend on the other for power and wouldn’t even respond unless that switch was on). There’s no way for them to work independently.

@bbruck

I know this is an old topic, but some of you Insteon guys should check out this device type I created

I was in the same boat as you all, many Insteon devices with no ST connectivity. This works with the Insteon Hub 2224 and 2245

1 Like

If only we could get FanLinc support using the PLM…I’d be one happy guy!

I also have way to many Insteon devices to replace and use the ST Hub…

I wish that somebody made a device that would be a bridge between Insteon and Smartthings. Smartthings is definitely a better product with a better future. But for those of us who have a lot invested in Insteon it would be nice if there was some way to use the smartthings controller to control Insteon. I imagine a device which to the smartthings controller would present virtual devices (the smart things controller would think it’s speaking to a Z wave/zigbee device) and the bridge would translate the Z wave/zigbee information and vice versa so that the bridge would be what actually communicates the Insteon devices. The smart things hub would be the Z wave/zigbee controller and it would not be aware that multiple devices it communicates with are actually the bridge which is in turn communicating with the Insteon devices.

I would like to find a small, preferably battery operated zigbee/Z wave i/o device with contact closure outputs that I could wire to an Insteon remote. That way I could use the smart things hub to control my Insteon lighting which is all one large scene. That way I could use the smart things hub now, and as I add or replace items I would use Zigbee/Z wave devices so that way eventually my entire home automation would be Zigbee/Z wave, but I wouldn’t have to change out and trash all my Insteon stuff.