Home Assistant Community Add-on: Node-RED

Unfortunately not. I did not get any response to my question. And was to busy to try my luck on Discord or open a github issue on the addon repo.

For now I’m going with the blunt restart Node-RED addon via a Home Assistant Service call.
However would be much better just to restart the one flow that fails.

@kslb My issue also stems from modbus communication failing and freezing the modbus-flex-getter’s
internal state machine, there is no way to reset the state machine other than changing a setting in de Modbus Client config node (even just togling logging on and off will reset the state on deployment), flowrestart or addon restart will work as well, but seems an excessive measure just to reset a node.
My modbus reads are every 30s, so I should get a response back every 30s, I trigger a delay node that triggers on the read request, that I reset when the response gets back. When the the respons does not come the delay fires and I restart the Node-RED addon with a hassio.addon_restart service call.

Can you show me the flow how did you make this so that I will try to find if this is good for me.
Also - if I need to make restart of whole Node-Red and all flows is still better then have non-working modbus flow - because this happens almost never - only if there is power fail on modbus devices.

Something like this is what I use.
You’re lucky that it almost never happens. For me the modbus client freezes daily. But that might have to do with the very exotic modbus device I have :confused:

[{"id":"f24c40d4.fe09e","type":"modbus-flex-getter","z":"d9a498d5.de4378","name":"","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":970,"y":740,"wires":[["774d1a88.f91274","bd5d8f68.4702e"],[]]},{"id":"cf058757.dc6638","type":"inject","z":"d9a498d5.de4378","name":"60s","props":[{"p":"payload"}],"repeat":"60","crontab":"","once":false,"onceDelay":"60","topic":"","payload":"","payloadType":"date","x":430,"y":740,"wires":[["852fe1c8.02d83"]]},{"id":"852fe1c8.02d83","type":"function","z":"d9a498d5.de4378","name":"Create request","func":"return {\n    \"payload\": {\n        \"value\":1,\n        \"fc\":3,\n        \"unitid\": 1,\n        \"address\":0,\n        \"quantity\":10\n    }\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":740,"wires":[["4d678d8f.f21f14","f24c40d4.fe09e"]]},{"id":"4d678d8f.f21f14","type":"delay","z":"d9a498d5.de4378","name":"Comm Timeout","pauseType":"delay","timeout":"120","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1300,"y":840,"wires":[["7e12a16d.373f8"]]},{"id":"7e12a16d.373f8","type":"api-call-service","z":"d9a498d5.de4378","name":"Restart Node-RED","server":"","version":1,"debugenabled":false,"service_domain":"hassio","service":"addon_restart","entityId":"","data":"{\"addon\":\"a0d7b954_nodered\"}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1550,"y":840,"wires":[[]]},{"id":"774d1a88.f91274","type":"change","z":"d9a498d5.de4378","name":"Reset timeout","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":840,"wires":[["4d678d8f.f21f14"]]},{"id":"bd5d8f68.4702e","type":"debug","z":"d9a498d5.de4378","name":"Respons","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1280,"y":740,"wires":[]}]

Hi there all,
I’m sorry if I ask here in this thread…

I want to install a node thet gime me an error and the gui that make this node tell me to install
the “build-essentials” using “install build-essentials”

Is there anybody that can tell me if I can do this on Node-Red installed in Hass OS
and where I must use this command please ?

Thanks a lot
Denis

Hi guys

Please take a look:

I have a quick question why my credentials do not works for static folder or I do something wrong:

Hi, I recently had this message upon starting node-red:

image
(screenshot from my test instance)
And this when pressing:
image

But I decided not yet to press it… so I opened 1 node and did not save…

then the button disappeared and now I think I have to manually open and save all nodes?

Is there a better way? And what is it for?

I copied a node from an older version of Node Red, and immediately got this message. Since I backup daily I had nothing to lose, so I clicked on “Update Nodes”. Everything is still working.
I didn’t look to see if I had any yellow nodes, though.

My question is not about loosing anything though, but how to “get back that message” else I have to manually get 772 nodes done…

I suspect---- that Home Assistant scans the node data (and that’s all the nodes and flows are) on every start of Node Red, and if there is an anomaly, you get this message. In other words, if my hypothesis is correct, then if you don’t see the message, you have no problem.

I have no problem. I only have all homeassistant nodes yellow and that button is not showing anymore.

I just tried updating this add-on from the Supervisor menu to go from version 9.1.3 to 9.1.4 but got the below error:

409 Client Error for http+docker://localhost/v1.40/containers/create?name=addon_a0d7b954_nodered: Conflict ("Conflict. The container name "/addon_a0d7b954_nodered" is already in use by container "9a1bff5ea1cbf389ce911011a4d41ac93c8ad7f29ade2f803c2b5e11876bc41e". You have to remove (or rename) that container to be able to reuse that name.")

Has anyone else seen this? Previous updates have always gone smoothly.

EDIT: I just tried to run and update again and it said that there was no update… Refreshed the page and it seems the update did work.

My config file for node-red within the container is:

docker exec -it addon_a0d7b954_nodered bash
cat /etc/node-red/config.js
const config = require("/config/node-red/settings.js");
const fs = require("fs");
const options = JSON.parse(fs.readFileSync("/data/options.json", "utf8"));
const bcrypt = require("bcryptjs");

if ("theme" in options) {
  if (options.theme !== "default") {
    config.editorTheme.theme = options.theme;
  }
}

// Sane and required defaults for the add-on
config.debugUseColors = false;
config.flowFile = "flows.json";
config.nodesDir = "/config/node-red/nodes";
config.uiHost = "127.0.0.1";
config.uiPort = 46836;
config.userDir = "/config/node-red/";

//Set path for HTTP_Nodes to be served from avoiding lua auth
config.httpNodeRoot = "/endpoint";

// Disable authentication, let HA handle that
config.adminAuth = null;

// Disable SSL, since the add-on handles that
config.https = null;

// Several settings
config.credentialSecret = options.credential_secret;

// Secure HTTP node
if (options.http_node.username) {
  config.httpNodeAuth = {
    user: options.http_node.username,
    pass: bcrypt.hashSync(options.http_node.password),
  };
}

// Secure static HTTP
if (options.http_static.username) {
  config.httpStaticAuth = {
    user: options.http_static.username,
    pass: bcrypt.hashSync(options.http_static.password),
  };
}

// Set debug level
if (options.log_level) {
  config.logging.console.level = options.log_level.toLowerCase();
  if (config.logging.console.level === "warning") {
    config.logging.console.level = "warn";
  }
}

module.exports = config;

So i could send http request to the API on localhost:46836

Hi,

After upgrading Node-RED to 10.0.1 i get this error in the log and the connection to Home Assistant is broken.

Add-on version: 10.0.1
You are running the latest version of this add-on.
System: Home Assistant OS 6.4 (amd64 / qemux86-64)
Home Assistant Core: 2021.9.7
Home Assistant Supervisor: 2021.09.1

Welcome to Node-RED

24 Sep 10:12:14 - [info] Node-RED version: v2.0.6
24 Sep 10:12:14 - [info] Node.js version: v14.17.6
24 Sep 10:12:14 - [info] Linux 5.10.62 x64 LE
24 Sep 10:12:14 - [info] Loading palette nodes
Missing ENV var CONFIG_PATH
24 Sep 10:12:17 - [info] Dashboard version 3.0.4 started at /endpoint/ui
/bin/sh: /opt/node_modules/node-red-node-pi-gpio/testgpio.py: not found
24 Sep 10:12:17 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
24 Sep 10:12:17 - [info] Settings file : /etc/node-red/config.js
24 Sep 10:12:17 - [info] Context store : ‘default’ [module=memory]
24 Sep 10:12:17 - [info] User directory : /config/node-red/
24 Sep 10:12:17 - [warn] Projects disabled : editorTheme.projects.enabled=false
24 Sep 10:12:17 - [info] Flows file : /config/node-red/flows.json
24 Sep 10:12:17 - [info] Server now running at http://127.0.0.1:46836/
24 Sep 10:12:18 - [info] Waiting for missing types to be registered:
24 Sep 10:12:18 - [info] - home-assistant-config
[10:12:18] INFO: Starting NGinx…

Can someone please help me?

I have reinstalled the Node-RED add-on but that did not solve the problem.

Cheers,
Anton

Good I did not update yet…

You can revert to a snapshot (nowadays called backup), unless you ticked it out before upgrading…

Thank you for the tip! But after restoring to 9.0.0 i get the same error in the log… When i check the server settings in a node I suddenly have four diffrent Home Assistant “servers” to chose from, non of these are working…

Same error in the log. But is is still “broken” like before?

Can you access the node red interface?

What do you see right top hamburger menu “configuration nodes”? screenshot?

So a few updates ago my Node-Red went back to bright white mode. I see in the docs it’s been changed to “theme: dark” but when I enter that into the config I get the “Invalid YAML” message.

If I enter “theme: dark” I get the error
If I enter “heme: dark” without the ‘t’ I get no error.

I’ve even tried

Options:
  - theme: dark

No error with that but it doesn’t make my Node-red dark. I’m confused on how to get dark mode/theme back working.

I’m new to Home Assistant and my HA instance is running on a Pi4 using Docker and Portainer.
I have no Supervisor, and therefore no Addon-Store. I looked up Node-Red on Docker-Hub, but there are a lot of versions there and I can’t tell which is this one.

So I’m wondering how I can install Node-Red?
(Sorry if this has already been answered above somewhere in the near 1000 replies.)

core 2021.9.7
hass OS 6.4
supervisor 2021-09-6
advanced mode ON

Problem:
Search for the “Node-RED” add-on in the add-on store and install it.
i cannot find this add on store

Did you already figure this out?
I had the same problem but found out that theme: default was already at the second line…
So adding a new line with theme: dark woudn’t work and gave me that invalid YAML error message.