MQTT read node does not read values

Hi all,
I am running HomeAssistant in the latest version with the NodeRed and Mosquitto Broker Addon installed. I use several Shellies which are configured to send via MQTT and with a MQTT Explorer I can see the messages, which get send correctly to the broker.

In Node Red I have configured the MQTT Server but when I restart NodeRed it seems that it does not get any values over MQTT. (Even I can see the messages in the MQTT Explorer)... Sometimes it works and then it is working perfectly until I need to restart NodeRed... What yould be the problem?

Here is a log when I start up NodeRed:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing...

Add-on: Node-RED
Flow-based programming for the Internet of Things

Add-on version: 10.4.0
You are running the latest version of this add-on.
System: Home Assistant OS 7.4 (aarch64 / raspberrypi4-64)
Home Assistant Core: 2022.2.5
Home Assistant Supervisor: 2022.01.1

Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] customizations.sh: executing...
[cont-init.d] customizations.sh: exited 0.
[cont-init.d] nginx.sh: executing...
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] node-red.sh: executing...
patching file nodes/ui_base.html
Hunk #1 succeeded at 1162 (offset 631 lines).
up to date, audited 464 packages in 14s
9 packages are looking for funding
run npm fund for details
23 vulnerabilities (4 low, 14 moderate, 5 high)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run npm audit for details.
[cont-init.d] node-red.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[11:10:28] INFO: Starting Node-RED...

start
node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
11 Feb 11:10:32 - [info]
Welcome to Node-RED
===================
11 Feb 11:10:32 - [info] Node-RED version: v2.2.0
11 Feb 11:10:32 - [info] Node.js version: v16.13.2
11 Feb 11:10:32 - [info] Linux 5.10.92-v8 arm64 LE
11 Feb 11:10:34 - [info] Loading palette nodes
11 Feb 11:10:44 - [info] Dashboard version 3.1.5 started at /endpoint/ui
11 Feb 11:10:47 - [info] Settings file : /etc/node-red/config.js
11 Feb 11:10:47 - [info] Context store : 'default' [module=memory]
11 Feb 11:10:47 - [info] User directory : /config/node-red/
11 Feb 11:10:47 - [warn] Projects disabled : editorTheme.projects.enabled=false
11 Feb 11:10:47 - [info] Flows file : /config/node-red/flows.json
11 Feb 11:10:47 - [info] Server now running at http://127.0.0.1:46836/
[11:10:47] INFO: Starting NGinx...
11 Feb 11:10:47 - [info] Starting flows
11 Feb 11:10:48 - [info] Started flows
11 Feb 11:10:48 - [info] [mqtt-broker:MQTT] Connected to broker: mqtt://192.168.0.2:1883
11 Feb 11:10:52 - [info] [server:Home Assistant] Connecting to http://supervisor/core
11 Feb 11:10:52 - [info] [server:Home Assistant] Connecting to http://supervisor/core
11 Feb 11:10:52 - [info] [server:Home Assistant] Connected to http://supervisor/core
11 Feb 11:10:53 - [info] [server:Home Assistant] Connected to http://supervisor/core

The config in NodeRed looks like this:

The read in node of one Shelly looks like this:
image

How can I solve this issue?

Thanks!

BR

After several restarts it is now working again. If I check the new log file it looks a bit differrent - it seems that now it tried to call a HA service before the HA-connection was finished and now the MQTT is also working... Maybe my issue is somehow related to that?
I am quite sure that I will have the same issue again after next restart - so I will wait for an suggestion of you guys :wink:

Node-RED
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing...

Add-on: Node-RED
Flow-based programming for the Internet of Things

Add-on version: 10.4.0
You are running the latest version of this add-on.
System: Home Assistant OS 7.4 (aarch64 / raspberrypi4-64)
Home Assistant Core: 2022.2.5
Home Assistant Supervisor: 2022.01.1

Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] customizations.sh: executing...
[cont-init.d] customizations.sh: exited 0.
[cont-init.d] nginx.sh: executing...
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] node-red.sh: executing...
patching file nodes/ui_base.html
Hunk #1 succeeded at 1162 (offset 631 lines).
up to date, audited 464 packages in 8s
9 packages are looking for funding
run npm fund for details
23 vulnerabilities (4 low, 14 moderate, 5 high)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run npm audit for details.
[cont-init.d] node-red.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[11:50:24] INFO: Starting Node-RED...

start
node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
11 Feb 11:50:27 - [info]
Welcome to Node-RED
===================
11 Feb 11:50:27 - [info] Node-RED version: v2.2.0
11 Feb 11:50:27 - [info] Node.js version: v16.13.2
11 Feb 11:50:27 - [info] Linux 5.10.92-v8 arm64 LE
11 Feb 11:50:29 - [info] Loading palette nodes
11 Feb 11:50:38 - [info] Dashboard version 3.1.5 started at /endpoint/ui
11 Feb 11:50:41 - [info] Settings file : /etc/node-red/config.js
11 Feb 11:50:41 - [info] Context store : 'default' [module=memory]
11 Feb 11:50:41 - [info] User directory : /config/node-red/
11 Feb 11:50:41 - [warn] Projects disabled : editorTheme.projects.enabled=false
11 Feb 11:50:41 - [info] Flows file : /config/node-red/flows.json
11 Feb 11:50:41 - [info] Server now running at http://127.0.0.1:46836/
11 Feb 11:50:42 - [info] Starting flows
[11:50:42] INFO: Starting NGinx...
11 Feb 11:50:42 - [info] Started flows
11 Feb 11:50:43 - [info] [mqtt-broker:MQTT] Connected to broker: mqtt://192.168.0.2:1883
11 Feb 11:50:43 - [error] [api-call-service:indirekte Bürolichter einschalten] Call-Service attempted without connection to server.
11 Feb 11:50:43 - [error] [api-call-service:direkte Bürolichter einschalten] Call-Service attempted without connection to server.
11 Feb 11:50:43 - [error] [api-call-service:Vorzimmerlichter ausschalten] Call-Service attempted without connection to server.
11 Feb 11:50:45 - [error] [api-call-service:Badezimmerdeckenlicht ausschalten] Call-Service attempted without connection to server.
11 Feb 11:50:47 - [info] [server:Home Assistant] Connecting to http://supervisor/core
11 Feb 11:50:47 - [info] [server:Home Assistant] Connecting to http://supervisor/core
11 Feb 11:50:47 - [info] [server:Home Assistant] Connected to http://supervisor/core
11 Feb 11:50:47 - [info] [server:Home Assistant] Connected to http://supervisor/core

node-red addon in HA is (kind-of) a fork of node-red.
I would go to the addon repo and open an issue. Maybe they even have a similar forum.
People here is usually using plain node-red

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.