[AS-IS] Insteon web socket driver

OK. I'll dig up the code needed and send later today when time allows. I appreciate the offer on the keypad. If you can test under real scenarios you used before that would be most helpful. Both Chris and I have tested under mock setups with the 2334-222 8 button dimmable keypad, but with neither of us being regular Insteon keypad users, (Chris not even a regular Insteon user) it's difficult for us to find the gaps or errors if they exist.

I'll let Chris respond further on the null type you're seeing. I'm not able to duplicate that issue when I enable debug logging. All my devices, except for my leak sensor and contact sensor are set to type lightbulb.

1 Like

Yes I just I have not gotten to creating the code for the swtich.

This is error is as @ja_moses - I could likely make the code respond to both lightbulb and dimmer.

I have been procrastinating working on this code. I pulled my head out of the rabbit hole that is hubitat for a short time. I will get back to it soon..

Please do continue to test and let me know of any issues.

1 Like

Hola @SmartHomePrimer - Not sure if you had a chance to review/send out the code needed to test the Insteon keypads, but I haven't seen anything. Let me know if you sent something that I can't find or if you need a bit more time. Thanks

The code in my github should allow the use of keypads.

What versions of Nodejs and NPM are supported in this? I have tried with multiple versions of each and 2 different Linux distros. I am attempting to set this up thru WSL - Ubuntu 18.04 LTS or Debian. On each I have used the distro packaged versions and seems a good deal of dependencies fail.
U1804 vers = Nodejs v8.10.0 , npm 3.5.2
Deb vers = nodejs v10.15.2 , npm 5.8.0
I can strip either of these down and reload fairly quickly whichever versions work, but don't want to Trial and Error thru all the combos.

Further, I wanted to sandbox this out before putting on a pi that has been waiting for a new task. Or just see if this might be a good fit for a simple WSL.

What versions of Nodejs and NPM are supported in this?

I recently went through a complete re-installation. I'm currently running Raspbian GNU/Linux 10 (buster) with Nodejs version 10.16.0 but I had to downgrade NPM to version 4.6.1 to get the installation to complete successfully. I tried multiple newer versions of NPM and just kept getting an error "too many symlinks..." or something like that.

I'm going to throw a note in here … I got this up and running the other week and so far its been 100% stable. I got installed on an Ubuntu server VM.

I ended up using Nodejs version 10.16.0 and NPM version 4.6.1 as discussed above, anything higher than that threw lots of errors. Even these versions threw some deprecation warnings while I was getting things going.

A high level comment for anyone else that goes down the same path (and opts against running this on a Pi) …
Nodejs installs everything as user 500, but UIDs start at 1000 on Ubuntu .. so once it was installed, I had lots of access errors until I figured out what was going on. Once I chown'd everything to my user, everything went much better.

1 Like

Thanks for the notes. I hope that helps someone else who might opt for an Ubuntu install instead of Raspbian or MacOS.

When you're a new user, you cannot post images. That restriction is lifted after a while. I don't recall what the criteria is that lifts it. I think it's just time.

Anyway, since there's several different platforms, not all the node and npm versions will work. You probably need to install an older version, just like @kitt001 noted in his post above yours.

I run mine on a Mac, so the node versions I needed to use are differnt than what will work for other platforms. I'm running node.js 8.11.3 (and my reasons for that are concerning other node applications that are not compatible with later version of node.js). I'm also running npm version 6.14.4.

You can install a specific version by adding @ and the version number.

So for example, if you type sudo npm@6.14.4 -g install, you will get that version of npm. You can check version with -v. So if you type npm -v it will show you the version installed on the next line. Same with node.js ,just type node -v to see the installed version.

Hope that helps.

2 Likes

Hi there, thank you for your reply. I rolled back to older versions and it seems both insteonserver.js and client.js are up and running without error message. I created the parent device in HE, clicked Initialize, and get the status Connected.

All seems fine except no child device shows up:

State Variables

  • childDevice : []
  • reconnectDelay : 1

I went back to check the installation of client.js. It shows "Connected to Insteon Server", and then the info I entered in config.json appears sequentially without any issue. And then the same info repeats itself, but with "state":null appended at the end of each device.

Any idea what's the issue and how to fix it? Thank you for the effort making this drive and sharing it for free! Really appreciate the work of you.

1 Like

Any errors in the logs?

1 Like

I’m on vacation and away from my system. If you don’t mind, Send me your config.json file via PM, maybe I could spot an issue there if one exists.

