Home Assistant Community Add-on: Node-RED

Update to this post. Uninstalled Node-Red (saved flows first!), SSHed into my HASSIO and deleted the Node-Red dir, reinstalled Node-Red, reloaded flows (using clipboard in case anybody is reading) and now it all works fine.

Guys. Help the rookie. Installed in ha Node-RED but it does not start at all (page not found) settings and logs:

Config:
{
“log_level”: “info”,
“credential_secret”: “JHhfdhiFRENCKfsdfdsDHFHDJS”,
“users”: [
{
“username”: “admin”,
“password”: “vasyapupkinidiot”,
“permissions”: “*”
}
],
“http_node”: {
“username”: “admin”,
“password”: “vasyapupkinidiot”
},
“http_static”: {
“username”: “admin”,
“password”: “vasyapupkinidiot”
},
“port”: 1880,
“ssl”: false,
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”,
“require_ssl”: true,
“system_packages”: ,
“npm_packages”: ,
“init_commands”:
}
log:
[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] 00-banner.sh: executing…


Hass.io Add-on: Node-RED v0.7.0

Flow-based programming for the Internet of Things

From: Community Hass.io Add-ons
By: Franck Nijhof [email protected]

amd64 / Ubuntu 18.04.1 LTS / HA 0.81.0 / SU 138 / stable

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing…
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing…

INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing…
INFO: Password is NOT in the Have I Been Pwned database! Nice!

Yeah, that’s not really a fix but more of a workaround. It shouldn’t be necessary though.

There are at least three options based on the very limited info you provided:

  1. you are accessing HA via DuckDNS or similar and clicked the ‘Open web UI’-button,
    while the port is not forwarded/accessible using that url

  2. you didn’t post the full log and there is an error somewhere further

  3. the add-on simply is not started up yet, as there is a lot missing in the log you provided,
    below you can find an example of what should follow after yours
    and the last line clearly stating it started up

