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

<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:** [March 26, 2021, 1:29pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/810 "2021-03-26T13:29:25Z")

</div>

From what I understand from Athom’s response, the client app should be modified so it always returns something that can be serialized to JSON.

---

<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:** [March 26, 2021, 1:49pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/811 "2021-03-26T13:49:19Z")

</div>

Something like this:  
let response = {  
result: -1,  
error: “”  
}

---

<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:** [March 26, 2021, 1:50pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/812 "2021-03-26T13:50:20Z")

</div>

Lol even the broker now gets rate limited when MQTT Hub is broadcasting all the states

---

<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:** [March 26, 2021, 1:53pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/813 "2021-03-26T13:53:28Z")

</div>

Or just `return {}`.

---

<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:** [March 26, 2021, 1:56pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/814 "2021-03-26T13:56:57Z")

</div>

uploaded a test build  
Well a return code with an error description could bring more possibilities in the future

---

<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:** [March 26, 2021, 1:57pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/815 "2021-03-26T13:57:24Z")

</div>

Anyway back to writing my thesis 😕

---

<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:** [March 26, 2021, 1:58pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/816 "2021-03-26T13:58:06Z")

</div>

The broker doesn’t have any flow cards though, does it?

---

<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:** [March 26, 2021, 1:58pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/817 "2021-03-26T13:58:28Z")

</div>

But adding a JSON result does not solve the startup problems

---

<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:** [March 26, 2021, 2:00pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/818 "2021-03-26T14:00:03Z")

</div>

Dos not have flow cards

but:

```
Unfortunately, your app nl.scanno.mqttbroker (v1.0.5) has crashed.

```

Error: rate\_limited  
at Remote Process  
{  
code: 429  
}  
Error: rate\_limited  
at Remote Process  
{  
code: 429  
}  
Error: rate\_limited  
at Remote Process  
{  
code: 429  
}  
Error: rate\_limited  
at Remote Process  
{  
code: 429  
}

Getting this error 😕 But dont know if its from me 🙂

---

<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:** [March 26, 2021, 2:00pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/819 "2021-03-26T14:00:50Z")

</div>

I wonder if Athom has also implemented rate limiting for API calls… 🤔

---

<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:** [March 26, 2021, 2:10pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/820 "2021-03-26T14:10:03Z")

</div>

Really dont care anymore

---

<div class="post-metadata">

**Author:** ![Henk\_Renting](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/henk_renting/32/87634_2.png) [@Henk\_Renting](https://community.homey.app/u/Henk_Renting)\
**Post date:** [March 26, 2021, 3:35pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/821 "2021-03-26T15:35:40Z")

</div>

Sorry, this is all too technical for me… 🙂  
Meanwhile the MQTT Client was automatically updated to 2.4.2 on my Homey.

Do I understand correctly that you think the problems might be solved then? Then I’d be happy to test…

Anyway, thanks @robertklep @scanno and @HarriedeGroot for your effort and time!  
I’ll buy you a beer!  
(EDIT: @robertklep Pls send me a Paypal link; as I can’t find yours… The other two have there beers already. :-))

---

<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:** [March 26, 2021, 5:37pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/822 "2021-03-26T17:37:18Z")

</div>

@scanno null is also a valid json value and can be the replacement for undefined responses if there is no error.

---

<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:** [March 26, 2021, 5:59pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/823 "2021-03-26T17:59:09Z")

</div>

The Message queue of the hub is already capable of delaying the message publishing. It’s turned of (delay 0) in the current implementation, but if the bizarre API calls rate limiting is a true fact it can probably be omitted. It won’t solve anything though, the same number of calls wil be executed eventually. It also means external platforms potentially receive state updates delayed and a broadcast will take even longer…choosing the optimal value will be random trial and error. I hope it’s not necessary to enable this.

MessageQueue: [https://www.github.com/harriedegroot/nl.hdg.mqtt/tree/master/mqtt%2FMessageQueue.js](https://www.github.com/harriedegroot/nl.hdg.mqtt/tree/master/mqtt%2FMessageQueue.js)

---

<div class="post-metadata">

**Author:** ![Robert\_Zwetsloot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robert_zwetsloot/32/12399_2.png) [@Robert\_Zwetsloot](https://community.homey.app/u/Robert_Zwetsloot)\
**Post date:** [March 26, 2021, 9:38pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/824 "2021-03-26T21:38:48Z")

</div>

Just updated to v2.4.2, it re-setteled it self smoothly, and all errors in the hub are gone.

Thanks a lot the 3 of you, will contribute to your beer cellar too.

---

<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:** [March 27, 2021, 12:20am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/825 "2021-03-27T00:20:32Z")

</div>

Updated the MQTT Hub app to SDK v3.  
Also addressed some long lasting issues and added a flowcard to trigger the broadcast.

Who is willing to test?

Available on **test** channel in the app store: [https://homey.app/nl-nl/app/nl.hdg.mqtt/MQTT-Hub/test/](https://homey.app/nl-nl/app/nl.hdg.mqtt/MQTT-Hub/test/)  
Source: [GitHub - harriedegroot/nl.hdg.mqtt: MQTT Hub/Gateway for Athom Homey](https://github.com/harriedegroot/nl.hdg.mqtt)

#### Version 3.0.0

- Upgrade to Homey SDK v3
- Added flow card to trigger a broadcast
- Removed guid from default homie topic at app install
- Delayed the initial broadcast by 30 sec.
- Removed ‘icon’ from Home Assistant payloads
- Cast enum values to string

---

<div class="post-metadata">

**Author:** ![Henk\_Renting](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/henk_renting/32/87634_2.png) [@Henk\_Renting](https://community.homey.app/u/Henk_Renting)\
**Post date:** [March 27, 2021, 7:10am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/826 "2021-03-27T07:10:54Z")

</div>

> [@HarriedeGroot](#):
>
> Who is willing to test?

Yes, will install it today.  
Thx for this update!  
No programming skills here, so don’t expect a very indepth review pls… 🙂

---

<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:** [March 27, 2021, 1:44pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/827 "2021-03-27T13:44:43Z")

</div>

Updated the **test** version of the MQTT Hub to **v3.0.0** : [https://homey.app/nl-nl/app/nl.hdg.mqtt/MQTT-Hub/test/](https://homey.app/nl-nl/app/nl.hdg.mqtt/MQTT-Hub/test/)  
So it can be installed using the app store.

---

<div class="post-metadata">

**Author:** ![rindler](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rindler/32/5501_2.png) [@rindler](https://community.homey.app/u/rindler)\
**Post date:** [March 27, 2021, 5:48pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/828 "2021-03-27T17:48:00Z")

</div>

Solved my icon issue and seems to work just fine.

---

<div class="post-metadata">

**Author:** ![Robert\_Zwetsloot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robert_zwetsloot/32/12399_2.png) [@Robert\_Zwetsloot](https://community.homey.app/u/Robert_Zwetsloot)\
**Post date:** [March 27, 2021, 10:01pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/829 "2021-03-27T22:01:33Z")

</div>

Downloaded and installed, running together with client v2.4.1.  
After a short restart battle, I got the triangle running again.  
This time restart order: broker, client , hub was the solution.  
Have no use cases for the flowcards, however a quick check, and maybe it’s me but I only have the option:  
“Als MQTT apparaat is veranderd”  
I can’t find the AND cards as shown in the examples on the app store.  
In the THEN section I only have the “Broadcast uitvoeren” option.

Again thanks a lot for all the effort!

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

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