# MQTT Node: Subscribing to \`+/+/$homie\` does not work?

**URL:** <https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522>\
**Category:** General\
**Created:** [12 May 2020 11:54 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522 "2020-05-12T11:54:47Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [12 May 2020 15:59 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/21 "2020-05-12T15:59:42Z")

</div>

> [@TotallyInformation](#):
>
> The point is that other tools work with `+/+/$homie` just fine, it is only Node-RED that isn't working.

What happens if you reboot your ESP8266 ... then in your config the $homie message should arrive (because the library usual send an update of all topics every reboot)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 May 2020 16:04 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/22 "2020-05-12T16:04:33Z")

</div>

> [@Christian-Me](#):
>
> What happens when you restart MQTT Explorer? Are all messages pop up instantainosly?

Yes

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/e/7e2de460b4e531391f0e17709e42a77ecf230c03.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/b/0b6fd87e64830b66a594e17c91926d29ce2eccb2.png)

> [@Christian-Me](#):
>
> What happens if you reboot your ESP8266 ... then in your config the $homie message should arrive (because the library usual send an update of all topics every reboot)

Yes, that is what happens

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/2/a2bf2bb2ef1a505a57ef6e20926fc17ec452e1d5.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/8/785695928f7b3aff48c52d73cbd849520c24defb.png)

---

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [12 May 2020 16:09 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/23 "2020-05-12T16:09:21Z")

</div>

and in Node-RED ... still no new message?  
What happens (in Node-RED) if you send a message "manually"

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/b/eb29c7f320c5eedb5befb12591e8cf1ac337a19f.png)

Strange, still the questions what broker do you use?

---

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [12 May 2020 16:11 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/24 "2020-05-12T16:11:30Z")

</div>

I ask this because you before you had no update since 73minutes

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/2/224b1753fd9f09d3af51a04772297ee599434502.png)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 May 2020 16:12 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/25 "2020-05-12T16:12:50Z")

</div>

No, still nothing. Though I'm now seeing some oddities in the retained flag I think.

Not everything is coming through with a retained flag.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/b/ebd10f5645eb2f545ca1672031657aa281aef5b1.png)

I'm using Mosquitto on Debian Buster.

---

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [12 May 2020 16:16 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/26 "2020-05-12T16:16:42Z")

</div>

Sorry but you have to do the mosquitto.conf modifications to work with QoS=0 and retained messages. You find hints in the comments of the mosquitto.conf - or in my readme.md

$state comes through because it is updates every 60seconds.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 May 2020 16:17 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/27 "2020-05-12T16:17:00Z")

</div>

