# MQTT Hub/Gateway

**URL:** <https://community.homey.app/t/mqtt-hub-gateway/6766>\
**Category:** Apps\
**Created:** [January 14, 2019, 6:59pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766 "2019-01-14T18:59:50Z")\
**Posts on this page:** 20\
**Page:** 35

<div class="post-metadata">

**Author:** ![Marian](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marian/32/11090_2.png) [@Marian](https://community.homey.app/u/Marian)\
**Post date:** [November 19, 2019, 5:48am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/688 "2019-11-19T05:48:44Z")

</div>

OK, thanx, I did the subscription, but didn’t know about the device behaviour (delayed response).

---

<div class="post-metadata">

**Author:** ![Marian](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marian/32/11090_2.png) [@Marian](https://community.homey.app/u/Marian)\
**Post date:** [November 19, 2019, 5:50am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/689 "2019-11-19T05:50:02Z")

</div>

There is a possibility to get via MQTT Hub the zone a device belongs to?

---

<div class="post-metadata">

**Author:** ![M\_a\_r\_c\_o](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_a_r_c_o/32/146_2.png) [@M\_a\_r\_c\_o](https://community.homey.app/u/M_a_r_c_o)\
**Post date:** [November 19, 2019, 10:22am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/690 "2019-11-19T10:22:14Z")

</div>

Change the setting in MQTT Hub to from Homei 3.0.1 to Custom and you can send the zone as well.

---

<div class="post-metadata">

**Author:** ![Marian](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marian/32/11090_2.png) [@Marian](https://community.homey.app/u/Marian)\
**Post date:** [November 19, 2019, 11:14am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/691 "2019-11-19T11:14:56Z")

</div>

Hmm, ok, it is also a solution.  
But the zone of the device doesn’t change, why to send it by every MQTT message in the topic?  
Would it be possible to get the zone by broadcasting the device info via homeassistant?

---

<div class="post-metadata">

**Author:** ![Marian](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marian/32/11090_2.png) [@Marian](https://community.homey.app/u/Marian)\
**Post date:** [November 19, 2019, 1:25pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/692 "2019-11-19T13:25:00Z")

</div>

…for example to send additional mqtt message with $zone value?  
(format as $type, $name, $properties)?

---

<div class="post-metadata">

**Author:** ![HarriedeGroot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/harriedegroot/32/56160_2.png) [@HarriedeGroot](https://community.homey.app/u/HarriedeGroot)\
**Post date:** [November 19, 2019, 2:45pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/693 "2019-11-19T14:45:51Z")

</div>

@Marian That’s exactly where the custom protocol is for. It even includes the option to add the zone to the topic as stated above. This also adds the possibility to listen to all device changes in a zone by using topic wildcards.  
By default the Hub follows the [Homie Convention](https://homieiot.github.io/).

---

<div class="post-metadata">

**Author:** ![Marian](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marian/32/11090_2.png) [@Marian](https://community.homey.app/u/Marian)\
**Post date:** [November 19, 2019, 3:18pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/694 "2019-11-19T15:18:03Z")

</div>

Hallo Harriede,

sure, I understand the extension in custom protocol.  
What is not nice, that it changes the format of the topic in compare to Homie Convention ☹

For me it would be enough to get the “device zone” info once, not in every message.

May be think once more about the possibility to send the $zone property during the discovery… 🙂

---

<div class="post-metadata">

**Author:** ![Germain\_Doignies](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/germain_doignies/32/17251_2.png) [@Germain\_Doignies](https://community.homey.app/u/Germain_Doignies)\
**Post date:** [November 19, 2019, 6:17pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/695 "2019-11-19T18:17:16Z")

</div>

Hello,

I visited openHab forum and I found out how to install 2.5 M4,  
And now Mqtt homie connection works better and more stable.  
When I disconnect the broker, I just have to broadcast via Mqtt hub and it works again 👍👍👍  
I will wait few weeks and do some tests now, before make my dashboard.

Many thanks from France 😁

---

<div class="post-metadata">

**Author:** ![Marian](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marian/32/11090_2.png) [@Marian](https://community.homey.app/u/Marian)\
**Post date:** [November 20, 2019, 8:11am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/696 "2019-11-20T08:11:39Z")

</div>

I have been running combination broker+hub+client direct on Homey for couple of hours.  
By not very intensive MQTT communication sunk the free memory from 17% to 4% and is further sinking… (info about free mem on homey received via MQTT topic homey/system/info)

There is a way to find out which Homey application consumes the memory?

---

<div class="post-metadata">

**Author:** ![Markus\_F](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/markus_f/32/14910_2.png) [@Markus\_F](https://community.homey.app/u/Markus_F)\
**Post date:** [November 23, 2019, 12:45pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/697 "2019-11-23T12:45:10Z")

</div>

Hi all,

I have a Problem I didn’t understand. I would like to control my blinds via MQTT in Homey. The Blinds are connected to FHEM.  
So I create a Device via the MQTT-Hub. I fill out the topic and States correctly. Now I can change the state from my Blind from 100-1 percent. If I go down with the slider to zero percent it won’t work.  
If I sniff with the mqtt-explorer I can see that, when I slide to 0 the state goes away. The complete line is away. If I slide then to 1 percent the line with status : positiin=1 comes back.

Any Idea what I am doing wrong? Or what I can do to fix that problem?

---

<div class="post-metadata">

**Author:** ![jolerius](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jolerius/32/7907_2.png) [@jolerius](https://community.homey.app/u/jolerius)\
**Post date:** [December 7, 2019, 8:14pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/698 "2019-12-07T20:14:10Z")

</div>

Hi i am trying to sync a dimmer to a virtual devices using The app groups. But the group device cant be shown in mqtt hub devices list. I tried to check all devices and that doesnt do it either. I heard People get groups devices in mqtt hub, so why doesnt it work for me?

---

<div class="post-metadata">

**Author:** ![Forseti](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/forseti/32/18867_2.png) [@Forseti](https://community.homey.app/u/Forseti)\
**Post date:** [December 12, 2019, 9:12pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/699 "2019-12-12T21:12:12Z")

</div>

Hi everyone,

First of all thank you for the amazing work you have done for this app @HarriedeGroot and @scanno.  
Sadly though, I am running into 2 issuse I am unable to resolve myself.

**Situation:**  
EPS8266 (LSC Wall Plug) flashed running tasmota reporting state via MQTT.

_Homey version_: **3.2.0-rc.3**  
_MQTT Hub Version:_ **2.2.5**  
_State Topic:_ **homie/deviceid/Stekker\_1/stat/POWER**  
_Set Topic:_ **homie/deviceid/Stekker\_1/cmnd/POWER**  
_Homey MQTT Device Name:_ **christmas-bedroom**

Settings:

> {  
> “onoff”: {  
> “stateTopic”: “homie/deviceid/Stekker\_1/stat/POWER”,  
> “setTopic”: “homie/deviceid/Stekker\_1/cmnd/POWER”  
> }  
> }

_Issue 1:_  
Tasmota is expecting ON/OFF values for the Set topic and uses those same values for the state topic.  
When changing the ‘On/Off values’ setting of the MQTT device to ‘on/off’ I run into a timeout.  
The actual setting does seem to have been changes as turning the device on/off works.

Log:

> Couldn’t find anything about this in the debug log…

_Issue 2:_  
The state topic isn’t processed properly resulting in a out of sync state (Homey reports a ‘Off’ state while the device is turned on and the other way around)

When setting homie/deviceid/Stekker\_1/cmnd/POWER to ON/OFF manually (or via the homey device in case it is in sync) the device responds as expected, the state topic is also updated but the change isn’t processed by the mqtt hub app.

The topic is monitored properly it seems as the log reports:

> 20191212-21:47:01 message: Stekker\_1/stat/POWER with value: ON  
> [turned on using manual mqtt message here]  
> 20191212-21:45:51 message: Stekker\_1/stat/POWER with value: OFF  
> 20191212-21:45:50 message: christmas-bedroom/onoff with value: false  
> 20191212-21:45:50 Homie set value [christmas-bedroom.onoff]: false

However it does not result in a ‘Homie set value [christmas-bedroom.onoff]: true’

Looking forward to your reply 🙂

Edit: typo

---

<div class="post-metadata">

**Author:** ![Paul\_Kessels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/paul_kessels/32/3750_2.png) [@Paul\_Kessels](https://community.homey.app/u/Paul_Kessels)\
**Post date:** [December 14, 2019, 5:15pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/700 "2019-12-14T17:15:11Z")

</div>

@HarriedeGroot Thanks for all the great work. I have setup everything as described (Synology + Homey) and it seems to work 🙂 The only thing which happens is that Home Assistant loses connection with all devices after a while. This then requires a new broadcast for the devices to appear and work again. Is there a way to not lose connection? I also have my NAS on a autoschedule to turn off during nighttime and restart in the morning. Not sure if that is a problem too. I understand that this has to do with the settings of the birth & last will messages? I couldn’t find a simple explanation / guideline of how I should/can set these up to avoid the necessity of manual broadcasts. Thanks!

---

<div class="post-metadata">

**Author:** ![Tangodelta](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tangodelta/32/9471_2.png) [@Tangodelta](https://community.homey.app/u/Tangodelta)\
**Post date:** [December 14, 2019, 5:47pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/701 "2019-12-14T17:47:22Z")

</div>

I had the same problem, located the problem to Homey itself, solved by making a flow, restarting MQTT client, broker and hub, after waking up server for the day, and a scheduled restart of Homey at 05:00! Now working flawless, Good luck!

---

<div class="post-metadata">

**Author:** ![Magnus\_P](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/magnus_p/32/4344_2.png) [@Magnus\_P](https://community.homey.app/u/Magnus_P)\
**Post date:** [December 17, 2019, 10:23am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/703 "2019-12-17T10:23:51Z")

</div>

Hi all!  
Trying to use MQTT Hub to integrate in [Node-RED](https://nodered.org/) using the [Homie-Convention Node](https://flows.nodered.org/node/node-red-contrib-homie-convention).

The problem I encounter, also expressed from the developer is this Node-Red Homie Convention Node relies on the mqtt broker as a persistent database i.e the MQTT messages should be set as **retained**. Link to [Node-RED forum topic](https://discourse.nodered.org/t/announce-node-red-contrib-homie-convention/16329/11)

I use the Homey MQTT Broker app, and It may be there the problem is since I read the MQTT Hub send retained messages, anyone who can guide me?

> **[node-red-contrib-homie-convention](https://flows.nodered.org/node/node-red-contrib-homie-convention)**
>
> Node-RED nodes for MQTT communication according to the MQTT HOMIE convention

According to the homie convention:

> The nature of the Homie convention makes it safe about duplicate messages, so the recommended QoS for reliability is **QoS 1**. All messages MUST be sent as **retained** , UNLESS stated otherwise

I interpret that if the device can’t do it the broker needs to handle it. Storing and saving QoS=0 Messages with retained flag is within the MQTT spec 3.3(?). The broker even should keep those messages. My question is if the Homey MQTT Broker capable of doing that?

---

<div class="post-metadata">

**Author:** ![xAPPO](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/xappo/32/13726_2.png) [@xAPPO](https://community.homey.app/u/xAPPO)\
**Post date:** [December 17, 2019, 4:42pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/704 "2019-12-17T16:42:16Z")

</div>

I use the Homey MQTT app but with an external broker and the messages are correctly sent and stored retained. The MQTT app is the component that requests this and the broker ‘should’ just do it. I would be very surprised if the internal Homey MQTT didn’t implement this.

Are you using say ‘MQTT Explorer’ as a client. If you log onto your Homey internal MQTT broker and can see the topics/payloads published by the MQTT app then they are retained.

Note that command messages ( the ones ending in a …/set topic) should NOT be sent retained.

You can’t configure an MQTT broker to retain messages by default, they must be originated as ‘retain’

Kevin

---

<div class="post-metadata">

**Author:** ![Magnus\_P](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/magnus_p/32/4344_2.png) [@Magnus\_P](https://community.homey.app/u/Magnus_P)\
**Post date:** [December 17, 2019, 6:08pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/705 "2019-12-17T18:08:12Z")

</div>

I have moved over to an external MQTT Broker on my Synonymy NAS - Mosquitto Broker. Now everything workes fine 🤙 Have no clue why the internal Homey Broker app did’t worked…

---

<div class="post-metadata">

**Author:** ![Magnus\_P](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/magnus_p/32/4344_2.png) [@Magnus\_P](https://community.homey.app/u/Magnus_P)\
**Post date:** [December 17, 2019, 7:29pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/706 "2019-12-17T19:29:10Z")

</div>

@HarriedeGroot Can you please read this [Node-RED forum topic](https://discourse.nodered.org/t/announce-node-red-contrib-homie-convention/16329/16) about the Homie Convention implementation in MQTT Hub. I have an discussion with the developer of the [node-red-contrib-homie-convention](https://flows.nodered.org/node/node-red-contrib-homie-convention) node stating a wrong implementation. I have very difficult to answer him about what is correct or not.

---

<div class="post-metadata">

**Author:** ![HarriedeGroot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/harriedegroot/32/56160_2.png) [@HarriedeGroot](https://community.homey.app/u/HarriedeGroot)\
**Post date:** [December 17, 2019, 11:03pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/707 "2019-12-17T23:03:35Z")

</div>

It’s implemented exactly as described by the Node-RED developer (and according the Homie convention).  
Did you try restarting both the client & hub apps? Looks like you’ve a (outgoing) connection problem. The current device state should be updated.

---

<div class="post-metadata">

**Author:** ![Magnus\_P](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/magnus_p/32/4344_2.png) [@Magnus\_P](https://community.homey.app/u/Magnus_P)\
**Post date:** [December 18, 2019, 7:07pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/708 "2019-12-18T19:07:05Z")

</div>

Always it is simpler solutions than you first expect… Restart of the MQTT Client and MQTT Hub helped out, now everything is up and running

[Previous page](https://community.homey.app/t/mqtt-hub-gateway/6766.md?page=34)

[Next page](https://community.homey.app/t/mqtt-hub-gateway/6766.md?page=36)