It’s been quite sometime since I’ve added anything new, so it might be something I’m forgetting. I’ll look back through the thread and PMs with others that have had issues and see if anything jogs my memory.

But I’m moving slowly as one should on vacation. :wink: It will take me some time.

1 Like

Thank you for your reply. I reached my reply limit (as a new user) and had to delete a previous post and wait for 24 hours to write another reply.

I checked the log and found the problem was the device type "lightbulb." I saw others discussed the issue in earlier posts so I changed the device type to "dimmers" and then things work well. This is great! I am so happy it is up and running. Thank you for making this very useful drive!

I have a few more questions:

  1. when I add more devices in the future, do I need to delete the parent device from HE and rerun insteonserver.js and client.js?
  2. I notice the on/off state is not synced. I manually turned off a switch but the device status in HE still shows "on." Any chance these changes can be synced?
  3. Is it possible to add the mini remote to the device type? I thought it was similar enough to the keypad so I used the "scene" device type. Obviously it didn't work. Would appreciate if mini remote is added as a child device.

Again thank you for making this drive!

Hi there.

  1. You should be able to add the devices in the config on you node server. Then save prefrences 8n the parent device should create the new children.

  2. It has been a while since I had this loaded but seems state should be syncing from manual controls. @SmartHomePrimer is that what you see?

  3. The keypad driver needs work. I purchased one. The driver mostly works with some quirks. However support for any other devices will be beyond me as I do not have them. Atm all my insteon stuff is in a box.

This effort was really geared at helping a friendly member of the community and me learning stuff. In the end and we decided to post the code in case it may be useful to others.

Updating the node server to be compliant with newer node versions will be beyond my ability.

2 Likes

I’m on vacation. I see nothing :slightly_smiling_face:

Been some time since I added anything to my system. I can test in a week. :sunglasses:

Lol no worries. Figured you might remember if you got real time updates from physical interactions.

Enjoy the vacation.

@cwwilson08 @SmartHomePrimer Thank you both for answering my questions. (Again I had to delete an earlier post and wait for 24 hours to post this reply).

It will be great if @SmartHomePrimer can help test whether state sync works or not. Will you also be able to look into adding the Insteon mini remote? Would like to use the mini remote to control my other devices, if it can talk to Hubitat.

Another question: I am currently running the websocket on my Mac. Do I need to keep the insteonserver and client terminal windows open all the time? When I restart the Mac, do I need to rerun everything? Would you recommend using Raspberry Pi rather than Mac?

Thanks! (I hope my new user ban can be lifted soon so I can post more timely).

1 Like

The state does stay in sync, but it takes a few seconds. There are very few occasions where I physically control my Insteon devices anymore. I have Pico remotes and Zigbee remotes around my house for control. I only have one Insteon wall dimmer mounted, the remaining are used (rarely) as switches for other devices by utilizing Fast ON.

The only place I would possibly notice it not working would be our floor lamp connected to an outlet that has Load Sense enabled. My wife frequently uses the switch on the lamp, and I can still turn it off via HE, so it would have to be working to do that.

You do need to keep the terminal windows open for the server and client. This is needed for sync and for Insteon input devices like contact and motion sensors. If it’s not a dedicated Mac, then you can just minimize them. You will need to restart them when the computer is restarted. Maybe there’s a way to auto start it, but I’ve never pursued it because I run mine on an old MacBook Pro dedicated to running Insteon server, Homebridge, and other node.js applications. I also use it for an easy headless server I can access from my MacBook Air, and it runs TeamViewer so I have a simple and secure remote admin access to HE. The MacBook Pro is on a UPS, so the number of times I can recall needing to restart it in the last few years is around three (one for an extended power outage and twice for OS updates).

I highly recommend using a spare MacBook for this purpose because of it’s secure (as long as the OS is not too old to receive security updates), and no additional investment needed. A spare desktop Mac? That’s a question of how much power you want to pay for. My MacBook Pro uses very little for what it’s doing with no screen active, but a desktop or iMac (depends on age) can use quite a lot of power while idle.

1 Like

@SmartHomePrimer

My devices' states are not synced, even after hours. Please see the attached screenshot (finally able to post pictures!) The switch was physically turned off last night and has not yet been physically turned back on. Yet the status still shows "on." Is there any parameter I should change to enforce the sync?

There is no rush to reply -- I know you are on vacation! Thank you!