Home Assistant Community Add-on: Node-RED

IMHO, best solution is to move NR to another pi. I know its add money, and takes some effort, but in the long run is working MUCH better than having to deal with these connection problems. And NR is much responsive, and it starts way faster, maybe 30 seconds.

The only other solution that worked for me was restoring a backup that was against an older hassio that worked with NR.

I hear you. I look at how you implemented NR on a seperate server and noticed you implemented a previous version of Hassio. I think the issue is the implementation of the communication between NR and Hassio supervisor. Something changed because there is no reason why Hassion shouldn’t recognize the direct http address or the http hassio alias.

I’m certain at this point I can use any hassio version I want. I think I upgraded a week hassio or so ago.
Where does the hassio version even show up? I dont’ remember :slight_smile:

I have no idea why, but when they were are the same pi there was something causing the communication problem that goes away when you put node red on a different pi.

OK, I upgraded tonight to the latest verion, 77.3, and connection is fine, no problems upgrading at all. I had been running 76.2, which probably would have caused me problems if running NR through hassio.

There must be a connection difference. I connect through http, and with hassio I have no idea how it is connecting.

BTW, for “kicks”, I stopped NR on the pi, and reinstalled hassio NR and tried that. Started it, but it complained about passwords and certs. It did come up, and the HA nodes said connected, but they didn’t act like they were connected, no response. And everything is much slower running like this. I tried to delete and make a HA node again, but it crashed my pi when I deployed this. I restarted the PI, HA and NR, but couldn’t get NR to talk to HA even though I didn’t get any connection error messages.

After about an hour of “fun”, I gave up. Restarted HA and uninstalled NR from HA, then restarted NR in the other pi. Everything works again, back to normal.

With that, I will stop talking about using another pi for NR, the horse is dead.

Randy

I ran in to an issue with connecting and I cannot find anything on this issue. Sounds similar with NR 0.6.1 with Supervisor 130 and HA 0.77.3. Well two things. First, I can longer resolve the api.pwnedpasswords.com which isn’t the end of the world but it seems strange. I have pihole running but it wouldn’t block that site, I whitelisted it anyway and still exists. That is probably something I can figure out though but if have suggestions I’d appreciate it.

Second, I can’t get NR running at all. I have all of my user/passwords and even a different one for each in the configuration. The error really doesn’t seem obvious like others I’ve seen. Hopefully someone else can see something familiar.

curl: (6) Could not resolve host: api.pwnedpasswords.com
DEBUG:
000
ERROR: Something went wrong contacting the HIBP API
WARNING: Could not check password, assuming it is safe.
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 11-warning.sh: executing…
[cont-init.d] 11-warning.sh: exited 0.
[cont-init.d] 20-config.sh: executing…
[cont-init.d] 20-config.sh: exited 0.
[cont-init.d] 30-auto-api-token.sh: executing…
parse error: Unfinished string at EOF at line 1, column 24576
[cont-init.d] 30-auto-api-token.sh: exited 4.
[cont-finish.d] executing container finish scripts…
[cont-finish.d] 99-message.sh: executing…

            Oops! Something went wrong.

We are so sorry, but something went terribly wrong when
starting or running this add-on.

Be sure to check the log above, line by line, for hints.

[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.

The first line is the reference to failing the pwned checks. At “Oops!” I can’t figure out what the error is at all. API Token related maybe? Thanks for any help or ideas.

Regarding the “Could not resolve host:”, that’s a known ‘issue’. Do you happen to have set that dns server on your router?
Other add-ons can’t use the Pi-hole add-on as dns server. You’ll need to set a different dns server on your Hass.io install.
Info on how to do it can be found here: https://github.com/home-assistant/hassos/blob/master/Documentation/network.md

It could be fixed by going into the PiHole Settings - - > DNS tab and select "Listen on all interfaces, permit all origins. Not tested it myself so might not work.

That makes perfect sense now. That issue resolved. The 30-auto-api-token.sh parse error is the only issue. Is this the best place to post for assistance on this issue?

Guys, when you are getting this problem with “password redacted” its properly because you are using the inbuild git projects that node-red haves, you need to disable that, because it breaks the API handling, so go to your Node-RED settings.js file and change the following settings, last in the file from:

editorTheme: {
       projects: {
           enabled: **true**
       }
   },

to

  editorTheme: {
       projects: {
           enabled: **false**
       }
   },

as im running hassio as generic installed, my file was located following path, i think you RPI guys can find it with the samba share

/usr/share/hassio/homeassistant/node-red/settings.json

1 Like

Fixed your code blocks :wink:

For normal users the file is in /config/node-red/setting.json.

When using the Node-RED git/project features, the add-on won’t be able to update the API token.
So disabling that feature, will indeed allow the add-on to work.

So in short, if someone is having connection issues, ensure the following:

  • Node-RED must have 1 server connection configured.
  • Node-RED must use http://hassio/homeassistant as the url.
  • Node-RED must not use the projects/git feature.

If you did need to make any changes because of the list above, be sure to deploy your workflow and to restart the add-on after making those changes.

:information_source: The projects/git feature will return soon.

4 Likes

Checked my hass.io setting.json but this the property was already set to false ?

Please read my post:

1 Like

Hi. Some time ago my nodered addon is giving me api errors when I restart home assistant. It works ok when I restart addon. Is there any way to automate the process , so when nodered hangs on error homeassistant would restart addon??

Thank You.

This may help.

It doesn’t help :pensive:

First of all, @frenck thank you so much for this addon. This is great!

But, I have a problem that I need to restart Node-RED every time after Home Assistant have been restarted. The log under Node-RED only shows messages from previous restart. And yes, I have reloaded Chrome and I have also tried with Microsoft Edge. Cannot find anything in logfiles pointing to this problem. Any advice?

My system: HassOS 1.10, HA 0.78.3, Supervisor 131, Node-RED 0.6.1, RPi3, New Auth (with legacy_api_password support)

Confirmed. I have watch dog also implemented, but it doesn’t work as it’s logic is based on HA going from working to unknown.

This works if for some reason node-red fails while HA is up, but when HA is rebooted, node red “starts” in HA as an unknown state (post HA restart).

I added a hassio.addon.restart automation that runs 1 minute after HA starts to work around this issue.

2 Likes

That’s good idea to restart addon after HA boot. I will do that. Thanks!

:tada: Release v0.7.0

Full Changelog

Added

  • Adds Hassio API role to configuration

Fixed

  • Fixes typo in README

Changed

  • Updates node-red-contrib-bigtimer to version 2.0.2 (#26)
  • Upgrades node-red to version 0.19.4 (#31)
  • Updates node-red-contrib-moment to version 3.0.0 (#35)
  • Updates node-red-node-random to version 0.1.2 (#37)
  • Upgrades base image to v2.3.0

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck

4 Likes

What is exactly “Adds Hassio API role to configuration” ?

Upcoming releases of the Hassio Supervisor (more known as just Hass.io) will add a new role-based security layer. Add-ons will be required to have a requested access level in the add-on metadata. This change prepares the add-on for that change.

1 Like