SmartThings can take care of all of your Insteon devices as well as your Nest Protect all from one GUI.
You can use the âSmart Lightingâ app to automate your Insteon lights through SmartThings easily. If you want to get crazy, you can download CoRE (Community Rule Engine) and get super granular with your setup, including âIf Nest Protect detects smoke, turn all my insteon switches onâ etc.
You need a SmartThings hub to communicate with all of your devices over various protocols (Wifi, Z-Wave, Zigbee, etc.)
Typically you would have a SmartThings hub to talk to all your newer devices over the various protocols listed above, and your legacy stuff would also work with these custom device types and would be a seamless network of integrated devices.
Great, well getting back on topic, Iâm getting all my devices added.
Out of curiosity, why the need to add the static hub info (address, port, user/pass) on each device? Could I modify the code in my device handler to hard code that info so I donât need to add it for each device?
Itâs just the way the app was built. Quick and dirty. If you really want to dig into the code, more power to you.
Theoretically we could build a parent device handler with child devices but it would take longer to build and I was originally just looking for a quick way to make my insteon devices work.
So Iâve got all my devices added now and controlling them seems to work fine. (Seems to cause Iâm at work but I think the lights are going on/off at home )
The light status doesnât appear to be working all the time though, as others have indicated.
Of the 5 devices I have added, when I turn them all on and the polling refreshes the status 2/5 of them report back that theyâre on on the others report that theyâre still off. (Turning them On in the app, reports them as ON, then back off on the next refresh.)
I know there used to be a way to query individual light status on the old hub but it appears that same method doesnât work on the new one.
Iâm not super familiar with your method of determining on and off in your code you seem to be parsing and mapping the buffstatus.xml for a light?) but is there any way I could help you figure out a fix?
@benjgott Yep, you got it - you send a command to the Hub to request the status of a device. The Hub then writes the device ID and status (along with a lot of other stuff) to buffstatus.xml. The problem is that as soon as another device requests status, the buffer (buffstatus.xml) gets overwritten. Sometimes you can even catch âoverlappingâ buffers. SoâŠif you have a lot of devices, it may be more difficult to reliably get status. Unfortunately, this is a limitation of the Hub and I donât know that thereâs a way around it. Maybe someone more creative can come up with a better way of getting status for multiple devices. I was lucky enough to get an API key and found another smart app on here that works pretty well, but I donât think that Insteon is quite as generous with developer keys anymore. I would prefer to have local control anyway, and not rely on a could solution.
@benjgott The original smart app and DTH was done by @hypermoose (canât find the original thread). It only supported switches, so I updated it to support dimmers. There was also a bug in the status polling that caused it to quit that I fixed. Iâve uploaded the smartapp and DTH here:
I actually came across hypermooseâs old thread yesterday after you mentioned the other project, got it working with my switches and then spent the better part of the afternoon mucking with the code to get dimmer support added for myself but had some issue with my code that I hadnât figured out yet.
Just added your code and everything seems to be working so youâve saved me the time and energy to get mine working. (At some point Iâll compare your modifications to the ones I made to see where I went wrong.)
Any future modifications or additions to these apps/handlers you have in mind? Iâd be happy to collaborate or help out if youâre interested.
@benjgott I havenât had much time lately to mess with it, but you may have noticed that I started to add IOLincs into the code. I at least was able to get them discovered during the initial setup, but didnât get much further than that. Happy to collaborate on any updates/features!
I finally got around to updating the Hypermoose dht and sa to your modified versions. They work, but when I set to ârunEvery1Minuteâ it stops updating. Is there something in the Insteon API that prevents more often updates? Line 338 was all that I changed. Manual refresh works great though.
@michaelahess Status updates using the Insteon API are a two-step process. First, you request a link ID for the specific device that you want to get the status of. You make a second request using the link ID to get the actual device status. The link ID (from the first request) also has an associated status, either âpendingâ or âsucceededâ. By default the initial link status is pending and you need to make requests until the status is succeeded, at which point the returned message contains the actual device status. The âpollChildrenâ function requests the link ID and then 60 seconds later checks the status of the link ID (via âcheckPendingRequestsâ). Without actually trying it myself, my guess is that because you are running âpollChildrenâ every minute you are never getting the actual device status back before you run another poll. You might try increasing the time between polls (line 338) or decreasing the delay before it requests the link status (lines 403 and 474). In reality, it doesnât take 60 seconds for the link status to change to âsucceededâ so you should be ok with something shorter.
I edited that, but now manual refreshes donât work at all. Iâve published the original SA you posted and itâs acting fine, but the deviceâs keep erroring like this when a poll or refresh takes place:
8c9cdc2b-831b-4437-9969-6e49460b4487 9:08:17 PM: error groovy.lang.MissingMethodException: No signature of method: script14963507835551845807638.generateEvent() is applicable for argument types: (java.lang.String) values: [{level: 0}]
Possible solutions: generateEvent(java.util.Map), createEvent(java.util.Map) @ line 496
I see that line is what receives the status from the parent app, I think. My networkid matches, nothing seems to have changed there. Any thoughts on what I broke?
Hi there. Great that you fixed the bugs. What was the core issue if you dont mind my asking I saw you changed one of the retry variables to create a new scope and commented out an if, but wasnt sure where it went wrong. thanks
@hypermoose First, let me say thanks for putting together the smart app - works very well and certainly not something that I could have done myself! I think that the key change to the smart app was commenting out the test to see if pollData was null. Its been a while since I debugged it, but after the first poll, pollData was never null so it never requested status from Insteon beyond the first update. Removing that test seemed to make everything work. The only other changes were to add dimming capability and reporting of level. I attempted to add IOLinc support as well, but couldnât get the discovery to work properly.
Hi all, Iâve updated the Insteon Connect smartapp to support IOLinc devices as well as scenes. In addition, I reworked the status polling code so that its a little more robust. One thing to note with this release is that the code no longer assumes that the device went to the commanded state. It will now update the status on the next poll. The mechanism for status update was probably just fine for lights, but adding IOLincs (used with a garage door) requires positive confirmation that the door went to the commanded state. If you want immediate updates to the commanded state, you can just uncomment lines within the âswitchOnâ or âswitchOffâ commands (I didnât change the level command as it isnât used by IOLincs). Scenes are on/off only, and the API doesnât provide any way of getting status, so for now its simply a toggle. Dimming of scenes doesnât work (yet). @michaelahess this update should solve the problem you had with polling every minute. Took a bit to figure out, but I think its fixed now.
I have the 2245-222 hub and have tried installing the smartapp. I pushed the smartapp to my device and the three device handlers. When I added the smartapp to my SmartThings app, the app just shows a spinning progress bar that spins endlessly. I let it spin once for over 20 minutes and it never did anything. Eventually I quit the SmartThings app itself and when I reopen, it shows that the Insteon (Connect) app is installed, but when I click on it, it spins for a second and then goes back to the main smartapps page⊠Has anyone else had any issues installing this?