[AS-IS] Insteon web socket driver

using netstat -an (in cmd) i don't see any ...when i use a online port checker it says its "closed"

Restart the pi. Try again for me.

1 Like

For screenshots.

something definitely happened!!! but i don't think i'm quite there yet ...insteon sever is now listening and has all my devices listed with a "isbutton undefined" added, but on the client it says connected to server then list in a non-wordwarp form of my config text of devices with a open cursor prompt ...is that correct? just want to make sure before moving on to the next step i'm double checking my config text right now

it looks like its something not closed right after "devices:" ...here's a picture of my config with the example config over top and my client

1 Like

That’s looking normal now. Go to the parent driver On HE, and ensure all the details are entered. Click Save Preferences, then scroll down and click Save Device.

Click Initialize and you should see connection: Connected under Current States

Under State Variables, you should see child devices: [followed by all your device IDs you entered in your config.json file]

Go back to your devices list and you should see your parent Insteonws driver, with all the child device drivers nested below it, having the names that you gave to it in your config.json file.

Looks like the config file is misformatted. Could be the example is bad in my repo. I quicklybuodated and did not double check it.

Edit. Try what @SmartHomePrimer suggests and report back.

OK i got it to initialize an connect but the device ID did not pop up and switches don`t work

Client.js is running? Have to have it running or the device IDs will not be discovered. Can you PM me a screen shot of the parent driver details?

Push the initialize button in hubitat. Then show me the output from the insteon server on the pi.

Settings look OK, but the ws client keeps trying to open the connection, and it's being closed by something. Looks like it could be a port conflict. My example shows port 3500 because for me, that's what doesn't conflict. Can you instead try 4000. As Chris said, you may have to restart the Pi to get that change to take effect.

I think there is a problem with the config file myself. To avoid confusion though I am going to bow out and leave you in @SmartHomePrimers capable hands.

1 Like

Quitter! Haha, just kidding of course! :wink:

Hi all,
I haven't posted here before although I've been reading, learning and using Hubitat for several months now.
I have a lot of Insteon devices so I'm very interested in working with and helping to debug/test this web socket driver. I have all the hardware installed and working (the 2245-222 Hub, a Raspberry Pi w/ the node.js, insteonserver.js and client.js, and of course, Hubitat). I have 3 devices currently defined in the config.json file - 2 dimmable switches and 1 non-dimmable switch - all have the deviceType of 'lightbulb' per the example in this thread.
I can control the devices just fine from the Pi and from the Insteon Hub. I have added the Parent and all the child device drivers to my Hubitat, and I've created the Parent device.
I turn on debug logging and click Initialize - I get a good connection and am able to see the devices listed in the logging, but no child devices are added to the Child Devices state variable and I get the following error:

com.hubitat.app.exception.UnknownDeviceTypeException: Device type 'null' in namespace 'cw' not found on line 274 (parse)

Looking at the code, it is clear that device type 'lightbulb' is not known (I removed some logging):

def createDevices(msg){ msg.each { it->
    namespace = "cw"
    if (it.deviceType == "motionsensor") {type = "Insteon Motion Child"}

if (it.deviceType == "contactsensor") {type = "Insteon Contact Child"}
if (it.deviceType == "dimmer") {type = "Insteon Dimmer Child"}
if (it.deviceType == "leaksensor") {type = "Insteon Leak Child"}
if (it.deviceType == "scene") {type = "Insteon Button Child"}
if (!state.childDevice.contains(it.deviceID)) {
log.debug "creating device: ${it.name}"
addChildDevice (namespace, type, it.deviceID, [label: it.name, isComponent: false, name: type])

So the 'type' variable is left null -> hence the error message.
I would just use device type 'dimmer' instead of 'lightbulb' but when I look at either the WS Parent or the Dimmer Child code I don't see where the 'dimmable' property from the config.json is used so that non-dimmable switches are not going to be treated differently.

Should there be another child driver (Insteon Switch Child) along with a 'switch' device type?
I can add that new child, make the corresponding changes to the parent code and test it, but I thought I would specify all this here in case I'm missing something obvious (er, to everyone else but me).

Thanks to all of you - especially @cwwilson08 and @SmartHomePrimer!

1 Like

Thanks for testIng. Maybe @cwwilson08 can comment on the error. I’m away from my hub at the moment, but don’t recall seeing those errors. The device type lightbulb is defined as a case in the Insteonserver.js file. It was added by Scott Keuster who wrote the Insteon Server portion, or it may be from the original work done by the guys that wrote the homecontroller portion.

This has nothing to do with our child devices in HE. It’s only important to the Device definitions in the config.json file. While there are types “dimmer”and “switch” as well, I’ve found that they make no difference to our child device. We define switches by Fast ON / Fast OFF, although even that is optional. A switch acts as a switch regardless of the setting.

If I recall correctly, you will get an error in the HE log if you do not have Fast ON set in the child device driver and try to send a value other that 0 or 100 to a switch.

Thanks for your quick reply. I got real fancy and created a Insteon Switch Child device, changed my config.json to use 'dimmer' and 'switch' types, then modified WS Parent to recognize 'switch' device type and added the needed function calls. It did not work!
Seems that 'switch' is a type with special meaning in the insteonserver.js file.
So I backed out all of my changes to the device drivers and made all of my device types in config.json 'dimmer'. Now it is working correctly and I've made sure the Fast On/Off setting reflects whether my device is dimmable or not.
I do still think that the config.json example is not correct: 'lightbulb' should be 'dimmer'.
Thank you very much! I'm up and running and will now expand to some other devices.

Then what should an Insteon lightbulb be? Really it’s the same for our use, regardless of whether it is defined as dimmer or lightbulb.

@ja_moses Back at my hub. I don't have the error you see. My WS Parent file differs from yours, since line 274 is a commented out line in my WS Parent code. If I recall correctly, I'm not using the WS Parent code for the keypad, because I don't own Insteon keypads. There was some reason that it worked better for me to use the code the proceeded the Insteon Keypad support. Sorry, it's been a while and many other projects have filled my brain since then.

If you're still getting the error, could you please post your config.json file here, with personal data redacted

[Edit] - Just looked at some of the early conversations Chris and I had when he was first creating the new drivers based on websockets with the Insteon Server, rather than the previous version which ran inside of Homebridge. Originally, there was only type lightbulb. Later Scott Keuster added dimmer, switch, motionsensor and leaksensor to the Homebridge plug-in, which was named Insteonlocal. If I specified an outlet for example, and I had a lamp plugged into that outlet, then in HomeKit, the icon showed up as a switch instead of a lightbulb, and I didn't like that. Hence I used lightbulb and soon discovered, it made not difference to the functionality. So we decided to simple have the child device type dimmer, as it didn't make a difference for switches.

I also double-checked and my recollection was incorrect. I doesn't matter if you send a value other than 0 or 100 to a switch or non-dimmable outlet. The device simply doesn't react and no error is generated. This may have been an issue we found during development and Chris fixed it, but I just cannot recall. So for a switch or non-dimming outlet, even the Fast ON/ Fast OFF definition doesn't matter. We cannot effect ramp rate from the driver, but you can set them in Insteon Scenes, and then call the scene from the Button child device. But of course, ramp rate for a switch or non-dimming outlet, does not exist, so a separate child device driver for switch or non-dimmable outlet is unnecessary.

@ja_moses Do you own keypads? We're really interested in further keypad testing. We will make the necessary code available to you via private message if you have keypads and are willing to do some testing for us.

@SmartHomePrimer It is working for me with that change of deviceType to "dimmer", but for completeness of discussion, here is my test config.json (x'd as needed)

"description": "Hubitat Insteon Integration",
"accessories": [],
"platforms": [
"platform": "InsteonLocal",
"name": "Insteon Server",
"user": "xxxxxxx",
"pass": "xxxxxxx",
"host": "192.168.xx.106",
"port": "25105",
"model": "2245",
"refresh": "300",
"server_port": "3000",
"keepAlive": "3600",
"devices": [
"name": "Bedroom Lamp",
"deviceID": "1896E1",
"dimmable": "yes",
"deviceType": "dimmer"
"name": "Spotlights",
"deviceID": "1CAE42",
"dimmable": "yes",
"deviceType": "dimmer"
"name": "Bedroom Fan",
"deviceID": "207C53",
"dimmable": "no",
"deviceType": "dimmer"

I do hear you say

The device type lightbulb is defined as a case in the Insteonserver.js file. It was added by Scott Keuster who wrote the Insteon Server portion, or it may be from the original work done by the guys that wrote the homecontroller portion.


This has nothing to do with our child devices in HE. It’s only important to the Device definitions in the config.json file.

But on this last point I must respectively disagree. In the WS Parent (and I'm using the code from @cwwilson08's Insteon-Hubitat GitHub), where I have added debug logging, the deviceType from the config.json is directly read into the it.deviceType variable inside the createDevices method (currently lines 262 - 280). This is the code I quoted in my prior post where the code looks for deviceTypes "motionsensor", "contactsensor", "dimmer", "leaksensor", and "scene" - but that's it - any other value leaves the type variable as null. A null type leads to the UnknownDeviceTypeException when the call to addChildDevice is made (currently at line 274). So whatever the deviceType is in the config.json, there must be a corresponding test/assignment in WS Parent.

But as I mentioned before, changing my config.json to use deviceType "dimmer" has worked for me. I think we should resolve this so that the example config.json is correct for future users. I'll leave my setup as is unless @cwwilson08 or yourself say otherwise.

Thank you for the additional info regarding Fast On/Off - I won't consider it a requirement.

I DO have one 2487S keypad switch - I don't currently have it installed (as I've just moved to a smaller place and it is isn't needed as much) but I will install it and happily test it out if you want to send me the code I need.

Thanks again.

1 Like