Home Assistant Community Add-on: Node-RED

I almost feel like the API key is broken somewhere?
Could you try un-installing the add-on, removing the node-red folder from your config directory, install it again, try it again?

I know that this is not a solution in general, but it should provide a new API token for Node-RED to use.

Same thing happens.
As soon as Home Assistant and the add-on is starting up the IP gets blocked for failed login attempts.
Any other logs I can provide or things I should try out?

This is the add-on config Iā€™m using:

{
  "log_level": "info",
  "credential_secret": "MarryPoppinsSupercalifragilisticexpialidocious",
  "users": [
    {
      "username": "admin",
      "password": "secret",
      "permissions": "*"
    }
  ],
  "http_node": {
    "username": "",
    "password": ""
  },
  "http_static": {
    "username": "",
    "password": ""
  },
  "port": 1880,
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "require_ssl": true,
  "system_packages": [],
  "npm_packages": [],
  "init_commands": []
}

Wellā€¦ at this point, Iā€™m unable to produce this. Have tried on different platforms and installation types :weary:

So recap: I was able to reproduce the issue.
@pvizeli Found the bug and a new Hass.io Supervisor release will be put out to fix it. :tada:

1 Like

Hi guys,

Iā€™m trying to install the node-red node node-red-contrib-modbustcp through the ā€œmanage paletteā€ menu. unfortunately this doesnā€™t seem to work on the Hass.io version.
The logging shows me some errors: apparently something with node-pre-gyp install.
Any ideas whats wrong?

21 Jul 21:35:55 - [info] Installing module: node-red-contrib-modbustcp, version: 1.2.1
21 Jul 21:38:35 - [warn] Installation of module node-red-contrib-modbustcp failed:
21 Jul 21:38:35 - [warn] ------------------------------------------
21 Jul 21:38:35 - [warn] 
> [email protected] install /config/node-red/node_modules/jsmodbus/node_modules/serialport
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(404): https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/5.0.0/serialport-v5.0.0-node-v57-linux-arm.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI) (falling back to source compile with node-gyp) 
gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:397:16)
gyp ERR! stack     at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Linux 4.4.50
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/config/node-red/node_modules/jsmodbus/node_modules/serialport/build/Release/serialport.node" "--module_name=serialport" "--module_path=/config/node-red/node_modules/jsmodbus/node_modules/serialport/build/Release"
gyp ERR! cwd /config/node-red/node_modules/jsmodbus/node_modules/serialport
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/config/node-red/node_modules/jsmodbus/node_modules/serialport/build/Release/serialport.node --module_name=serialport --module_path=/config/node-red/node_modules/jsmodbus/node_modules/serialport/build/Release' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/config/node-red/node_modules/jsmodbus/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Linux 4.4.50
node-pre-gyp ERR! command "/usr/bin/node" "/config/node-red/node_modules/jsmodbus/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /config/node-red/node_modules/jsmodbus/node_modules/serialport
node-pre-gyp ERR! node -v v8.11.3
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/config/node-red/node_modules/jsmodbus/node_modules/serialport/build/Release/serialport.node --module_name=serialport --module_path=/config/node-red/node_modules/jsmodbus/node_modules/serialport/build/Release' (1)
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
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/2018-07-21T19_38_33_973Z-debug.log

kind regards
Pascal

1 Like

It is in the logs!

I think you should specify extra Node-RED nodes in the add-on options under npm_packages
From the docs:

Option: npm_packages
Allows you to specify additional NPM packages or Node-RED nodes to be installed to your Node-RED setup (e.g., node-red-dashboard, node-red-contrib-ccu).

Note: Adding many packages will result in a longer start-up time for the add-on.

ok, canā€™t find python. And how do I install Python on Hass.io?

Pascal

Please read the add-on documentation.

https://github.com/hassio-addons/addon-node-red/blob/master/README.md#option-system_packages

OK so Iā€™ve just come back to HASS so I have a clean install.

The latest NodeRed container doesnā€™t seem to be passing the data field for service calls.

For example, a call to homeassistant.turn_on gives me this in my homeassistant.log: homeassistant/turn_on cannot be called without entity_id even though I have the same as below - {ā€œentity_idā€: ā€œinput_boolean.blahā€} defined.

And a call to input_boolean.turn_on turns them ALL on, even with {ā€œentity_idā€: ā€œinput_boolean.blahā€} defined.

Iā€™m using a copy/pasted flow that was working beforeā€¦ so Iā€™m positive itā€™s not the flow

Help?

OK so I worked out the issue, HassIO supervisor 117 breaks it. 115 works fine.

@dangeek, Supervisor 118 has just been released (beta channel), that addresses this issue.

Hi,

I have Hassio installed and Supervisor 118 (non-beta channel) installed and am getting the error still. None of my automation are working correctly now. Seeing this in the Node-red logs for all actions:

23 Jul 20:14:41 - [warn] [api-call-service:Take snapshot from webcam] Error calling service, home assistant api error
23 Jul 20:14:41 - [error] [api-call-service:Take snapshot from webcam] Error calling service, home assistant api error
3 Likes

I too have Node-Red connection issues, all of a sudden, while on Supervisor v.118.
Removing and installing the add-on didnā€™t help either. Neither did restarting the hassio server. Any guidance here, please?

[error] [server:Home Assistant] Home assistant connection failed with error: Connection to home assistant could not be established with config: http://hassio/homeassistant <password not used>

2 Likes

Same here with same setup. State change triggers are coming in properly from home assistant

Having the same issue hereā€¦

As a workaround I changed the Base URL of the homeassistant connection in nodered from ā€œhttp://hassio/homeassistantā€ to ā€œhttp://ip:portā€.

2 Likes

Have 118 beta channel and still same error in nodered log. :frowning:

It looks like the issue is with the home assistant proxy. You can do a workaround by adding your home assistant IP and port to the node instead of http://hassio/homeassistant (http://192.168.1.112:8123)

If you use https like duckdns youā€™ll need to use your duckdns url https://yourduckdnsurl.duckdns.org:8123

1 Like

This works for getting the node back online but

How will we all know when itā€™s okay to switch back to intended URL config use? Is the problem supervisor related? If we donā€™t want to go down the beta route will we just have to wait till next point version?