Hassio with SSL and Node Red

Hey Guys,

I got Hassio with the DuckDuckDNS addon and it it’s running fine for me. I can access my Hassio setup via SSL, like it should be the case.

I wanted to give node red a try. The installation went fine and I also can access the node red web interface.
But I’m struggling with connection between Hassio and node red. I always get the error:

Cannot GET /homeassistant/entities

In the reddit thread :
https://www.reddit.com/r/homeassistant/comments/7c5v63/anyone_else_using_nodered_with_home_assistant/

it is mentioned that node red can’t connect to Hassio via SSL.

Is there a possibility to configure hassio that I can access the web interface over two different ports.
Once with SSL and once without ?

Thanks

Hey,

i just set it up for me today. I had to use hassio name instead of ip. After that it worked.

BR

Lukas

Hey Lukas,

you mean the duckdns url right ? I tried this to but it also wasn’t working.
On top I would still prefer that every request would not go over the internet.

I hope there is still a way to get Hassio accessible over two ports or something similar.

Greetings

If your router doesn’t handle NAT loopback in a way that works for you, you could look at changing how DNS resolves in your setup. You could setup split DNS or a hosts file to make DNS resolve your duckdns name to your private IP.

Another option, which is simpler to setup on hassio, is to install Nginx addon to handle SSL then point Node-RED at 8123, which would not have SSL enabled.

Hey NotoriousBDG,

Thanks a lot. If install Nginx addon. Do I have to disable letsencrypt then ?
Since letsencrypt uses the standard port for ssl.

Greetings,

Nope. You just disable ssl in Home Assistant config then install, configure and start the nginx add-on. Nginx will provide ssl on port 443 while Home Assistant is still available on port 8123 without ssl. Nginx uses the same cert that Let’s Encrypt creates.

Thank you. I tried to disable ssl by removing the following 2 lines from the configuration:

  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

and adapting the the base_url configuration to:

base_url: http://my-domain.duckdns.org:8123

But now the webinterface isn’t starting anymore.

Do you mean Home Assistant’s frontend, or Node-RED’s web interface?

The Node-RED interface is still working, but the Hassio isn’t starting.
The log file is spammed with the message:

2017-12-20 08:34:50 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 271, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method

I don’t have base_url defined in my config. I wonder if removing that line will help?

When I recently disabled SSL on my hassio, my log was also filled with these errors. The difference is that I was still able to access the frontend. For me, the fix was to change "ssl": true to "ssl": false in the configurations of the addons that had that field.

Being that you don’t have frontend access, maybe you can change the addon configurations via SSH? I’m not sure, though, so someone else will have to chime in on that.

Thank you guys. Removing the base url did the magic.
I can access the Webinterface again and Node Red can connect to it.

Greetings

1 Like

I’m trying to get this to work as well, but with Caddy instead of Nginx, I have “a.duckdns.org” pointing to my hassio frontend and “b.duckdns.org” pointing to NodeRED, I am able to access both services through those urls, but when I use “a.duckdns.org” as the server base url in NodeRED I get the

Cannot GET /homeassistant/entities

I’ve tried using localhost:8123 as the base url with no luck. Any ideas?

Apparently it doesn’t connect until the flow is deployed, all is well now.

3 Likes

my conifguration.yaml has only
http:

but when I click on START in the NGINX addon, nothing happens (I forwarded port 443 to 443 of the IP of the NUC that has HASSIO)

You’d have to look at the logs to see what’s going wrong. BTW, that should no longer be necessary to do now that hassio supervisor 0.78 has been released. You can just configure Node-RED to use http://hassio/homeassistant as the Base URL now regardless of whether you have SSL enabled or not.

How you configure this?

{
“ssl”: false,
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”,
“users”: [
{
“username”: “admin”,
“password”: “password”,
“permissions”: “*”
}
],
“http_node_user”: [
{
“username”: “admin”,
“password”: “password”
}
]
}

https://github.com/notoriousbdg/hassio-addons/tree/master/node-red

Ok, I installed all.

Now what do I have to change my configuration and leave only the below code?

http:
  base_url: http://hassio/homeassistant

It’s not referring to base_url in Home Assistant configuration. If you install node-red-contrib-home-assistant in Node-RED, then you can use http://hassio/homeassistant as the Base URL for that node.