# MQTT read node does not read values

**URL:** <https://discourse.nodered.org/t/mqtt-read-node-does-not-read-values/58139>\
**Category:** General\
**Created:** [11 February 2022 10:20 UTC](https://discourse.nodered.org/t/mqtt-read-node-does-not-read-values/58139 "2022-02-11T10:20:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![u20p17](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/u20p17/32/41780_2.png) [@u20p17](https://discourse.nodered.org/u/u20p17)\
**Post date:** [11 February 2022 10:20 UTC](https://discourse.nodered.org/t/mqtt-read-node-does-not-read-values/58139/1 "2022-02-11T10:20:37Z")

</div>

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/](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](http://supervisor/core)  
> > 11 Feb 11:10:52 - [info] [server:Home Assistant] Connecting to [http://supervisor/core](http://supervisor/core)  
> > 11 Feb 11:10:52 - [info] [server:Home Assistant] Connected to [http://supervisor/core](http://supervisor/core)  
> > 11 Feb 11:10:53 - [info] [server:Home Assistant] Connected to [http://supervisor/core](http://supervisor/core)

The config in NodeRed looks like this:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/6/d610470a10403e9d30f22d50e3e5c11d885754e1.png)

The read in node of one Shelly looks like this:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/a/aa4dd7a127694b2d3231ff3bdb722edac1e5cebb.png)

How can I solve this issue?

Thanks!

BR

---

<div class="post-metadata">

**Author:** ![u20p17](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/u20p17/32/41780_2.png) [@u20p17](https://discourse.nodered.org/u/u20p17)\
**Post date:** [11 February 2022 11:09 UTC](https://discourse.nodered.org/t/mqtt-read-node-does-not-read-values/58139/2 "2022-02-11T11:09:39Z")

</div>

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 😉

> ## 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/](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](http://supervisor/core)  
> > 11 Feb 11:50:47 - [info] [server:Home Assistant] Connecting to [http://supervisor/core](http://supervisor/core)  
> > 11 Feb 11:50:47 - [info] [server:Home Assistant] Connected to [http://supervisor/core](http://supervisor/core)  
> > 11 Feb 11:50:47 - [info] [server:Home Assistant] Connected to [http://supervisor/core](http://supervisor/core)

---

<div class="post-metadata">

**Author:** ![lu4t](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lu4t/32/32276_2.png) [@lu4t](https://discourse.nodered.org/u/lu4t)\
**Post date:** [11 February 2022 18:02 UTC](https://discourse.nodered.org/t/mqtt-read-node-does-not-read-values/58139/3 "2022-02-11T18:02:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 April 2022 18:02 UTC](https://discourse.nodered.org/t/mqtt-read-node-does-not-read-values/58139/4 "2022-04-12T18:02:55Z")

</div>

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