Help please with an auto start Node Red

Over the last two days Node Red has taken to just stop.

It shows itself as offline.

The Watchdog option does not work.

Is there a way to do an automation to detect when Node Red is offline and auto restart it?

I can find way to do most Add ons but Node Red is not in the list.

Looks like I need to run up MQTT zigbee2MQTT and Node Red outside of Home Assistant to get them reliable again.

OK found how to do it force a restart of Home Assistant every 5 mins will ensure Node Red.

Hopefully that will keep the basics going while I work out how to move zigbee2MQTT Node Red and MQTT out of Home Assistant to something more reliable.

and what do your logs say happened?

I cannot find any reference to Node Red ion the Logs.

I just keep finding Node Red no longer running and if it crashed then Watchdog failed as well.

I was expecting too much of Home Assistant - I am radically downsizing moving all the Aqara devices to their own hub so I reliably control the blinds.

I had one good month of solid reliability - it was good while it lasted.

zigbee2MQTT devices are either offline or unresponsive to commands.

I’ll finish moving all the lights I can onto Hue hubs, Aqara onto an Aqara Hub.

I can get both of those to feed HomeKit so that may be a way forward.

If I reduce the number of devices on zigbee2MQTT it may be able to cope, then I just need to get a reliable automation working.

Once I have the critical areas working again on other hubs I’ll look to building a standalone zigbee2MQTT MQTT and Node Red and try to get some stability back.

I have been doing Home Automation since X10 and my hopes and ambition for it have constantly exceeded it abilities.

I scale down, diversify hubs and just focus on key functions.

I love doing all this but the whole experience with Home Assistant has been device wak a mole , and is taking far too much of my time just. to keep it stable let alone develop it further.

I still have a test box, Home Assistant green and I’ll run that back up as a test box and see if it all stabilises.

On the addon page, the last tab at the top right, logs. You will need the error to occur, then go to the log hit refresh. Everything on that log page is from nodered only.

There is a user with over 100,000 automations so I doubt this is the case. HA can be pretty finicky at times, so a few bad settings can throw everything out of wack. Once things are configured correctly, it works really well. I’m hitting 4 years running in a 6 family apt building and IMO it’s the best option out there.

1 Like

I have disabled 90% of integrations in order to reduce the loading on it.

But unfortunately, despite multiple full reboots ….

Home Assistant is largely unresponsive now taking 20+ seconds to respond to anything often never recovering often resulting a blank screen.

I have built Home Assistant three times since Christmas using default settings while assigning 100gb of disk 8gb ram and 4 Mac Apple silicon processors.

I can assign more resources.

I’ll massively reduce my expectations and loading and use the Home Assistant green and keep extremely vanilla and avoid all integrations except for Add Ons.

Hopefully will be able to restore basic functionality.

I have 27 addon’s and more than 50 integrations running on a pi 4, so I don’t think processing power is the problem unless you are running AI services. Are you using anything out of hacs or other custom integrations? Or an addon not from the official addons.

image

I would look at those first and disable them to see if the lagging stops.

Edit you can also go to settings → system → repairs → 3 dot menu on the top right. integration start up times will show you how long it take each component to load.

image

Dahua, for me, takes the longest to load @ almost 15 sec. This may give you an indication of what is lagging.

I have disabled most integrations and add ons.

Home Assistant is now responsive.

But if I can’t integrate hue, Govee, Tado, Victron, myenergi, eufy security, Shelly, Nanoleaf, Plex, AppleTv , octopus into Home Assistant I need to find something else.

It was solid and working extremely well.

zigbee2MQTT was rock solid until two days ago.

I have been using Node Red for two years and this the first time it has ever been unreliable.

The only things left running are……


I have performed several full reboots.

zigbee2MQTT is reporting multiple devices offline and a mass of devices who have not connected for over 7 hours so expect a lot more devices offline by morning.

I spent a few hours earlier re-pairing offline devices but they were gaining on me.

Now that ha is responsive you can start adding things back, maybe 2-3 at a time letting it run for a while and then checking if is lagging again. It looks like these 3 are custom integrations so maybe start with them.

Tado, Victron, myenergi

Once you isolate the offender, on it’s git page there will be an issues link in the header. Look in there to see if anyone else has your problem. If not try creating a post or if there is an announcement thread for that on particular integration, post in there, to see if any users can shed some light on your problem.

Edit: As far as the zigbee2mqtt problems again check it’s github issues, there is a post that the newest version is unreliable.

1 Like

Node Red down again

Refreshed log below


s6-rc: info: service init-customizations successfully started
s6-rc: info: service init-nodered: starting
s6-rc: info: service init-nginx successfully started

up to date, audited 452 packages in 7s

69 packages are looking for funding
  run `npm fund` for details

