[AS-IS] Insteon web socket driver

Just had a chance to look at this. My floor lamp with which I’m using Load Sense, in fact does not sync when the light is turned on via Load Sense. I was wrong about that. However, I simply hit my Zigbee button and it brings the light actual state back into sync with Hubitat. Then I just hit it again and I get the result I want. From there on, the light stays in sync with the hub until my Wife turns it off at the lamp switch again. So it needs two presses of my button to bring it back into sync when Load Sense is used.

My lamp module, my micro modules and my wall dimmer on the other hand do stay in sync. There is a maximum of a 6 second delay when physically turning them on at the Insteon device before the Hubitat hub state comes into sync with it, but most of the time the sync is less than 1 second.

1 Like

Thank you for the reply. I don't have any device that uses Load Sense. All my wall dimmers and lamp modules are still not in sync. Is there anything setting I should modify to enable the sync?

Thank you so much! Will install and see. Thank you!

1 Like

Do you get any logs on the hubitat when you are toggling the devices manually?

I would ensure you have all the proper ips and ports entered for all fields in the driver.

insteonserver.js is listening on port 9595. As such, client.js must be modified from

var host = 'ws://127.0.0.1:8080'

to

var host = 'ws://127.0.0.1:9595'

Can someone please update the client.js code on github?

Not following the reason for your request. The port is set to 8080 in my client.js file and everything works. What did you find that doesn't work until you changed the port to 9595?

From insteonserver.js source code on github:

var wss = new websocket.Server({port: 9595})

Thus client.js

var host = 'ws://127.0.0.1:port number'

must be changed to match the 9595.

Recommend modifying client.js code rather than insteonserver.js to avoid conflict with other daemons running on 8080.

Still not making sense to me. Default is 8080, but you can set it to whatever you want in the driver. Mine is set to 8080 in both the client.js, and the insteonserver.js files and all is working.

What does changing it 9595 do that leaving it at 8080 does not?

I know this is as-is, but I'm having some trouble I am hoping someone can help me with. Please be gentle, as I am new to Hubitat.

I am able to get the Node services running, but when I initialize the WS Parent device it does not load the childDevice state variable data, and it does not create any child devices. I only have one device included now, my Kitchen Light, but it's nowhere to be found. Both SSH windows show that the client.js initialization loaded the Kitchen Light data.

Thanks in advance for any help you can provide!

I forgot to add, here is what's included in the insteonserver.js application when the Hubitat hub attempts a connection:

Client connected to websocket
Insteon event listener started...
Websocket closed by client
device info is lightbulb

Check your config.js file. Are they entered as type lightbulb or dimmer? Some have said that it doesn’t populate until they change it to dimmer in the config.js file

Also based on that last post, it looks like you may have an error in the config.JS file. It should not say web socket closed by client

It's possible, but I can't seem to find it. I ran the JSON through a verifier; it's just an edited version of the example that was given.

If the config file were incorrect, would the client.js process load the data correctly?

It usually exits like you see you there. Sometimes with errors sometimes not. If you want to PM it to me, I could have a look for you

That would be really great, I appreciate your help!

1 Like

Ok, I have no idea how to PM you on this board. Sorry, I just signed up a few mins ago, and only got my hub a few days ago. Here's the JSON with the sensitive info removed. Thanks again for your help.

{
"description": "Hubitat Insteon Integration",
"accessories": [],
"platforms": [
    {
    "platform": "InsteonLocal",
    "name": "Insteon Server",
    "user": "XXX",
    "pass": "XXX",
    "host": "172.16.0.192",
    "port": "25105",
    "model": "2245",
    "server_port": "3500",
    "devices": [
      {
        "name": "Kitchen Light",
        "deviceID": "4BC11B",
        "dimmable": "no",
        "deviceType": "dimmer"
      }       
    ]
  }
 ]
}

So when I turned off debug logging, it worked? :open_mouth:

That's weird. I was just about the write that if you copied the insteonserver.js file that I posted at the beginning of the thread, then the server port should be 3000, not 3500. I will change it in the example.

You can make it any port you want, but what is entered into the node.js file must match the port specified in the insteonserver.js file.

1 Like

BTW, it's a dimmable light. Wouldn't want to set dimmable to "Yes" ?

Ah, interesting, I noticed that, but after a cursory scan of insteonserver.js I thought maybe took that port number from config.js. I will make that adjustment, but oddly enough disabling debug logging on the hub device in Hubitat worked and it successfully created the Insteon device. :man_shrugging:

1 Like