INFO: Password is NOT in the Have I Been Pwned database! Nice!
INFO: Password is NOT in the Have I Been Pwned database! Nice!
[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... 
INFO: API token is incorrect in the Node-RED configuration, fixing...
[cont-init.d] 30-auto-api-token.sh: exited 0.
[cont-init.d] 80-system-packages.sh: executing... 
[cont-init.d] 80-system-packages.sh: exited 0.
[cont-init.d] 81-npm-packages.sh: executing... 
[cont-init.d] 81-npm-packages.sh: exited 0.
[cont-init.d] 82-user-scripts.sh: executing... 
[cont-init.d] 82-user-scripts.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
> [email protected] start /opt
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
28 Oct 15:27:41 - [info] 
Welcome to Node-RED
===================
28 Oct 15:27:41 - [info] Node-RED version: v0.19.4
28 Oct 15:27:41 - [info] Node.js  version: v8.11.4
28 Oct 15:27:41 - [info] Linux 4.14.66-v7 arm LE
28 Oct 15:27:45 - [info] Loading palette nodes
28 Oct 15:28:08 - [info] Settings file  : /etc/node-red/config.js
28 Oct 15:28:08 - [info] Context store  : 'default' [module=memory]
28 Oct 15:28:08 - [info] User directory : /config/node-red/
28 Oct 15:28:08 - [warn] Projects disabled : editorTheme.projects.enabled=false
28 Oct 15:28:08 - [info] Flows file     : /config/node-red/flows.json
28 Oct 15:28:08 - [info] Starting flows
28 Oct 15:28:08 - [info] Started flows
28 Oct 15:28:09 - [info] Server now running at http://127.0.0.1:1880/

Thank you all sorted out.

:tada: Release v1.0.0

:warning: It contains breaking changes! So please read this carefully!

This is a BIG release, and that is why I marked this release v1.0.0!

The Home Assistant connector node has been replaced by node-red-contrib-home-assistant-websocket and uses WebSockets to connect to Home Assistant, which is actually the preferred method to use when talking to Home Assistant. It improves reaction speed and is build on top of the official Home Assistant WebSocket libraries.

The add-on now handles Home Assistant restarts automatically. You no longer need custom flows or restart magic to fix Node-RED after Home Assistant restarts :tada:.

Furthermore, authentication has been replaced. Node-RED now authenticates users against Home Assistant :lock:. This allows you to log into your Node-RED using your Home Assistant credentials.

Some other noteworthy changes:

  • http_node no longer requires a username/password and can be left empty if you’d like.
  • http_static no longer requires a username/password and can be left empty if you’d like.
  • The Google TTS API should be fixed (love to hear feedback on this!).
  • The add-on has now “Manager” access to the Hass.io API, which allows you to restart Home Assistant and Hass.io add-ons in your flows.
  • The documentation has been updated with an FAQ to help with common problems.

:arrow_up: Upgrade instructions

  • Be sure to run at least Home Assistant 0.80.1. Any older version might cause troubles with getting connected or on logging in.
  • Remove the users list from the add-on configuration. You don’t need it anymore since the add-on now authenticates against Home Assistant.
  • There are some breaking changes with two of the nodes. The Poll State and Current State both have a little different formatted output. Check your nodes and make sure they are outputting what you expect.
  • If you have been using the @Spartan-II-117 fork, this upgrade should be a drop in replacement. It is strongly suggested to not use this fork with this add-on anymore.
  • Finally, make sure your Home Assistant server connection in Node-RED uses http://hassio/homeassistant as the server URL :exclamation: This is really important, you really don’t need any other URL or long lived access token.

Full Changelog

Changed

  • Fix typo in README (#40) (@zpartal)
  • Upgrades node-red-contrib-influxdb to version 0.2.2 (#41)
  • Upgrades gcc to 6.4.0-r9
  • Upgrades nodejs to 8.12.0-r0
  • Switches add-on to node-red-contrib-home-assistant-websocket
  • Forcing broken world to enable latest NodeJS
  • Removes node-red-contrib-change-detect (#48) (@bonanitech)
  • Adds HA Authentication to Node-RED (#52)
  • Renames authentication config option (#53)
  • Updates node-red-contrib-moment to version 3.0.1 (#63)
  • Upgrades git to 2.18.1-r0
  • Updates node-red-contrib-actionflows to version 2.0.1 (#65)
  • Upgrades google-tts-api to 0.0.3 (#61) (@heytcass)
  • Fixes incorrect JSON formatting in package.json
  • Removes unneeded warning about no users
  • Removes Auto API token script, not needed anymore
  • Removes requirement for setting http node/static credential
  • Adds possibility to disable HA Authentication
  • Updates the README to reflect the latest changes
  • Up the security level of the Hassio API to manager

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

4 Likes

Wow thanks! When will this be available? Hassio still shows 0.70 wand still doesn’t detect the new version.

It is available already. If it doesn’t show up, you can force the update by going into the add-on store and hit the reload button in the top right. The update should popup a couple of seconds after that.

Thank you that did it.

Node-red autoconnect on HA restart works beautifully! I can see that the green “connected” indicator below the HA nodes will keep flashing red-yellow-green until HA comes back up.

2 Likes

Node-Red just updated to v1.0 but I can no longer log in to the system. I tried pasting my password in directly from the config but no luck.

I have now removed my username and password from the config entirely, rebooted both Node-Red and Hass.io but I am still greeted by the login page when accessing Node-Red. Pressing submit with no entry or a space in each results in “login failed”.

Is there some kind of default username and password I am missing? I don’t understand why it won’t let me log in. I have reset the Config to defaults with the exception of all my SSL being false (I’m not exposing this page publicly) and my credential_secret being completed.

Any help is appreciated, my initial log is below but there are no errors (apart from one Node-red tried to connect to home assistant after the last line I paste here, but I feel that is a separate issue which I can look into once I can log into the system!)

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 

-----------------------------------------------------------
 Hass.io Add-on: Node-RED v1.0.0

 Flow-based programming for the Internet of Things

 From: Community Hass.io Add-ons
 By: Franck Nijhof <[email protected]>
-----------------------------------------------------------
 amd64 / Ubuntu 18.04.1 LTS / HA 0.81.1 / SU 138 / stable
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 

INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 20-config.sh: executing... 
[cont-init.d] 20-config.sh: exited 0.
[cont-init.d] 80-system-packages.sh: executing... 
[cont-init.d] 80-system-packages.sh: exited 0.
[cont-init.d] 81-npm-packages.sh: executing... 
[cont-init.d] 81-npm-packages.sh: exited 0.
[cont-init.d] 82-user-scripts.sh: executing... 
[cont-init.d] 82-user-scripts.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

> [email protected] start /opt
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"

30 Oct 07:34:07 - [info] 

Welcome to Node-RED
===================

Thanks!

@joshmd

So please use your HA login credentials.

After update i can no longer log in to nodered…
Tried changing admin user and pass to the same as hass but cant log in.
I hav hassio with z-wave on one pi and hassio with nodered on a different pi

Remove the users list from the add-on configuration. You don’t need it anymore since the add-on now authenticates against Home Assistant.

Hello,
were you able to resolve this issue?
I removed users and username, password and I even changed hass.io paassword in case I have it wrong…

Thank you.

thanx @jpm. I removed it and logged in with my hass user… Then i created a long lived token to use to connect to hassio and that worked

Thanks, that’s what I get for troubleshooting before my morning coffee!

1 Like

Please don’t use the long lived access tokens! Please, take the time to read the upgrade instructions. You don’t need them! Secondly, the method provided by the add-on (without access token) adds more security as well.

So for the love of god, please stop posting this as an answer, since it isn’t.

1 Like

Please share you add-on configuration, so we can help you troubleshooting.

Hello,
sure:

{
  "log_level": "info",
  "credential_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "http_node": {
    "username": "",
    "password": ""
  },
  "http_static": {
    "username": "",
    "password": ""
  },
  "port": 1880,
  "ssl": false,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "require_ssl": false,
  "system_packages": [],
  "npm_packages": [],
  "init_commands": []
}

Thank you for your time.

I used the token in the config node since i have nodered on different pi than my hassio with zwave nodes…