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

<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:** [January 18, 2019, 8:05am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/21 "2019-01-18T08:05:45Z")

</div>

Did you install the BETA version of the MQTT client?

---

<div class="post-metadata">

**Author:** ![John](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/john/32/157_2.png) [@John](https://community.homey.app/u/John)\
**Post date:** [January 18, 2019, 8:30am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/22 "2019-01-18T08:30:45Z")

</div>

I have the same issue as Stefan.  
I have the beta app MQTT Client (v.2.2.0) and MQTT Gateway (v.2.0.0).

I do get something but no state changes, I receive this topic in node red but nothing else.  
“Homey/unknown/home/system/general/state”

Rgds  
John

---

<div class="post-metadata">

**Author:** ![Stefan\_Bergh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stefan_bergh/32/3516_2.png) [@Stefan\_Bergh](https://community.homey.app/u/Stefan_Bergh)\
**Post date:** [January 18, 2019, 8:41am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/23 "2019-01-18T08:41:28Z")

</div>

Yes, I have MQTT Client 2.2.0 beta.

Wen I restarted the Gateway app yesterday I now se that something (guessing the Gateway) transmitted:

homey\_36af8cb2/status : Offline  
homey\_bac54d07/status : Offline  
homey\_79335a9b/status : Offline

I cant find anything i those “codes” which refers to any of my devices tough.

Just now i restarted the MQTT Client and now I’a also getting:

“Homey/unknown/home/system/general/state” containing the systemstatus

every 30 seconds so at least it’s transmitting something now 🙂 But still no devise state change och update.

---

<div class="post-metadata">

**Author:** ![Mattias\_Schutt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mattias_schutt/32/2959_2.png) [@Mattias\_Schutt](https://community.homey.app/u/Mattias_Schutt)\
**Post date:** [January 18, 2019, 9:41am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/24 "2019-01-18T09:41:14Z")

</div>

Same config and problem here.

---

<div class="post-metadata">

**Author:** ![Le\_Cactus](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/le_cactus/32/9727_2.png) [@Le\_Cactus](https://community.homey.app/u/Le_Cactus)\
**Post date:** [January 18, 2019, 9:57am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/25 "2019-01-18T09:57:10Z")

</div>

I was very excited after discovering the MQTT Gateway; this would be great for easy integration of some Node Red stuff. But here (using v1.00) it’s also not working. I installed through the CLI to get some extra info on what the programm is doing.

Rights after starting the app I see the following:

> Blockquote  
> .\< snip \>.  
> 20190118-10:47:28 Aqara Temperature and Humidity Sensor: aqara\_temperature\_and\_humidity\_sensor  
> 20190118-10:47:28 subscribing to topic: homey/command  
> 20190118-10:47:28 Devices registered  
> 20190118-10:47:28 FlowTriggerDispatcher: not implemented  
> 20190118-10:47:28 subscribing to topic: homey/+/+/+/+/describe  
> 20190118-10:47:28 subscribing to topic: homey/+/+/+/+/request  
> 20190118-10:47:28 subscribing to topic: homey/+/+/+/+/update  
> Notification added  
> Error: not\_found  
> at function.r.\_\_client.emit.then.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/api.js:1:1083)  
> at   
> at process.\_tickCallback (internal/process/next\_tick.js:189:7)  
> Notification added  
> Error: not\_found  
> at function.r.\_\_client.emit.then.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/api.js:1:1083)  
> at   
> at process.\_tickCallback (internal/process/next\_tick.js:189:7)  
> Notification added  
> Error: not\_found  
> at function.r.\_\_client.emit.then.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/api.js:1:1083)  
> at   
> at process.\_tickCallback (internal/process/next\_tick.js:189:7)  
> Notification added  
> Error: not\_found  
> at function.r.\_\_client.emit.then.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/api.js:1:1083)  
> at   
> at process.\_tickCallback (internal/process/next\_tick.js:189:7)

And after that I get messages like these on every state change:

