Node-RED integration - how it works and why I got tons of authentication error messages

Hello,
I want to inegrate Node-RED with my home assistant installation (via container homeassistant/raspberrypi3-homeassistant)
I easily set up Node-RED running the container nodered/node-red-docker:rpi-v8
Now I was wondering how Node-RED talks with Home Assistant.
My understand is that nodes talk with Home Assistant via api so I need to configure first in HA the http api password like:

http:
api_password !secret my_password_api

Then I need to configure this section in Node-RED:
54

Unfortunately when I did it I started to got a lot of authentication errors on the HA logs coming from the IP of my Raspberry (where I run both HA and Node-RED).

What I am doing wrong?

Thank You

Regards

M.

Which IP did you type in? Or other in which mode is your Node-Red container running? Does it have an own IP? I would suppose that you try http://localhost:8123 if HA and Node-Red are using the same IP and if Node-Red has it own IP you should try the IP of HA instead of “localhost”.

I am running both in a container on my QNAP NAS. Both have different IPs. For me it work well using the IP from HA in Node-Red

Both containers runs in network_mode: host and I set up the raspberry IP where I can reach via http both HA and Node-RED of course on different ports.

My main concern is the authentication errors I got in the logs. Of course I checked twice the api password typed.

Does Node-Red work? It didn’t get any authentication error … So I assume that something is wrong with your setup.

I am using the “node-red-contrib-home-assistant-websocket” addon in Node-Red connecting to HA. But I had to update node.js and something else manually. See: node-red-contrib-home-assistant-websocket

Yes it works.

Mmmm interesting. I’ll do some research about this…

Folks I am having the same issues, I have home assistant and eclipse-mosquitto running using host mode - same ip. I am not able to get the node-red working especially setting up the home assistant server. Please advise.

I solved the issue installing websocket version of HA palette nodes (node-red-contrib-home-assistant-websocket) and using a long term token as authentication method.

1 Like

What version are you running on the docker and can you send me the installation steps. I cant seem to find instructions for node-red installation on qnap online. Where are the folders located for the node-red instance? Some screen shots without the credentials will be helpful. TIA.

I had the same issue and also moved to node-red-contrib-home-assistant-websocket which works great with long term token

Ok, how do you set up the long term token?

In HA GUI clivk on your user profile in the top left, this will open a new page where you can generate tokens and at the bottom the option to generate a long term token.
Agree it’s a bit counter intuitive as it’s under user section and not under the configuration page (which is where I went looking for it initially)

2 Likes

Thank you that worked. pheew! Now on to the next hurdle. Have you guys installed the H/usbzb-1 stick on the QNAP HA. Any pointers/instructions will be helpful

This worked thank you for your help.