Home Assistant Community Add-on: Node-RED

Did you use DuckDns?

No, not yet. It not open locally.

So you set this to false:
from:

“require_ssl”: true,

to:

“require_ssl”: false,

Is already done, without success.

{
“log_level”: “info”,
“credential_secret”: “aaa”,
“http_node”: {
“username”: “”,
“password”: “”
},
“http_static”: {
“username”: “”,
“password”: “”
},
“port”: 1880,
“ssl”: false,
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”,
“require_ssl”: false,
“system_packages”: [
“ffmpeg”
],
“npm_packages”: [
“node-red-admin”
],
“init_commands”: [
“echo 'This is a test”
]
}

Hi all,

I must be missing something simple here, but cant for the life figure it out.

NodeRED’s beens working fine for months, but was playing around with MQTT broker settings for zigbee2mqtt and somehow rooted NodeReds MQTT interface. I undid all my changes and now ended up with this.

1). NodeRed seems to want to connect on a ‘cleanboot’ via Docker and not via the defined mqtt interface.
System Log

18-12-29 12:22:15 INFO (MainThread) [hassio.api.proxy] WebSocket access from a0d7b954_nodered
18-12-29 12:22:15 ERROR (MainThread) [hassio.api.proxy] Client error on WebSocket API Cannot connect to host 172.30.32.1:8123 ssl:False [Connection refused].
18-12-29 12:22:15 INFO (MainThread) [hassio.api.proxy] Home Assistant WebSocket API request initialize
18-12-29 12:22:15 INFO (MainThread) [hassio.api.proxy] WebSocket access from a0d7b954_nodered
18-12-29 12:22:15 ERROR (MainThread) [hassio.api.proxy] Client error on WebSocket API Cannot connect to host 172.30.32.1:8123 ssl:False [Connection refused].

NodeRed;

29 Dec 23:22:15 - [info] [server:Home Assistant] WebSocket Closed http://hassio/homeassistant
29 Dec 23:22:15 - [info] [server:Home Assistant] WebSocket Connected to http://hassio/homeassistant
29 Dec 23:22:15 - [info] [server:Home Assistant] WebSocket Closed http://hassio/homeassistant
29 Dec 23:22:15 - [info] [server:Home Assistant] WebSocket Connected to http://hassio/homeassistant

Mosquitto

1546087282: New connection from 172.30.32.1 on port 1883.
1546087282: Socket error on client <unknown>, disconnecting

If I login to NodeRed, go to MQTT configuration node and hit update and deploy, boom it connects.
However no MQTT messages get ported :frowning:

18-12-29 12:31:37 INFO (MainThread) [hassio.api.proxy] WebSocket access from a0d7b954_nodered
18-12-29 12:31:37 INFO (MainThread) [hassio.auth] Auth request from core_mosquitto for XXXXX
18-12-29 12:31:37 INFO (MainThread) [hassio.api.proxy] Home Assistant WebSocket API request running
18-12-29 12:31:38 INFO (MainThread) [hassio.auth] Success login from XXXXX

9 Dec 23:31:36 - [info] Stopping flows
29 Dec 23:31:36 - [info] [server:Home Assistant] Closing WebSocket http://hassio/homeassistant
29 Dec 23:31:36 - [info] [mqtt-broker:Hassio-MQTT] Disconnected from broker: mqtt://core-mosquitto
29 Dec 23:31:36 - [info] Stopped flows
29 Dec 23:31:36 - [info] Starting flows
29 Dec 23:31:37 - [info] Started flows
29 Dec 23:31:37 - [info] [server:Home Assistant] WebSocket Connected to http://hassio/homeassistant
29 Dec 23:31:39 - [info] [mqtt-broker:Hassio-MQTT] Connected to broker: mqtt://core-mosquitto

1546087571: New connection from 172.30.32.1 on port 1883.
[INFO] found XXXXX on Home Assistant
1546087573: Client a0d7b954_nodered disconnected.
1546087573: New client connected from 172.30.32.1 as a0d7b954_nodered (c0, k60, u’XXXXX’)

