The add-on merely runs node-red in a container. It has a preconfigured palette to connect to home Assistant
The ‘node-red-contrib-home-assistant-websocket’ is the palette used in node-red
Because that’s the palette being used by the add-on.
Node-red is really nothing to do with home assistant. It’s a separate project that has been around for years. There just happens to be a way to connect to home assistant and use it. Some of us don’t run hassio, but use node-red to run our automation, so the palette is a way for us to connect them.
Just migrated to it from the llat version…totally painless - all previous flows work fine.
To confirm what I did:
Stop Node Red
cd to the Node Red directory on my box nano package.json
remove the line with the node-red-contrib-home-assistant-llat package, close and save file.
cd node-modules
rm -r node-red-contrib-home-assistant-llat
cd ..
npm install node-red-contrib-home-assistant-websocket
Then reboot. I then created a new access token in HA and everything connected!
The reason I manually removed the old package is that I was having all sorts of issues with files being left behind the other way.
Thanks again and hopefully I am ‘future proofed’ for a while as I know the llat node is not being developed any further.
I spoke too soon. After about 2 hours I get errors:
‘Error calling service. Home Assistant API error’
Reboot and it works for another couple of hours.
I am on HA 0.84.6, NR 19.2 on the latest version of the node. Tried using both access token and legacy password. Running it in a LXC container (not docker). Weird as I saw issue HERE that has been closed but it seems to describe the intermittent issue I had.
Restored from a backup (i just love Linux containers!) and back on the LLAT at the moment. Any ideas?
I misread your post, and outputed msg.payload. At 3 AM, the events just stopped coming in. Nothing in the node-red debug log indicates anything wrong, and nothing in home assistant. I’ve updated the debug print, and added debug logging for homeassistant.components.websocket_api. I hope I can get something good out of that.
Doing a re-deploy seem to wake the connection, and the events come in again.
Will do in a bit. Need to reinstall node again to do this.
I did do it yesterday again and although it worked, it took about a minute for state changes etc - if at all.
A re-deploy got things working again for about 5 mins before it broke. I’ll see when I have time later today to reinstall as obviously troubleshooting without the logs is impossible!
Once I rolled back to the LLAT node all worked fine again and motion sensors etc were instant.
Thanks
EDIT: looking at dlindau’s post - these seem to be the exact issues I am getting. You wouldn’t know there are issues in the UI or in HA…except that nothing is being passed (or if so very slowly) from HA to NR. All node show as connected.
Had it running last night, and the events stopped coming in at 3AM again. The time have given me a clue what it might be about.
I reboot my wifi router every night at 3am, since it has some issues if it runs for too long. Enabling debug logs in HA gave me a lot of stacktraces around that time, but nothing in node-red. So HA seems to get the everything up again, while node-red can’t.
Browsing through the HA logs I can see that a new incoming websocket is set up as soon as the network becomes available again. But node-red is still in the stale mode.
I also realized that I fooled myself earlier. In this stale mode, I can’t trigger anything from my inject-button. Instead I get an API Error. So I think @markbajaj and I see the exact same thing. Earlier I had to do a deploy to get the button up, which woke the websocket up.
I remember reading something about there being some problem with HA restarting, and the websocket became unavailable. Maybe this is the same thing then?
ignore. No idea how I fixed it, but it is working now.
In the process of moving HA to a linux box running on my network and installing NR on a rPi. HA is working fine, and NR is up and running. I installed the Node-red-contrib-home-assistant-websocket, and am attempting to connect to HA with no luck. I enter the HA instance ip address and put in the long lived access token, but I get an error message of “can’t get entities”. I’m running the latest version of NR on latest version of raspbian (no docker or anything). I have the v10.15.0 of node.js. I am running HassOs on the Linux box (Mint), and version 0.84.6 of HA.
One thing that might be going on is that Hass has the NR addon installed. I tried stopping it, and connecting the rPi but that didn’t work. Should I uninstall the addon? Or is there some other issue?
I’m struggling to get the call service node to send the data I am inputting into it to home assistant.
To clarify the system is working as it should afaik. I just can’t get the node to output the data.
I’m trying to get it to call climate.set_temperature with a temperature. I’m sending the required temperature to the node from a thermostat node. The msg.payload is just a number
Not sure what I did but my debug in Node-Red is now filled with
"Home assistant connection failed with error: Connection to home assistant could not be established with config: https://notmydomain.duckdns.org:8123 <password redacted>"
for each variant of the URL I tried… ie 4-5 messages keep spamming in the debug even if I remove the connection, uninstall the contrib etc… anyone know how I can remove it?