# 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:** 20

<div class="post-metadata">

**Author:** ![Camelen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/camelen/32/9613_2.png) [@Camelen](https://community.homey.app/u/Camelen)\
**Post date:** [February 23, 2019, 11:32pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/386 "2019-02-23T23:32:30Z")

</div>

I’m waiting for athom to approve the update to MQTT client. When that’s done I’ll try to bypass my mosquitto server and make a direct connection to gBridge.

My expectation is that it will work with no adjustment to MQTT Hub. But before I’ve tried I can’t be sure.

---

<div class="post-metadata">

**Author:** ![KonradWalsh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/konradwalsh/32/147_2.png) [@KonradWalsh](https://community.homey.app/u/KonradWalsh)\
**Post date:** [February 25, 2019, 7:55am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/387 "2019-02-25T07:55:52Z")

</div>

I installed @scanno new version in github. Yes gBridge connects now and I can capture things using flows. I cant figure out how to send changes to keep gBridge status updated but nonetheless gBridge does connect to the new MQTT Client

---

<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:** [February 25, 2019, 8:13am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/388 "2019-02-25T08:13:57Z")

</div>

The hub broadcasts all device state changes (no flow cards needed). You just need to point gBridge to the correct topics I think.

---

<div class="post-metadata">

**Author:** ![KonradWalsh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/konradwalsh/32/147_2.png) [@KonradWalsh](https://community.homey.app/u/KonradWalsh)\
**Post date:** [February 25, 2019, 8:37am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/389 "2019-02-25T08:37:14Z")

</div>

Ok… I’ll play with that and see what I can do

---

<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:** [February 25, 2019, 1:40pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/390 "2019-02-25T13:40:45Z")

</div>

You can’t alter how gBridge organises it’s topics so you have to alter how MQTT-Hub sends them by setting the ROOT topic to gBridge and your DEVICEID to your gBridge userID.  
e.g.  
gBridge  
u123

This is within the homie3 spec but possibly means devices won’t be discovered by apps like openHAB as they expect a root topic named ‘homie’

---

<div class="post-metadata">

**Author:** ![Camelen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/camelen/32/9613_2.png) [@Camelen](https://community.homey.app/u/Camelen)\
**Post date:** [February 25, 2019, 2:54pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/391 "2019-02-25T14:54:39Z")

</div>

I didn’t know that openHAB expects “homie” to discover.

But you should be able to add it manually to openHAB by specifying the correct root topic and deviceid right?

---

<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:** [February 25, 2019, 2:56pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/392 "2019-02-25T14:56:54Z")

</div>

Indeed if you can configure the root topic in openHAB that should work otherwise the default would be ‘homie’. The userID should be OK as is.

I’m assuming gBridge allows creation of all the other sub topics. Using the gBridge MQTT broker creates a cloud dependency of course which slows things down. Bridging a local broker would be my recommendation.

> [@KonradWalsh](#):
>
> Meaning… gBridge will then auto create the relevant devices?

Ahh no… (gBridge does not support the homie3 spec). Instead you will have to manually create the devices through gBridge. It just means that the status and control topics are linked.

Also the default topics gBridge suggests are misleading - the /set subtopic should be on the `Action` topic not the `Status` - there is more info 4 posts below and also in the gBridge thread in this community

---

<div class="post-metadata">

**Author:** ![KonradWalsh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/konradwalsh/32/147_2.png) [@KonradWalsh](https://community.homey.app/u/KonradWalsh)\
**Post date:** [February 25, 2019, 2:57pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/393 "2019-02-25T14:57:36Z")

</div>

> [@xAPPO](#):
>
> You can’t alter how gBridge organises it’s topics so you have to alter how MQTT-Hub sends them by setting the ROOT topic to gBridge and your DEVICEID to your gBridge userID.  
> e.g.  
> gBridge  
> u123
> 
> This is within the homie3 spec but possibly means devices won’t be discovered by apps like openHAB as they expect a root topic named ‘homie’

Meaning… gBridge will then auto create the relevant devices? I am doubtful because it didnt work for me… but I might have done it wrong… maybe @pkappelt can chime in here

---

<div class="post-metadata">

**Author:** ![Camelen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/camelen/32/9613_2.png) [@Camelen](https://community.homey.app/u/Camelen)\
**Post date:** [February 25, 2019, 2:58pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/394 "2019-02-25T14:58:39Z")

</div>

No gBridge will not auto create devices. You need to create each device yourself.

Edit:  
But for this to work you need to set the correct ROOT TOPIC and DEVICEID in MQTT-Hub.  
And those values are chosen by gBridge and should be as xAPPO writes  
gBridge  
u123 (exchange 123 to your username)

---

<div class="post-metadata">

**Author:** ![KonradWalsh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/konradwalsh/32/147_2.png) [@KonradWalsh](https://community.homey.app/u/KonradWalsh)\
**Post date:** [February 25, 2019, 2:59pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/395 "2019-02-25T14:59:45Z")

</div>

so if I have a device in Homey called  
Window Lights

I would create a device in gBridge called Window Lights and set the topic to be /window\_lights/onoff

?

---

<div class="post-metadata">

**Author:** ![Camelen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/camelen/32/9613_2.png) [@Camelen](https://community.homey.app/u/Camelen)\
**Post date:** [February 25, 2019, 3:02pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/396 "2019-02-25T15:02:23Z")

</div>

In that scenario you would:

Create a device in gBridge, the name of the device is not important in the connection to Homey but should be chosen to something you’d like to say.

After it’s created you go into the device and edit the ACTION topic and STATUS topic

ACTION topic (for onoff capabilities) should be:  
/window-lights/onoff/set

STATUS topic should be:  
/window-lights/onoff

---

<div class="post-metadata">

**Author:** ![KonradWalsh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/konradwalsh/32/147_2.png) [@KonradWalsh](https://community.homey.app/u/KonradWalsh)\
**Post date:** [February 25, 2019, 3:24pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/397 "2019-02-25T15:24:52Z")

</div>

> [@Camelen](#):
>
> window-lights

so I did this in **GBridge**

_Light: Window Lights_  
Features and MQTT-Topics:  
**On and Off**  
gBridge/u\*\*\*/window-light/onoff  
gBridge/u\*\*\*/window-light/onoff/set

**Brightness**  
gBridge/u\*\*\*/window-light/brightness  
gBridge/u\*\*\*/window-light/brightness/set

* * *

**in MQTT Hub I have**

COMMUNICATION PROTOCOL - Custom  
ROOT TOPIC = gbridge  
Device ID = my u\*\*\* id from gBridge  
Include Class and Include Zone unticked or off

I hit the switch in Homey and it doesnt replicate to gBridge

---

<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:** [February 25, 2019, 3:31pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/398 "2019-02-25T15:31:21Z")

</div>

This might be better followed up in the gBridge thread … or a new one - MQTT-Hub isn’t a factor here.  
If you’d like to open a new thread I’ll see if I can help.

---

<div class="post-metadata">

**Author:** ![KonradWalsh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/konradwalsh/32/147_2.png) [@KonradWalsh](https://community.homey.app/u/KonradWalsh)\
**Post date:** [February 25, 2019, 3:34pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/399 "2019-02-25T15:34:02Z")

</div>

> [@Guide to Connecting gBridge to Homey for Google Assistant](https://community.homey.app/t/connecting-gbridge-to-homey-for-google-assistant/9234/77):
>
> Moving conversation back here as it was muddying up the MQTT Hub Thread so I did this in GBridge Light: Window Lights Features and MQTT-Topics: On and Off gBridge/u\*\*\*/window-light/onoff gBridge/u\*\*\*/window-light/onoff/set Brightness gBridge/u\*\*\*/window-light/brightness gBridge/u\*\*\*/window-light/brightness/set in MQTT Hub I have COMMUNICATION PROTOCOL - Custom ROOT TOPIC = gbridge Device ID = my u\*\*\* id from gBridge Include Class and Include Zone unticked or off I hit the switch…

---

<div class="post-metadata">

**Author:** ![scanno](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/scanno/32/8358_2.png) [@scanno](https://community.homey.app/u/scanno)\
**Post date:** [February 25, 2019, 5:23pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/400 "2019-02-25T17:23:24Z")

</div>

MQTT client is published

---

<div class="post-metadata">

**Author:** ![Leon\_van\_Efferen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/leon_van_efferen/32/6638_2.png) [@Leon\_van\_Efferen](https://community.homey.app/u/Leon_van_Efferen)\
**Post date:** [February 25, 2019, 5:39pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/401 "2019-02-25T17:39:58Z")

</div>

I might have found a little bug, when using the boolean true (in configuration.yaml), the conversion to string makes the T a capital letter. if this is already a known issue, then i’m sorry. when using the string “true” everything is working as expected.

using:  
Gateway: v.2.2.1  
Client: v2.2.1

---

<div class="post-metadata">

**Author:** ![KonradWalsh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/konradwalsh/32/147_2.png) [@KonradWalsh](https://community.homey.app/u/KonradWalsh)\
**Post date:** [February 25, 2019, 9:48pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/402 "2019-02-25T21:48:06Z")

</div>

@HarriedeGroot  
Sent you a small donation for the use of your app

---

<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:** [February 25, 2019, 9:48pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/403 "2019-02-25T21:48:44Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![PascalB](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@PascalB](https://community.homey.app/u/PascalB)\
**Post date:** [February 27, 2019, 7:36am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/404 "2019-02-27T07:36:01Z")

</div>

@HarriedeGroot

Been following this topic for a while, looks very promising and rapidly developing! I was wondering if the birth and last will messages can be used to trigger a flow? Eg, when a light bulb is switched on through a physical switch?

---

<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:** [February 27, 2019, 7:59am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/405 "2019-02-27T07:59:18Z")

</div>

Birth & last will messages are there to indicate if the hub is running or not. It’s a message like any other, so yes you can trigger a flow by using the flow cards from the MQTT Client app. I don’t understand your sample, but to be clear, you cannot turn the hub on or off by publishing to these topics.

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

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