> Blockquote  
> .\< snip \>.  
> 20190118-10:53:04 object Message  
> 20190118-10:53:04 PROPERTIES: {  
> “qos”: 0,  
> “retain”: false,  
> “mqttTopic”: “sensor/keuken/motion\_sensor\_keuken/alarm\_motion/state”,  
> “mqttMessage”: true  
> }  
> 20190118-10:53:05 sensor/keuken/motion\_sensor\_keuken/alarm\_motion/state: true  
> 20190118-10:53:05 object Message  
> 20190118-10:53:05 PROPERTIES: {  
> “qos”: 0,  
> “retain”: false,  
> “mqttTopic”: “sensor/keuken/motion\_sensor\_keuken/measure\_luminance/state”,  
> “mqttMessage”: 209  
> }  
> 20190118-10:53:05 sensor/keuken/motion\_sensor\_keuken/measure\_luminance/state: 209  
> 20190118-10:53:05 object Message  
> 20190118-10:53:05 PROPERTIES: {  
> “qos”: 0,  
> “retain”: false,  
> “mqttTopic”: “sensor/keuken/motion\_sensor\_keuken/alarm\_battery/state”,  
> “mqttMessage”: false  
> }  
> 20190118-10:53:05 sensor/keuken/motion\_sensor\_keuken/alarm\_battery/state: false  
> 20190118-10:53:05 object Message  
> 20190118-10:53:05 PROPERTIES: {  
> “qos”: 0,  
> “retain”: false,  
> “mqttTopic”: “sensor/keuken/motion\_sensor\_keuken/measure\_battery/state”,  
> “mqttMessage”: 79  
> }  
> 20190118-10:53:05 sensor/keuken/motion\_sensor\_keuken/measure\_battery/state: 79  
> (node:20758) UnhandledPromiseRejectionWarning: Error: not\_found  
> at function.r.\_\_client.emit.then.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/api.js:1:1083)  
> at   
> at process.\_tickCallback (internal/process/next\_tick.js:189:7)  
> (node:20758) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 16)  
> (node:20758) UnhandledPromiseRejectionWarning: Error: not\_found  
> at function.r.\_\_client.emit.then.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/api.js:1:1083)  
> at   
> at process.\_tickCallback (internal/process/next\_tick.js:189:7)  
> (node:20758) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 17)  
> (node:20758) UnhandledPromiseRejectionWarning: Error: not\_found  
> at function.r.\_\_client.emit.then.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/api.js:1:1083)  
> at   
> at process.\_tickCallback (internal/process/next\_tick.js:189:7)  
> (node:20758) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 18)  
> (node:20758) UnhandledPromiseRejectionWarning: Error: not\_found  
> at function.r.\_\_client.emit.then.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/api.js:1:1083)  
> at   
> at process.\_tickCallback (internal/process/next\_tick.js:189:7)  
> (node:20758) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 19)

I really hope this can be sloved, a program like this would really make integration with other software (like dashboards) a lot easier. So I hope you’ll find the time!

TIA, cheers,  
/Cacti

---

<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:** [January 18, 2019, 10:10am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/26 "2019-01-18T10:10:48Z")

</div>

Greet feedback guys! I’ll try to address some of these issue this evening. I did not yet upgrade my Homey tot 2.0. So some of the issues are hard to reproduce. Maybe @scanno can assist here.

---

<div class="post-metadata">