FYI accoring to the HIVEMQ site ([https://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices/0](https://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices/0)

* * *

## Topics beginning with $

Generally, you can name your MQTT topics as you wish. However, there is one exception: \_\_ Topics that start with a symbol have a different purpose.\_\_ These topics are not part of the subscription when you subscribe to the multi-level wildcard as a topic (#). \_\_The -symbol topics are reserved for internal statistics of the MQTT broker.\_\_ Clients cannot publish messages to these topics. At the moment, there is no official standardization for such topics. Commonly, **$SYS/** is used for all the following information, but broker implementations varies. One suggestion for $SYS-topics is in the [MQTT GitHub wiki](https://github.com/mqtt/mqtt.github.io/wiki/SYS-Topics). Here are some examples:

$SYS/broker/clients/connected  
$SYS/broker/clients/disconnected  
$SYS/broker/clients/total  
$SYS/broker/messages/sent  
$SYS/broker/uptime

* * *

I wonder if that is part of the issue (or this might just be a red herring)

---

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [12 May 2020 16:19 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/28 "2020-05-12T16:19:29Z")

</div>

Don't think so because homie messages usually start with `homie/deviceName` and only on third level they (some) start with $

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 May 2020 16:38 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/29 "2020-05-12T16:38:57Z")

</div>

> [@Christian-Me](#):
>
> Sorry but you have to do the mosquitto.conf modifications to work with QoS=0 and retained messages. You find hints in the comments of the mosquitto.conf - or in my readme.md

There are a couple of issues here:

- There appears to be a bug in the homie esp library as it should be using QoS 1 I believe.
- There is definitely a problem in Node-RED because all the other MQTT browsers happily show the result for `+/+/$homie`, only Node-RED doesn't.

> [@zenofmud](#):
>
> The -symbol topics are reserved for internal statistics of the MQTT broker.\_\_ Clients cannot publish messages to these topics. At the moment, there is no official standardization for such topics

Interesting! I've never had a problem with Homie convention previously and I've manually output topics with $ happily in the past.

> [@Christian-Me](#):
>
> Don't think so because homie messages usually start with `homie/deviceName` and only on third level they (some) start with $

Good point.

:sigh: never quite as easy as you want it to be is it!

I will check out the Mosquitto configuration to see if that helps. I may also try and run up a test MQTT subscription node.js server to see if I get the same issue with that.

I also see that MicroPython has an ESP Homie library and I wonder if that is worth a try, certainly there are a few limitations in the one I'm using via the Arduino IDE.

In terms of using Homie from Node-RED, the biggest limitations are:

- The Homie convention nodes have no method for dynamically specifying the device, I certainly don't want to have to manually create configuration nodes for each device.

- There is no node to automatically subscribe to 1 or more Homie device topics and grab all of the sub-topics which would be massively useful and overcome one of the potential issues with Homie.

---

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [12 May 2020 16:52 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/30 "2020-05-12T16:52:39Z")

</div>

A lot of info:

> [@TotallyInformation](#):
>
> There appears to be a bug in the homie esp library as it should be using QoS 1 I believe.

This is not a bug ... its a feature. As RAM is limited there is no good way to implement QoS\>0 as you have to store messages for resent as long as you don`t have confirmation. The pubsub library explicit states this.

> [@TotallyInformation](#):
>
> There is definitely a problem in Node-RED because all the other MQTT browsers happily show the result for `+/+/$homie` , only Node-RED doesn't.

Not sure, let's see what happens if you reconfigure mosquito. You don't mess up with the MQTT spec this way because the MQTT spec says the broker "should store" but "could drop" ... strange to use so many "possibility forms" in a spec where people relies on.

> [@TotallyInformation](#):
>
> The Homie convention nodes have no method for dynamically specifying the device, I certainly don't want to have to manually create configuration nodes for each device.

Really. I use "my" node quite dynamically (in the end you can use "[any]" to get "anything". Tell me if you need "anything" else 🙂 . Happy to improve the node:

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

You need more data?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/1/c16024e660b7a59800df44f52f301c1c0bd0546c.png)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 May 2020 16:57 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/31 "2020-05-12T16:57:31Z")

</div>

> [@Christian-Me](#):
>
> Really. I use "my" node quite dynamically (in the end you can use "[any]" to get "anything"

I think I may not be understanding it properly then.

Let me start a new topic and ask you the question directly then you will understand what I want to do.

Thanks for everyone's help by the way. Great support as always.

---

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [12 May 2020 17:00 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/32 "2020-05-12T17:00:07Z")

</div>

> [@TotallyInformation](#):
>
> The Homie convention nodes have no method for dynamically specifying the device, I certainly don't want to have to manually create configuration nodes for each device.

You mean the root topic? But this is somehow fixed by the convention to homie (for use with autodetect)

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

The devise is defined by the node or [any] thing.

Didn't thought that subscribing to `#` and passing all data through the node is a good idea, perhaps I was wrong.

The device Name in the config node is only the name Node-RED exposes itself as a homie device

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/3/539e75f5d2838b60675a949b81480dc80d2741d8.png)

---

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [12 May 2020 17:03 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/33 "2020-05-12T17:03:12Z")

</div>

Fine - I developed a kind of passion to boost the homie convention ... Think it is worth to be used more to streamline the communication between all kind of devices. It could really simplify how fows can be exchanged.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 May 2020 17:14 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/34 "2020-05-12T17:14:14Z")

</div>

> [@Christian-Me](#):
>
> I developed a kind of passion to boost the homie convention

Then I'm really glad I started this thread 😁 - I'm happy to feed your passion!

> [@Christian-Me](#):
>
> You mean the root topic?

No, that's OK, I use "devices" as my root as that makes more sense. You will see from the new thread what I'm trying to achieve.

> [@MQTT Homie Convention Node - questions about usage](https://discourse.nodered.org/t/mqtt-homie-convention-node-questions-about-usage/26541):
>
> Hi again! As mentioned in the last of my topics, I need to better understand how to use and whether I can use the Homie Convention nodes. Here is what I'm trying to do. I have a load of old wireless switches and plugs, an external sensor and a wireless doorbell. All of these use 433MHz and date before cheap ESP devices wink. I use an RFXtrx433e USB device with Max's super excellent set of nodes to capture data and transmit commands. What I want to do as I'm working on the next generation…

> [@Christian-Me](#):
>
> The device Name in the config node is only the name Node-RED exposes itself as a homie device

I think that was what I was confused about. I probably didn't read the docs properly.

> [@Christian-Me](#):
>
> It could really simplify how fows can be exchanged.

I suspect that we may have some more conversations about the best use of the convention. I'll also be interested in your thoughts about best use of nodes vs properties. But I know I need to read up more about v4 of the convention - lets take things to the other thread.

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [13 May 2020 07:03 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/35 "2020-05-13T07:03:52Z")

</div>

Great to hear (or read) that Homie gets a new power user with Julian. 😄

I'm in the process of moving my devices to Homie as well, bit by bit at least. My passion is for standards, patterns and generic solutions, and Homie fits quite well into my abstract world. 🤓

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [13 May 2020 07:13 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/36 "2020-05-13T07:13:47Z")

</div>

I like the idea of it & have implemented a slightly modified version of it but in the workplace, I simply cannot start topics with "homie".

Is the standard strict on this? Or does the standard permit alterative start topic?

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [13 May 2020 07:19 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/37 "2020-05-13T07:19:07Z")

</div>

As I understood it, you can choose any base topic you want.

> The root topic in this document is `homie/` . If this root topic does not suit your needs (in case of, e.g., a public broker or because of branding), you can choose another.

From: [The Homie convention](https://homieiot.github.io/specification/) (point 3)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [13 May 2020 07:24 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/38 "2020-05-13T07:24:17Z")

</div>

Thanks. Its been a while since I read that and was slightly put of when on another thread some time back I asked why this new node being developed was forcing the user to start all topics with "homie" (it was hard coded in the node) and the developer said it's a standard. (Or at least that was what I took from the response - off I go looking for that thread - to clear my head)

I guess I should have read the spec more closely.

Cheers.

Edit...  
So this was the [thread](https://discourse.nodered.org/t/custom-node-collect-store-runtime-mqtt-data-in-configuration-note-and-access-it-from-a-node/14176/2) & now everything becomes clear. I missed one sentence from @Christian-Me response where he said "he would eventually make it configurable". I missed that (shame on me 🙁)

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [13 May 2020 07:33 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/39 "2020-05-13T07:33:50Z")

</div>

It wouldn't be a very flexible convention if it was fixed to `homie/`. 😅

The actual implementations would have to support changing the root topic, of course.

Like Julian, I'm actually using `devices`, but that's been that way years before homie. I had a similar approach to Homie regarding the topic structure. Now I'm just restructuring it to fit the Homie convention, so I can streamline everything. 🤓

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [13 May 2020 10:59 UTC](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522/40 "2020-05-13T10:59:26Z")

</div>

> [@kuema](#):
>
> My passion is for standards, patterns and generic solutions, and Homie fits quite well into my abstract world

Me too! Please see my recent comment on this in the other thread.

> [@Steve-Mcl](#):
>
> cannot start topics with "homie".
> 
> Is the standard strict on this? Or does the standard permit alterative start topic?

You do not have to use this and I am not. I am using `devices` as my root. The convention states that controllers don't have to be able to auto-discover the root - however, this is exactly what started this thread since the way to auto-discover the root is to subscribe to `+/+/$homie`, if you get anything back then you know that homie is in use and can work out the root.

> [@kuema](#):
>
> I had a similar approach to Homie regarding the topic structure

Yes, my original use of Homie quickly ignored the conventions which were too restrictive for me at the time. So I have a very mangled version implemented on my current HA system.

The desire to re-work all of my slowly evolved system into something rather more neat and sensible is what kicked off this discussion in the first place.

Please do join the other thread as we are exploring more of this over there. At the moment, there are still several things that are restricting me from fully adopting the convention and it would be absolutely fantastic if we could agree on how to resolve those things.

In the meantime, this thread is finished now since I know what is causing the problem even though something is still odd because Node-RED's mqtt-in node seems to be more sensitive than other tools and so giving me a slightly different result. I don't really have time to track that down right now and it is clearly an edge-case so hopefully not something that others are likely to hit.

[Previous page](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522.md?page=1)

[Next page](https://discourse.nodered.org/t/mqtt-node-subscribing-to-homie-does-not-work/26522.md?page=3)
