Node-red-contrib-home-assistant-websocket


#41

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


#42

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


#43

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


#44

Yes that worked. Thanks


#45

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


#46

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?


#47

@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.


#48

I have tried to upgrade it but it failed:

[email protected]:~$ 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
[email protected]:~$ 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:

[email protected]:~$ 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 :


#49

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


#50

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.


#51

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!


#52

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

#53

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?


#54

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?


#55

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


#56

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


#57

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.


#58

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


#59

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' },

#60

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