Home Assistant Community Add-on: Node-RED

Hey …
Works for me:

credential_secret: MYSECRET
dark_mode: false
http_node:
  username: ''
  password: ''
http_static:
  username: ''
  password: ''
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
require_ssl: false
system_packages:
  - make
  - g++
  - linux-headers
npm_packages:
  - node-red-dashboard
  - node-red-contrib-i2c
init_commands: []

The missing package linux-headers is causing this error fatal error: linux/types.h

Hope this helps.
Now trying the same thing. Read a sensor (INA219)

Just tried using Node-Red via a separate browser, it worked fine. I just logged in with the same credentials I used for HA.

I am trying to convert some Zwave devices from Homeseer to HA and would like to use the Node Red Add-on to connect both systems until they are supported on HA. I’ve installed the Homeseer module and am able to see the devices. In order for those devices to show their current state, the Homeseer instructions states:

In order for Node-RED to receive device status updates from HomeSeer you need to setup a webhook URL. From the HomeSeer web interface go to Setup > Custom and add your Node-RED URL followed by /homeseer/webhook . For example if Node-RED is running on the same machine as HomeSeer, it should be something like http://127.0.0.1:1880/homeseer/webhook

When I configure HS with
http://192.168.1.66:1880/homeseer/webhook
I get the following error - auth request unexpected status: 500 while sending to client, in the HA Node Red logs.

When I configure HS with
http://192.168.1.66:1880/endpoint/homeseer/webhook
I get the following error - Posting to webhook failed: The remote server returned an error: (404) Not Found. URL: http://192.168.1.66:1880/endpoint/homeseer/webhook in the HS logs

I’m running HA on a pi4 and am at all current versions as of today.

Should I be able to configure HS with the Add-on? If not, I know I can with a separate install of Node Red…but I’d prefer to use the Add-on if possible.

I am starting to loos my mind here, where should I type in my strong password to not get a warning from the supervisor?

I have generated a strong password, and when I check in at haveibeenpawned I get the result " Good news — no pwnage found!" The add on logg states

[17:30:39] INFO: Password is NOT in the Have I Been Pwned database! Nice!
[17:30:39] INFO: Password is NOT in the Have I Been Pwned database! Nice!

But I still get this notifications

image

This is my config now, what am I missing?

I think the credential_secret is also being checked. I changed mine and the notifications stopped, but then I started getting warnings in Node Red about my credentials not able to be decrypted. Unsure how to fix this without breaking anything, I just reverted to my original credential_secret and will live with the warnings. I also did try to block the pwnedpasswords.com and haveibeenpwned.com domains using AdGuard, but I still get the warnings.

I did the same with credential_secret but got the same issue as you describes. There is a heated thread about this pwned thing here

I have not tried this myself yet but the notifications can be stop with this automation

fix the credential_secret, that is what fixed it for me

@gokuro How did you do that in Node-RED?

configured credential_secret under supervisor > add-on > node-red > configuration

restarted HA, no warning secret warning

Do not work for me, I get this warning in Node-RED

image

And the log states

7 Mar 10:34:23 - [warn] Error loading credentials: SyntaxError: Unexpected token � in JSON at position 0
7 Mar 10:34:23 - [warn] Error loading flows: Error: Failed to decrypt credentials

Do you know how to get the add-on safe @frenck?

Here’s how I finally got the Node Red Add-On working:

  1. Create a snapshot in case something goes wrong.
  2. There are 3 ‘passwords’ used by the Add-On under Supervisor - Add-On - Node-Red - Configuration:
    a) credential_secret
    b) http_node password
    c) http_static password
  3. Manually check each of those 3 directly at the Have I Been Pwned web page. Make sure there are no ‘hits’ on the passwords and try variants until they show no hits.
  4. Update and save those 3 passwords in Node-Red Configuration and reboot the Host (Supervisor - System - Host)
  5. If you’re using secrets.yaml, move the 3 passwords out of Node-Red Configuration and into the secrets file.

Additional comments:

  • I don’t know if rebooting the host is necessary, but in many attempts to fix this issue I believe I had tried to just restart the Node-Red Add-On and restart HA without success.
  • Not sure if it was Node-Red or another Add-On, but at one point I received a “Check Configuration” error that indicated it didn’t like one of my passwords that started with an !exclamation, so I had to change that to something else.
  • Right now when I try to check a password at the Pwned web page it just spins for a while and eventually throws the following error: " Oh no - catastrophic failure!". I don’t know if the API side of that web site is still functional, but if so it may be affecting people when they are trying to resolve this.

Thanks for the info, I tried al that and restarted the host, the supervisor, the machine, HA but still get the error that “Credentials could not be decrypted. The flow credential file is encrypted, but the project’s encryption key is missing or invalid.” Did you get the same at first?

Yes, same error. The only other thing I did was to disable my mqtt-broker since I had only used that for testing once and no longer use it (In Node-Red - click the 3 config bars at upper-right - Configuration Nodes - double-click mqtt-broker). That node does have an SSL option as well as a username/password option on the Security tab. Not sure if that password was also being checked against HIBP site.

If you change credential_secret in the add-on config you are going to get this error. All credentials collected as part of configuration of nodes in Node RED are stored in an encrypted file. This file is encrypted with the value you put in credential_secret. If you change it then that file can’t be decrypted like the error says, that’s why the add-on says not to change it.

If you do want to change it you have two options:

  1. Restart after changing it and fix any broken nodes. Most likely there’s a few configuration nodes you’ll have to fix and everything else will be happy again but depends on the complexity of your Node RED situation.
  2. Give this experimental solution Kermit posted a try. I would definitely make a backup first although realistically the worst that happens is you end up back at #1
1 Like

Can anyone help out for a normal HA user (not hass.io)?
I have installed Node Red through the HACS (not the addon store, that does not exist natively in HA). After install I added the Node Red Integration but there’s no config anywhere and nothing in the sidebar.

I’m trying to access the Node-Red api.
I’m on

OS: Home Assistant OS 5.12
Supervisor: supervisor-2021.03.6
Core: core-2021.3.4
Node-Red Community Addon: 8.2.0

The Node-Red docs tell me to add a user and hashed password to the adminAuth object in settings.js.
The /config/node-red/settings.js file mentions the adminAuth object is controlled by the addon and removed. it further states ‘known as users in the add-on configuration’.

First hurdle was the actual url of api to get the token. All Node-Red docs mention http://localhost:1880/auth/token however this url get me a Status code 500: Internal Server Error.
Some digging around I read that the url from the Node-Red docs probably end up in the Home Assistant server and for urls to an addon I should add /endpoint to the url.
So I think the url should be http://localhost:1880/endpoint/auth/token. On this I get a Status code 401: Unauthorized.

I don’t know what username or password I can use to access the api. I tried the http_static and http_node users, Home Assistant users, and even (against all odds) tried to add the adminAuth object to the settings.js file anyways, but to no avail. Everytime I get the unautorized result.

My question is, how to access the Node Red api when using the Node Red addon?

This is not nodered, this is only intergration for nodered so you can integrate Nodered to HA. Nodered can create sensors and other stuff in HA with this integration. You still need nodered addon or nodered container.

2 Likes

Took me a while to get to this point, thanks !

Good time of day
I have the same problem
2 Apr 14:43:42 - Error: bind EADDRINUSE 0.0.0.0:9898
at dgram.js:337:20
at processTicksAndRejections (internal/process/task_queues.js:81:21)

Do You have resolved your question?
How can I change the port?
Thanks