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

It’s likely a bug in node-red-contrib-home-assistant. If you can’t do any of the workarounds I suggested, you may want to open an issue at https://github.com/AYapejian/node-red-contrib-home-assistant.

thx I will do

Any idea why Node-RED is sending it’s info to the wrong ip?

Correct ip;

967aced0ee70f Subwoofer GET /upnp/amazon-ha-bridge/setup.xml ::ffff:192.168.1.23
Sending setup.xml to ::ffff:192.168.1.23

Incorrect ip;

967aced0ee70f Subwoofer GET /upnp/amazon-ha-bridge/setup.xml ::ffff:192.168.1.51
Sending setup.xml to ::ffff:192.168.1.51

I’ve looked through the settings and can’t figure it out, tia.

Hi,

I configured Ngnix today. And now its working with http://localhost:8123

But it usually should work with http://hassio/homeassistant

Anyway. I think the solution with the proxy is a lot better, because auf local http.

Thank for all the help!

I’ve dug into the issue with using http://hassio/homeassistant in node-red-contrib-home-assistant a little bit more. It appears to be an issue with the API proxy in hassio.

If I execute curl -X GET -H "Content-Type: application/json" http://localhost:8123/api/stream within the Node-RED container, I get the event stream. If I execute curl -X GET -H "Content-Type: application/json" http://hassio/homeassistant/api/stream inside the Node-RED addon, it hangs.

I’ve opened the an issue at https://github.com/home-assistant/hassio/issues/284.

2 Likes

The hassio API proxy now supports proxying the event stream. Make sure your supervisor has automatically updated to 0.78 or newer. After that, you should be able to use http://hassio/homeassistant as your Base URL in Node-RED.

2 Likes

I have Node Red up and running and built a number of basic flows. I am having an issue with it starting/staying running on Hass restart/start events.

On a fresh reboot, I have to manually start NodeRed. I have auto start on boot enabled.
If I restart Hass, NodeRed will crash and I have restart it.

Anyone else have this issue?

Here is the error from restarting Hass via the Hassio control panel. The crash happened right after Hass started up. Node Red stayed running up to that point.

28 Dec 09:40:19 - [red] Uncaught Exception:
28 Dec 09:40:19 - 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

It doesn’t look like you’re alone. Check out https://github.com/AYapejian/node-red-contrib-home-assistant/issues/5.

1 Like

Thank you.

Made another post detailing how to generate dynamic service calls with the Home Assistant nodes, with an example that uses a loop.

3 Likes

When I go to install the Node-Red add-on in Hass.io, the Install button just flashes red and the add-on won’t install. I’ve never had this issue with other add-ons before (I have installed many). I don’t see anything in home-assistant.log correlated to this failure. Any ideas what I can do to get it to work? Very interested to experiment with Node-Red.

Check for errors at http://hassio.local:8123/hassio/supervisor.

Ah, thank you.

Here’s the error:

18-01-19 16:25:13 INFO (SyncWorker_11) [hassio.docker.addon] Start build 27e642c6/armhf-addon-nodered:0.1.6
18-01-19 16:25:14 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 410, in start
    resp = yield from self._request_handler(request)
  File "/usr/lib/python3.6/site-packages/aiohttp/web.py", line 325, in _handle
    resp = yield from handler(request)
  File "/usr/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 93, in impl
    return (yield from handler(request))
  File "/usr/lib/python3.6/site-packages/hassio/api/utils.py", line 33, in wrap_api
    answer = await method(api, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/hassio/addons/addon.py", line 524, in install
    if not await self.instance.install(self.last_version):
  File "/usr/lib/python3.6/site-packages/hassio/docker/utils.py", line 18, in wrap_api
    return await method(api, *args, **kwargs)
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/hassio/docker/addon.py", line 263, in _install
    return self._build(tag)
  File "/usr/lib/python3.6/site-packages/hassio/docker/addon.py", line 276, in _build
    image = self._docker.images.build(**build_env.get_docker_args(tag))
  File "/usr/lib/python3.6/site-packages/docker/models/images.py", line 179, in build
    raise BuildError(chunk['error'])
docker.errors.BuildError: Please provide a source image with `from` prior to commit

Upgrading Docker to 17.05 or newer should fix that.

Thanks. I was still on resinos 1.0. Upgrading to 1.1 in the advanced hass.io settings resolved the issue.

1 Like

Thanks to you both for mentioning/addressing this issue. I was having the same issue. I had no idea you could update the OS on Hass.io. Node Red installed fine after I updated it.

1 Like

Lots of new features in the latest Node-Red - github versioning with Projects! And some updates to the default nodes

1 Like

Awesome! All you have to do to upgrade the addon is to navigate to http://hassio.local/hassio/addon/27e642c6_nodered then click on Rebuild. After several minutes, you should have Node-RED 0.18.

1 Like

I just did a STOP, then REBUILD, then START and I still have .17.5. Is there anything else I need to do?

EDIT: Nevermind. I just had to close out the browser window and reload it. A refresh must have pulled the version from the cache. Am on 0.18.0 now.

I installed a node-red module that and dragged one of those onto the flow.

Now my Node-Red crashes on launch instantly, how do I manage to remove that Node-Red Module on Hassio?
I’ve tried rebuilding, uninstalling and reinstalling but it’s still saved somewhere…

4 Feb 14:13:17 - [info] Starting flows
4 Feb 14:13:17 - [info] Started flows
4 Feb 14:13:19 - [red] Uncaught Exception:
4 Feb 14:13:19 - Error: spawn ping ENOENT
    at exports._errnoException (util.js:1018:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:367:16)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104: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

Not to certain how to fix this but would be great if someone has any ideas?