Repository: NotoriousBDG Add-Ons (Node-RED, HA Bridge, and Gogs)

Do I need to install something else before I can use this node?

I think it is related to the harmony node I added but I can’t seem to uninstall that node (says “in use”) I disabled it but it is still giving the error.

Mine’s not crashing but I am having a similar error trying to uninstall some nodes. It is especially giving me problems on similarly named nodes (ie. I tried 2 different counters, and even after uninstalling/restarting it seems to be confused about which one I have installed).

Will try connecting to the container directly.

@NotoriousBDG Would it be possible to have the node red flows stored somewhere accessible like the /share folder? I’ve essentially moved all of my automations to Node Red and it would be great to have an easy way to back them up. Kind of makes me nervous just having everything in the container, I could copy and paste them manually but I’d rather use syncthing.

Are you sure you have the right url in your config node? I have `http://localhost:8123’ and it works fine.

I just updated the Node-RED addon to support authentication. Try updating to the latest version then define your users in the addon config.

I also updated the addon to relocate all Node-RED files to /share/node-red. You should be able to manipulate or backup the files from that more accessible location.

Thanks for your suggestion.

I tried using https://localhost and https://192.168.X.X (IP address of the HA server) and it didn’t work. It only worked when I used https://xxxxxxxx.duckdns.org (my subdomain).

1 Like

Thank you, this also allowed me to clean up the nodes that wouldn’t uninstall!

Not really. If you can’t remove them using the palate manager, then you might want to bash into the container and try removing using command line.

Hi @NotoriousBDG I updated the latest version now its gr8 we can have a username and a password so there is some security to our system… but the UI is still accessible direct can we password protect that too ? if yes where can I find the option please guide!

Oh, I see that the UI requires a different configuration for authentication than the IDE. I’ll have to make some additional changes to add authentication to the UI as well. I’ll add that to my todo list…

@NotoriousBDG Thanks for making this! Been looking for a better way to automate in HA for some time and NR seems like the ticket with lots of help online.

I installed 0.1.5 this evening and changed the password for ‘admin’ to my own but I cannot login when using the panel_iframe method you suggest. Just takes me back to the login screen every time. If I go direct to the NR URL, I can login with admin and my new password.

Am I missing something?

Thanks Man… I am looking forward for the update!!!

Is anyone able to get node red to start automatically with hassio?

I always have to go in and manually start node red in the addons, not a deal breaker but I want to move all my automations to node red but cant until I am able to reliably start node red with hassio because one of my automations is a brightness limiter for and LED light, it defaults to full brightness and gets quite hot.

It’s working fine for me in a frame using Chrome with SSL enabled and using the DNS name. The only suggestion I can think of is to make sure you’re using the hostname from your cert if you’ve got SSL enabled. Since you’re seeing the login screen, you probably already got that part working. Can you check the log for errors when you attempt to load the ui in a frame?

It starts automatically for me on my amd64 machine and my Pi 3. Can you look at the logs to see if it attempted to start and if there are any interesting errors? Worst case, there is the hassio.addon_start service that you could call from an automation.

That is a good idea, do you have an example I could use on how to implement this?

Edit: I am not actually sure what is going on with my node red addon because before updating (to get the admin login option), node red used to start really quick, now it looks like it has to reinstall node red each time I restart it - it takes at least a few minutes. I will try to post a log, maybe some can see what the issue is.

Edit 2: Here is the node red log when hassio restarts and node red tries to start automatically (don’t think there is anything too sensitive in here):

5 Dec 13:25:29 - [error] [server-state-changed:Upstairs Nest] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:29 - [error] [server-state-changed:Office Temp] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:29 - [error] [server-state-changed:Xmas Tree Temp] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:29 - [error] [server-state-changed:Pool Temp] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:29 - [error] [server-state-changed:Pool Temp] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:29 - [error] [server-state-changed:Motion Tree] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Motion Office] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Shield Kodi] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Harmony] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Garage Man Door] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Garage Motion] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Garage Door] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Garage Door after 10] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Garage open] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Neurio Power] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Daily Power] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Door Status Changed] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Door Status Changed] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Basement Nest] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Upstairs Nest] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Office Temp] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Xmas Tree Temp] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Pool Temp] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Pool Temp] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:36 - [error] [server-state-changed:Motion Tree] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:38 - [error] [server-state-changed:Motion Office] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:38 - [error] [server-state-changed:Shield Kodi] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:38 - [error] [server-state-changed:Harmony] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:38 - [error] [server-state-changed:Garage Man Door] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:38 - [error] [server-state-changed:Garage Motion] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:38 - [error] [server-state-changed:Garage Door] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:38 - [error] [server-state-changed:Garage Door after 10] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:38 - [error] [server-state-changed:Garage open] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:38 - [error] [server-state-changed:Neurio Power] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:38 - [error] [server-state-changed:Daily Power] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:38 - [error] [server-state-changed:Door Status Changed] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:39 - [error] [server-state-changed:Door Status Changed] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:39 - [error] [server-state-changed:Basement Nest] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:39 - [error] [server-state-changed:Upstairs Nest] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:39 - [error] [server-state-changed:Office Temp] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:39 - [error] [server-state-changed:Xmas Tree Temp] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:39 - [error] [server-state-changed:Pool Temp] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:39 - [error] [server-state-changed:Pool Temp] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:39 - [error] [server-state-changed:Motion Tree] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Motion Office] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Shield Kodi] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Harmony] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Garage Man Door] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Garage Motion] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Garage Door] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Garage Door after 10] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Garage open] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Neurio Power] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Daily Power] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Door Status Changed] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Door Status Changed] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Basement Nest] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Upstairs Nest] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Office Temp] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Xmas Tree Temp] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Pool Temp] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Pool Temp] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:25:41 - [error] [server-state-changed:Motion Tree] Connection error occured with the home-assistant server: {"type":"error"}
5 Dec 13:26:06 - [red] Uncaught Exception:
5 Dec 13:26:06 - TypeError: Cannot read property 'state' of null
    at Object.onIncomingMessage (/share/node-red/node_modules/node-red-contrib-home-assistant/node-server-state-changed/node-server-state-changed.js:46:147)
    at HaEvents.onStateChanged (/share/node-red/node_modules/node-red-contrib-home-assistant/node-server-state-changed/node-server-state-changed.js:54:43)
    at emitOne (events.js:101:20)
    at HaEvents.emit (events.js:188:7)
    at HaEvents.onClientMessage (/share/node-red/node_modules/node-home-assistant/lib/ha-events.js:57:18)
    at EventSource.client.on (/share/node-red/node_modules/node-home-assistant/lib/ha-events.js:96:49)
    at emitOne (events.js:96:13)
    at EventSource.emit (events.js:188:7)
    at _emit (/share/node-red/node_modules/eventsource/lib/eventsource.js:186:17)
    at parseEventStreamLine (/share/node-red/node_modules/eventsource/lib/eventsource.js:201:9)
npm info lifecycle [email protected]~start: Failed to exec start script
npm ERR! Linux 4.4.50
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" "--" "--userDir" "/share/node-red"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/share/node-red"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/share/node-red"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-red-docker package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/share/node-red"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-red-docker
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-red-docker
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     /usr/src/node-red/npm-debug.log

Edit 3: getting these errors while node red is running:

Failed to GET info from http://192.168.86.52:80/description.xml
{ Error: connect ECONNRESET 192.168.86.52:80
    at Object.exports._errnoException (util.js:1018:11)
    at exports._exceptionWithHostPort (util.js:1041:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
  code: 'ECONNRESET',
  errno: 'ECONNRESET',
  syscall: 'connect',
  address: '192.168.86.52',
  port: 80 }
Failed to GET info from http://192.168.86.52:80/description.xml
{ Error: connect ECONNRESET 192.168.86.52:80
    at Object.exports._errnoException (util.js:1018:11)
    at exports._exceptionWithHostPort (util.js:1041:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
  code: 'ECONNRESET',
  errno: 'ECONNRESET',
  syscall: 'connect',
  address: '192.168.86.52',
  port: 80 }
Failed to GET info from http://192.168.86.52:80/description.xml
{ Error: connect ECONNRESET 192.168.86.52:80
    at Object.exports._errnoException (util.js:1018:11)
    at exports._exceptionWithHostPort (util.js:1041:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
  code: 'ECONNRESET',
  errno: 'ECONNRESET',
  syscall: 'connect',
  address: '192.168.86.52',
  port: 80 }
Failed to GET info from http://192.168.86.52:80/description.xml
{ Error: connect ECONNRESET 192.168.86.52:80
    at Object.exports._errnoException (util.js:1018:11)
    at exports._exceptionWithHostPort (util.js:1041:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
  code: 'ECONNRESET',
  errno: 'ECONNRESET',
  syscall: 'connect',
  address: '192.168.86.52',
  port: 80 }

Like this:

- alias: Start Node-RED Addon
  trigger:
  - platform: homeassistant
    event: start
  action:
  - service: hassio.addon_start
    data:
      addon: 27e642c6_nodered

That’s because it’s installing node-red-admin that’s needed to hash the passwords provided in the addon config. I’ll look to see if I can make the install only run when necessary rather than every time.

Those errors make me think that it might be failing because Home Assistant isn’t fully started when Node-RED starts. I already have the addon configured to start after Home Assistant, which is the latest available option for startup. I don’t think there is anything I can change to delay the startup any more than it already does.

I assume that’s coming from one of your flows because Node-RED isn’t running on tcp/80. Any idea what http://192.168.86.52:80/description.xml belongs to?

Thanks for the prompt reply. Nothing showing in logs in add-ons UI. Is there a more detailed log somewehere?

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

@NotoriousBDG Fixed. NR UI does not seem to like .local but the UI is OK with it. Go figure.

panel_iframe:
  nodered_flows:
    title: 'Node-RED Flows'
    url: 'http://10.0.1.204:1880'
    icon: mdi:nodejs
  nodered_ui:
    title: 'Node-RED Dashboard'
    url: 'http://hassio.local:1880/ui'
    icon: mdi:nodejs

Odd. Glad you figured it out :smile:.

I’ve been running it with SSL and DuckDNS and it’s worked through several hass.io upgrades and at least one Node-RED update. The only quirk I have is that I had to make a hosts file entry on my Windows box for hass.io, but that (or the lack of) doesn’t affect Node-RED starting up automatically–it’s just needed for the left panel Node-RED link to work.

Here’s my add-on’s options, fwiw…

{
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "users": [
    {
      "username": "myadmin",
      "password": "mypassword",
      "permissions": "*"
    }
  ]
}

And configuration.yaml code:

panel_iframe:
  nodered_flows:
    title: 'Node-RED Flows'
    url: https://mysubdomain.duckdns.org:1880
    icon: mdi:nodejs

I think it may be emulated hue or Google home. My config is a mess, time for some housecleaning, I’m thinking