Doing a restart of NodeRed via Hass.IO works fine.

29 Dec 23:48:39 - [info] Starting flows
29 Dec 23:48:39 - [info] Started flows
29 Dec 23:48:40 - [info] [server:Home Assistant] WebSocket Connected to http://hassio/homeassistant
29 Dec 23:48:42 - [info] [mqtt-broker:Hassio-MQTT] Connected to broker: a0d7b954_nodered @mqtt://core-mosquitto

Anyone got any ideas?
That fact a restart of NodeRed works could mean thats its some priority issue, whereby NodeRed is up before MQTT, but can’t see how that could happen. It takes a good 30s to load.

Thanks!

same. My front end locked up due to all the logs this morning and this afternoon.

OK, managed to get it working again.
Switched to a0d7b954_mqtt and seems to slot together better than with Mosquitto.

Still get the error logs on a clean boot with NodeRed. I guess it’s attempting to do some hardcoded handshake until it decides to use the encoded configs.

mqtt.yaml

mqtt:
  broker: a0d7b954-mqtt
  username: !secret mqtt_username
  password: !secret mqtt_password
  client_id: home-assistant
  discovery: true

a0d7b954_mqtt Config

{
  "log_level": "info",
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "web": {
    "enabled": true,
    "ssl": true
  },
  "broker": {
    "enabled": true,
    "enable_ws": true,
    "enable_mqtt": true,
    "enable_ws_ssl": false,
    "enable_mqtt_ssl": false,
    "allow_anonymous": false
  },
  "mqttusers": [
    {
      "username": "!secret mqtt_username",
      "password": "!secret mqtt_password",
      "readonly": false,
      "topics": [
        "#"
      ]
    }
  ]
}

NodeRed MQTT-Broker Node Config:
mqtt://a0d7b954-mqtt

1 Like

Hi All

I would like to use the exec function in nodered is that possibile ?
Iam getting this error, why ? The file is there.

Command failed: /addons/my_addon/run.sh
/bin/sh: /addons/my_addon/run.sh: not found

/addons is not a valid directory to reach / use inside an add-on. /config/ or /share/ is available though.

Thank you @frenck !!! You helped me a lot !

Hi,

EDIT: FIXED WITH VERSION: 1.2.3

got the following error in the hassio system log:

[hassio.docker] Can’t start addon_a0d7b954_nodered: 500 Server Error: Internal Server Error (“linux runtime spec devices: error gathering device information while adding custom device “/dev/ttyAMA0”: no such file or directory”)

If I try to start the addon myself it just flashed the Start button red and does nothing

I am running this Hassio in a virtual machine (debian 9) on top of proxmox hypervisor
the setup inside the VM is done from this instruction:

Here is my System tab and my Hardware info:


Any way I can get this Node Red addon to run?
If there is any more info needed let me know!!

Thanks a lot

EDIT: FIXED WITH VERSION: 1.2.3

