[SOLVED] Hassio and Node-RED in different Docker containers, error "Cannot GET homeassistant/entities"

Hi all

I’m trying to install Hassio in a Ubuntu server environment with Docker (I just followed this guide) and I would like to have Node-RED in another container, not as an addon.

So I installed also Node-RED and then installed Portainer to have a management GUI for Docker.

I downloaded the Node-RED node-red-contrib-home-assistant and tried to add the HA server using http://hostIP:8123 and the API Password.

But I get the error “Cannot GET homeassistant/entities”.

I’ve tried, one at a time, all the nodes available for HA, using API password or Long Lived Access Token, but I’ve never succeeded.

55

If I open a console within the Node-RED container and try to telnet the host IP address (the Ubuntu Server one) and the HA port 8123, all is ok.

So from Node-RED I should see HA, but not within the HA node.

What else can I try?

Thanks

you need to use the websocket version. That is the only one that works properly.

Use a token and it will work

Thanks @flamingm0e

You mean the Long Lived Access Token?

Yes. You can create one in your user panel on HA gui

Just tried and it’s not working.
When I create the server connection, after confirming and deploying, when I enter again in the server configuration Base URL and token are gone.
I tried also creating a new server, but no news.

I haven’t selected “Use Legacy API Password” and “Accept Unauthorized SSL Certificates”.

You don’t want to use Legacy API Password.

Are you using SSL on your HA?

No SSL, I’m actually testing, so it’s a new fresh Hassio installation, with very few entities and no addon.

I get also this error

42

and

55

After entering the Base URL and access token, and deploying, I always get this
52

Make sure you only have ONE of the home assistant nodes installed, the websocket one.

Absolutely, only the websocket…

@Kermit, any ideas?

Try using 127.0.0.1 instead of localhost, or the actual IP address.

Try clicking the “I use hassio” setting

He’s using docker, and hassio, but not an add-on. His IP address would be that of the host machine, and not localhost or 127.0.0.1 since inside the docker container, it would be referring to itself.

Thanks for clarifying. Therefore the setting he has on http://localhost:8123 should be changed to http://192.168.1.100:8123 (or whatever the machines lan ip address is).

Am I correct?

Yes, but he isn’t using localhost according to what I’ve read.

Well that is what his config above says.

That’s not his config. Those are the default markers in the node config. “suggested values” of the text boxes

I didn’t ask, but which node-red docker image are you using? You need to make sure it’s node-V8

1 Like

Yes, the errors are from not using v8 version of the docker image.

1 Like

Here is my config.

My Ubuntu server has IP addr 192.168.1.126 and I thought that using this address within Node-RED to refer to the Hassio container was right.

My telnet test is with this address.

I tried also to use the internal container address starting with 172.xxx.xxx.xxx, but no success.

When I save the HA server info in the node, I get

51

The I make a Deploy, but when I go back to the HA server config is empty.

Have you started using the node v8 docker yet. This worked for me

docker run -it -p 1880:1880 --name mynodered nodered/node-red-docker:v8