22 vulnerabilities (1 low, 10 moderate, 11 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
npm notice
npm notice New minor version of npm available! 10.7.0 -> 10.8.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.1
npm notice To update run: npm install -g [email protected]
npm notice
s6-rc: info: service init-nodered successfully started
s6-rc: info: service nodered: starting
s6-rc: info: service nodered successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started

> start
> node $NODE_OPTIONS node_modules/node-red/red.js --settings /etc/node-red/config.js

23 Jun 20:53:35 - [warn] Projects disabled : editorTheme.projects.enabled=false
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:b0c4bed56a588acb] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:f746308f97e65b99] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:Mike Bed] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:Dawn Bed] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:70db2f0f6ce6e15d] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:0b48d763dbfc830a] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:0356a0afc91727e1] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:Back Gate] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:fbb102742ccfe95d] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:c21d546bc6d33238] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:Freezer] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:Fridge Motion ] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:Fridge Motion] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:Fridge] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:e408b62ff3ef40a9] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:Office Occupancy Sensor] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:Lounge Sonoff Presence] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:Symfonisk Remote] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:Master Shelf Socket] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:Master Shelf Socket] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:Master Shelf Socket] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:36 - [warn] [zigbee2mqtt-in:3c4697a37a22ffcf] You need to turn on the "retain" option for the device in Zigbee2MQTT to be able to read it before a state change.
23 Jun 20:53:39 - [warn] [hubitat config:HE Main] Unable to fetch devices: FetchError: request to http://10.10.10.12:8080/apps/api/65/devices/*?access_token=7d9e6c25-da3e-4c4c-9364-a7b6560adce0 failed, reason: connect EHOSTUNREACH 10.10.10.12:8080
23 Jun 20:53:39 - [warn] [hubitat device:Front Door Lock] Unable to initialize device: request to http://10.10.10.12:8080/apps/api/65/devices/*?access_token=7d9e6c25-da3e-4c4c-9364-a7b6560adce0 failed, reason: connect EHOSTUNREACH 10.10.10.12:8080
23 Jun 20:53:42 - [warn] [hubitat config:HE Main] Unable to fetch devices: FetchError: request to http://10.10.10.12:8080/apps/api/65/devices/*?access_token=7d9e6c25-da3e-4c4c-9364-a7b6560adce0 failed, reason: connect EHOSTUNREACH 10.10.10.12:8080
23 Jun 20:53:42 - [warn] [hubitat device:c45add67f8d80ae0] Unable to initialize device: request to http://10.10.10.12:8080/apps/api/65/devices/*?access_token=7d9e6c25-da3e-4c4c-9364-a7b6560adce0 failed, reason: connect EHOSTUNREACH 10.10.10.12:8080
23 Jun 20:53:45 - [warn] [hubitat config:HE Main] Unable to fetch devices: FetchError: request to http://10.10.10.12:8080/apps/api/65/devices/*?access_token=7d9e6c25-da3e-4c4c-9364-a7b6560adce0 failed, reason: connect EHOSTUNREACH 10.10.10.12:8080
23 Jun 20:53:45 - [warn] [hubitat device:0a5bc00b5daec2cf] Unable to initialize device: request to http://10.10.10.12:8080/apps/api/65/devices/*?access_token=7d9e6c25-da3e-4c4c-9364-a7b6560adce0 failed, reason: connect EHOSTUNREACH 10.10.10.12:8080
23 Jun 21:33:44 - [error] [hue-scene:Relax] [object Object]
23 Jun 22:57:24 - [red] Uncaught Exception:
23 Jun 22:57:24 - [error] TypeError: Cannot read properties of undefined (reading '91744868-d0d8-4671-bcc8-8f9fdb7bc3dc')
    at /config/node_modules/node-red-contrib-huemagic-fork/huemagic/hue-bridge-config.js:257:67
    at EventSource.scope.events.<computed>.onmessage (/config/node_modules/node-red-contrib-huemagic-fork/huemagic/utils/api.js:142:9)
    at EventSource.emit (node:events:517:28)
    at _emit (/config/node_modules/eventsource/lib/eventsource.js:287:17)
    at parseEventStreamLine (/config/node_modules/eventsource/lib/eventsource.js:302:9)
    at IncomingMessage.<anonymous> (/config/node_modules/eventsource/lib/eventsource.js:259:11)
    at IncomingMessage.emit (node:events:517:28)
    at addChunk (node:internal/streams/readable:368:12)
    at readableAddChunk (node:internal/streams/readable:341:9)
    at IncomingMessage.Readable.push (node:internal/streams/readable:278:10)
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service nginx: stopping
s6-rc: info: service nginx successfully stopped
s6-rc: info: service init-nginx: stopping
s6-rc: info: service nodered: stopping
s6-rc: info: service init-nginx successfully stopped
s6-rc: info: service nodered successfully stopped
s6-rc: info: service init-nodered: stopping
s6-rc: info: service init-nodered successfully stopped
s6-rc: info: service init-customizations: stopping
s6-rc: info: service init-customizations successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

As the Home Assistant zigbee2MQTT user interface auto removes any attempt to change device settings, you can’t enable retain or anything else.

It looks like the hue magic nodes are causing NR to crash. In the config page of the addon there is an option for safe mode. Turn it on and restart. Remove the hue magic nodes using the palette manager.

Edit: Take a look at this post, it goes over the ways to identify misbehaving integrations.