Node-red-contrib-home-assistant-websocket

This has to do with a bug in nodejs. It was fixed in version 8.11.2 try upgrading to node v8.12.0.

Autocomplete is in and working correctly. Make sure you have at least deployed once after adding the server.

Iā€™m not seeing Autocomplete here either. Iā€™m on version 0.1.1 installed on a clean Node Red docker.

Yes that worked. Thanks

Updated to v8.12.0
And still the same errors. I have rebooted the RPi as well.

Edit: I managed to fix it thanks to @jarlave I had to do it inside of the Node Red Docker container console.

Thanks @Kermit

Found the issue. It will be fixed in the next release.

Which nodes were you having an issue with it not showing up? Can you check the call-service node and see if it pops up there?

@Kermit Thatā€™s great, thanks. Itā€™s happening with all nodes. The flows I imported from node-red-contrib-home-assistant are all working fine, but still no autocomplete.

I have tried to upgrade it but it failed:

node-red@52b8f99bbd86:~$ npm install -g n
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm http fetch GET 304 https://registry.npmjs.org/n 888ms (from cache)
npm info lifecycle [email protected]~preinstall: [email protected]
npm info linkStuff [email protected]
/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
+ [email protected]
added 1 package in 3.847s
npm info ok
node-red@52b8f99bbd86:~$ n 8.12.0

     install : node-v8.12.0
       mkdir : /usr/local/n/versions/node/8.12.0
       fetch : https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x86.tar.gz
######################################################################## 100.0%
/usr/local/bin/n: line 590: /usr/local/bin/node: cannot execute binary file: Exec format error
   installed :

Iā€™m running a docker container on a Rock64 (aarch64)

n -a arm64 8.12.0

fixed Exec format error

No I have:

node-red@34dc6f32ba93:~$ n -a arm64 8.12.0

 install : node-v8.12.0
   mkdir : /usr/local/n/versions/node/8.12.0
   fetch : https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-arm64.tar.gz

######################################################################## 100.0%
/usr/local/bin/n: line 590: /usr/local/bin/node: No such file or directory
installed :

I just installed 0.1.2 and autocomplete is working now. Thanks!

Thereā€™s still something weird going on where itā€™s not loading the states on some reboots. Iā€™ll be adding in a more robust check in the future.

Yes I do experience that as well. If you restart HA, states on node-red remain ā€˜disconnected. I had to create an automation to restart node-red when HA starts to avoid the problem.

If you could find a way to auto connect that would be great. Thanks for all your hard work!

Iā€™m having an issue where after my router restarts the websocket is no longer connected.
The mqtt server reconnects but not home assistant.

20 Oct 22:43:04 - [info] Starting flows
20 Oct 22:43:05 - [info] Started flows
20 Oct 22:43:05 - [info] [mqtt-broker:MQTT Server] Connected to broker: mqtt://192.168.1.9:1883
20 Oct 22:43:06 - [info] [server:Home Assistant] New WebSocket https:/*****.duckdns.org
21 Oct 05:32:56 - [info] [mqtt-broker:MQTT Server] Disconnected from broker: mqtt://192.168.1.9:1883
21 Oct 05:33:11 - [info] [mqtt-broker:MQTT Server] Connected to broker: mqtt://192.168.1.9:1883

Looks like node-red never received the socket close from Home Assistant there was a server side bug with this that was fixed in v0.80.1. What version of Home Assistant are you running?

Version 0.80.3
Just got a new router so Iā€™m having trouble figuring out if that is related because it worked fine before. I only have port 443 forwarded to 8123 locally. Is there anything else I should be doing?

Just installed the latest node-red master and looks like everything is staying connected.

I installed it yesterday, but sometimes it disconnects and is not reconnecting.
Informations:
Node : 8.12
Node RED: 19.3
HA: 80.3

Are you using hass.io? What do the logs show?

Iā€™ve refactored the connection process itā€™s live on github.com but Iā€™ll probably not push it to npm until the end of the weekend if you want to give that a try.

I am not using hass.io.
And I will give this a try tomorrow

I just tried to update to 0.1.3 and it failed with permissions errors. Iā€™ve restarted the docker container and it still fails:

Error: SyntaxError: Unexpected token o in JSON at position 0,
Error: SyntaxError: Unexpected token o in JSON at position 0,
29 Oct 11:45:37 - [info] Upgrading module: node-red-contrib-home-assistant-websocket to version: 0.1.3,
29 Oct 11:45:49 - [warn] Installation of module node-red-contrib-home-assistant-websocket failed:,
29 Oct 11:45:49 - [warn] ------------------------------------------,
29 Oct 11:45:49 - [warn] npm WARN checkPermissions Missing write access to /data/node_modules/node-red-contrib-home-assistant-websocket/node_modules/debug,
npm WARN checkPermissions Missing write access to /data/node_modules/axios,
npm WARN checkPermissions Missing write access to /data/node_modules/home-assistant-js-websocket,
npm WARN checkPermissions Missing write access to /data/node_modules/joi,
npm WARN checkPermissions Missing write access to /data/node_modules/merge,
npm WARN checkPermissions Missing write access to /data/node_modules/node-red-contrib-home-assistant-websocket,
npm WARN checkPermissions Missing write access to /data/node_modules/node-red-contrib-home-assistant-websocket/node_modules,
npm WARN checkPermissions Missing write access to /data/node_modules,
npm ERR! path /data/node_modules/node-red-contrib-home-assistant-websocket/node_modules/debug,
npm ERR! code EACCES,
npm ERR! errno -13,
npm ERR! syscall access,
npm ERR! Error: EACCES: permission denied, access '/data/node_modules/node-red-contrib-home-assistant-websocket/node_modules/debug',
npm ERR!  { Error: EACCES: permission denied, access '/data/node_modules/node-red-contrib-home-assistant-websocket/node_modules/debug',
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/data/node_modules/node-red-contrib-home-assistant-websocket/node_modules/debug\'',,
npm ERR!   errno: -13,,
m ERR!   code: 'EACCES',,
npm ERR!   syscall: 'access',,
npm ERR!   path: '/data/node_modules/node-red-contrib-home-assistant-websocket/node_modules/debug' },

I did the update via github-master and it seems to worke pretty well