**Author:** ![Le\_Cactus](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/le_cactus/32/9727_2.png) [@Le\_Cactus](https://community.homey.app/u/Le_Cactus)\
**Post date:** [January 18, 2019, 10:35am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/27 "2019-01-18T10:35:38Z")

</div>

Hi,

I upgraded to the Beta version of MQTT Client (nl.scanno.mqtt version 2.2.0) and now it’s working!!! Loads of messages flooding my node-red! Whoohooo!!! I was on the stable version (v2.1.1). Maybe you can do version check in your in your MQTTClient.js?

Anyways, many thanks. Donation on it’s way :thumbs up:

Cheers,  
/Cacti

---

<div class="post-metadata">

**Author:** ![Stefan\_Bergh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stefan_bergh/32/3516_2.png) [@Stefan\_Bergh](https://community.homey.app/u/Stefan_Bergh)\
**Post date:** [January 18, 2019, 11:52am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/28 "2019-01-18T11:52:04Z")

</div>

Sounds great Harrie! 🙂

I tried a lot of different topics thru mqtt yesterday since I thought that I might had misunderstood the format of the topic. I know it’s suppose to resolve the device id from the name but would it be possible to have it just listen for the device-id also rather then the whole “light/room/name”. It would be great to have it just lite “homey/device-id/onoff/update/” for example. Then you could move and rename both room and device names without breaking anything.  
Just a thought 🙂

---

<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:** [January 18, 2019, 1:22pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/29 "2019-01-18T13:22:21Z")

</div>

Actually I think it’s ideal as it is because you can then subscribe to changes that happen within a device category or within a room.

---

<div class="post-metadata">

**Author:** ![Stefan\_Bergh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stefan_bergh/32/3516_2.png) [@Stefan\_Bergh](https://community.homey.app/u/Stefan_Bergh)\
**Post date:** [January 18, 2019, 1:37pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/30 "2019-01-18T13:37:08Z")

</div>

I didn’t mean that it would replace the existing way but complement it.

---

<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:** [January 18, 2019, 1:57pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/31 "2019-01-18T13:57:48Z")

</div>

U can use wildcards to accomplish this.  
Homey/+/+/name

---

<div class="post-metadata">

**Author:** ![Stefan\_Bergh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stefan_bergh/32/3516_2.png) [@Stefan\_Bergh](https://community.homey.app/u/Stefan_Bergh)\
**Post date:** [January 18, 2019, 2:03pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/32 "2019-01-18T14:03:51Z")

</div>

Yes I know, but then I can’t change the name of the device.

Just thought that as it resolves in the device-id anyway that it would be nice to be able to just use it directly instead of the name 🙂

Maybe homey/+/+/device-id can be implemented more easily then just homey/device-id?

Note, this is by no way a showstopper, just a way to make it more convenient for some users 🙂

---

<div class="post-metadata">

**Author:** ![Le\_Cactus](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/le_cactus/32/9727_2.png) [@Le\_Cactus](https://community.homey.app/u/Le_Cactus)\
**Post date:** [January 18, 2019, 2:29pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/33 "2019-01-18T14:29:56Z")

</div>

Hmmm something weird I see on incoming messages within Node Red:

> Blockquote  
> 18-1-2019 15:22:33[node: 13961c11.80cca4](http://192.168.178.241:1880/#)homey/light/woonkamer/lampen\_tv/onoff/state : msg.payload : string[4]  
> “true”  
> 18-1-2019 15:22:34[node: 13961c11.80cca4](http://192.168.178.241:1880/#)homey/light/woonkamer/lampen\_tv/onoff/state : msg.payload : string[0]  
> “”

Logging from the app seems OK:

> Blockquote  
> 20190118-15:22:22 object Message  
> 20190118-15:22:22 PROPERTIES: {  
> “qos”: 0,  
> “retain”: false,  
> “mqttTopic”: “light/woonkamer/lampen\_tv/onoff/state”,  
> “mqttMessage”: true  
> }  
> 20190118-15:22:22 light/woonkamer/lampen\_tv/onoff/state: true  
> 20190118-15:22:23 object Message  
> 20190118-15:22:23 PROPERTIES: {  
> “qos”: 0,  
> “retain”: false,  
> “mqttTopic”: “light/woonkamer/lampen\_tv/onoff/state”,  
> “mqttMessage”: false  
> }  
> 20190118-15:22:23 light/woonkamer/lampen\_tv/onoff/state: false

But “True” is being recieved when device are turned on, but “” is received when devices are turned off.

I think it’s a bug, but maybe I’m doing something wrong. Might be even be a Node Red problem. Can anybody confirm this behaviour?

TIA, Cheers,  
/Cacti

---

<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:** [January 18, 2019, 3:13pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/34 "2019-01-18T15:13:42Z")

</div>

Fixed that by checking if the capability is onoff and then creating a string as message value.

---

<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:** [January 18, 2019, 3:37pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/35 "2019-01-18T15:37:34Z")

</div>

@scanno Hi - does that mean it was an issue in MQTT client or was it an issue in MQTT gateway … that you worked around ? All MQTT messages are textual in nature aren’t they ?

Is that in GitHub now for one of the Homey apps ?

Or perhaps do you mean you worked around it in NodeRED ?

Kevin

> [@HarriedeGroot](#):
>
> Sounds like a small bug. I should have a look at it and change the values to be true and false

---

<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:** [January 18, 2019, 3:46pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/36 "2019-01-18T15:46:59Z")

</div>

It is in the Mqtt Gateway app. If you want to test, the fix is in my fork (beta branch) . Made a pull request to upstream (i.e. @HarriedeGroot)

Booleans are a bit nasty sometimes when converting to strings.

---

<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:** [January 18, 2019, 5:35pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/37 "2019-01-18T17:35:15Z")

</div>

Since the [HomeyDuino](https://community.homey.app/t/homeyduino-v2-0/6407/41) app does not updates anymore I think about to change my ESP8266 devices to use MQTT instead. Does anyone have an Arduino example to share?

I was helpt a lot in the beginning with the [examples](https://github.com/athombv/homey-arduino-library/tree/master/examples) on github for the Homeyduino.

---

<div class="post-metadata">

**Author:** ![Le\_Cactus](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/le_cactus/32/9727_2.png) [@Le\_Cactus](https://community.homey.app/u/Le_Cactus)\
**Post date:** [January 18, 2019, 5:41pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/38 "2019-01-18T17:41:33Z")

</div>

Tried that, but it’s 2.0. Could you elaborate what you changed where? I can’t seem to find it myself.

Thanks in advance.

---

<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:** [January 18, 2019, 5:54pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/39 "2019-01-18T17:54:03Z")

</div>

try

> <https://github.com/scanno/nl.hdg.mqtt/commit/f728f4fffd09e8302f6614c273652520c49381d5>

or use my master branch, guess that one is 1.5

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 18, 2019, 6:06pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/41 "2019-01-18T18:06:25Z")

</div>

Take a look [at this thread](https://community.homey.app/t/arduino-homeduino-met-esp8266-aansturen-pinnen-op-arduino/6265), a few alternatives are being discussed there.

I posted one [here](https://community.homey.app/t/arduino-homeduino-met-esp8266-aansturen-pinnen-op-arduino/6265/31), where I use the MySensors library for ESP8266 to push lightsensor readings to Homey over MQTT.

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

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