Thanks for v.1.2.3 and this change which allows projects to just work.

  • Adds openssh-client for Node-RED Projects (#96) (@tjorim)

How can I use ssh client pls on node red??

:tada: Release v1.2.4

Full Changelog

Changed

  • Upgrades js-yaml to 3.12.1 (#107) (@tjorim)
  • Upgrades node-red-contrib-cast to 0.2.4 (#108) (@tjorim)
  • Upgrades add-on base image to 2.3.1
  • Configure Renovate (#106)
  • Refactor of GitLab CI
  • Removes Greenkeeper
  • Updates maintenance year to 2019
  • Moves Python requirements out of the Dockerfile
  • Removes greenkeeper from README
  • Fixes MarkdownLint warnings

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

Login Failed

I keep getting this, probably I’ve installed this addon before and then removed, but I don’t remember the credential secret.

I’ve now uninstalled, deleted the config/node-red folder completely, restarted hassio, but I keep getting Login Failed.

I’ve also tried to remove username and password, but I’m still getting request for them.

{
  "log_level": "info",
  "credential_secret": "xxxxxxxxxxxxxxx",
  "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": [
    "echo 'This is a test'",
    "echo 'So is this...'"
  ]
} 

I’ve tried also removing the config/.storage folder, but nothing I still get error

This is what I get from log:

 16 Jan 19:26:04 - [info] Starting flows
 16 Jan 19:26:05 - [info] Started flows
 16 Jan 19:26:05 - [info] [server:Home Assistant] WebSocket Connected to http://hassio/homeassistant 
 16 Jan 19:26:05 - [info] [server:Home Assistant] WebSocket Closed http://hassio/homeassistant 
(node:661) UnhandledPromiseRejectionWarning: #&lt;Object&gt; 
(node:661) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:661) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. 
16 Jan 19:26:05 - [info] [server:Home Assistant] WebSocket Connected to http://hassio/homeassistant 
16 Jan 19:26:05 - [info] [server:Home Assistant] WebSocket Closed http://hassio/homeassistant

What should I do more or what am I missing?

Thanks

PS:
Solved
Now I have to use the Hassio credentials rather than the one defined in the Addon config.
It’s confusing the fact that there are still user/pass definition that is not going to be used…

Hi

Iam trying to install sql lite without success :frowning: any advice ? I tryed in cli and also from noded palette, same error.
Iam using :
hassio 0.85.1
nodered 0.19.5

node-red npm i --unsafe-perm node-red-node-sqlite

> [email protected] install /config/node-red/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.6/node-v59-linux-arm.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v59 ABI, musl) (falling back to source compile with node-gyp) 
gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/usr/local/share/.config/yarn/global/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack     at F (/usr/local/share/.config/yarn/global/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack     at E (/usr/local/share/.config/yarn/global/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/local/share/.config/yarn/global/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/local/share/.config/yarn/global/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/local/share/.config/yarn/global/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:170:21)
gyp ERR! System Linux 4.14.81-v7
gyp ERR! command "/usr/bin/node" "/usr/local/share/.config/yarn/global/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/config/node-red/node_modules/sqlite3/lib/binding/node-v59-linux-arm/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/config/node-red/node_modules/sqlite3/lib/binding/node-v59-linux-arm" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v59"
gyp ERR! cwd /config/node-red/node_modules/sqlite3
gyp ERR! node -v v9.11.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/local/share/.config/yarn/global/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/config/node-red/node_modules/sqlite3/lib/binding/node-v59-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/config/node-red/node_modules/sqlite3/lib/binding/node-v59-linux-arm --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v59' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/config/node-red/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:180:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:936:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
node-pre-gyp ERR! System Linux 4.14.81-v7
node-pre-gyp ERR! command "/usr/bin/node" "/config/node-red/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /config/node-red/node_modules/sqlite3
node-pre-gyp ERR! node -v v9.11.1
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/node /usr/local/share/.config/yarn/global/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/config/node-red/node_modules/sqlite3/lib/binding/node-v59-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/config/node-red/node_modules/sqlite3/lib/binding/node-v59-linux-arm --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v59' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-01-18T10_45_40_478Z-debug.log
➜  node-red

Hey Woody, you just login with your HA credentials.

1 Like

:tada: Release v1.2.5

Full Changelog

Changed

  • Updates node-red-contrib-bigtimer to v2.0.9 (#116)
  • Updates node-red-contrib-home-assistant-websocket to v0.6.1 (#115)

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

anyone else getting fatal errors with node-red (1.2.4 and 1.2.5) + hassio 0.86.0 ?

logs: https://pastebin.com/Eh9zJmEj

has to revert back to 0.85.1 to fix

edit: ok im mistaken, also seeing this error on 0.85.1 and it is not fatal

Is this available in situations where there is no Internet?

I want to run HA on local.