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

<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 14, 2019, 6:59pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1 "2019-01-14T18:59:50Z")

</div>

The main problems I’m facing with Homey are:

1. There is no ‘customizable dashboard’ (yet).
2. I’d like to create some more advanced flows (with PID controllers, multiple in- & outputs, share (sub-)flows, inject script, etc.), without losing the overview (all in one screen).
3. The ease of integrating Homey with other systems, besides installing or writing a custom app.

My way of trying to address these problems (all 3 at once) is the creation of a [MQTT Gateway](https://github.com/harriedegroot/nl.hdg.mqtt) **app**. Now 2-way communication with Homey becomes available, using the industry standard for IoT messaging: MQTT. This protocol is already implemented by most of the other Home Automation systems.

The first release of the MQTT gateway app (Homey 1.5 & 2.0 support) is already submitted to the app store and currently in review by Athom. NOTE: It’s still experimental!

Personally I’m using the MQTT protocol to communicate with [Node RED](https://nodered.org/)and I’m creating a dashboard with [Node RED Dashboard](https://flows.nodered.org/node/node-red-dashboard).

What are your thoughts?

---

<div class="post-metadata">

**Author:** ![Marlon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marlon/32/3794_2.png) [@Marlon](https://community.homey.app/u/Marlon)\
**Post date:** [January 14, 2019, 7:41pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/2 "2019-01-14T19:41:36Z")

</div>

I think this app is a blessing and will solve many current issues regarding flow automation’s. Thus reducing the amount of flows needed for the more complex tasks. And in combination with Virtual Devices it will certainly be an extremely powerful combo. This is exactly what I was looking for! 🍻

---

<div class="post-metadata">

**Author:** ![Sjalabert](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sjalabert/32/11432_2.png) [@Sjalabert](https://community.homey.app/u/Sjalabert)\
**Post date:** [January 14, 2019, 8:18pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/3 "2019-01-14T20:18:52Z")

</div>

Harrie you are ons of the best !!

---

<div class="post-metadata">

**Author:** ![Blarp](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/blarp/32/10278_2.png) [@Blarp](https://community.homey.app/u/Blarp)\
**Post date:** [January 14, 2019, 8:20pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/4 "2019-01-14T20:20:33Z")

</div>

Is your intention to make a sort of live connection from Homey to Node RED? (your number 3)

Tasmota Espurna and the like are using MQTT discovery to ease the connection of devices in Home Assistant. (Domoticz is using this as wel I think)  
The devices are automaticly appearing in HA if the devices have this feature enabled.

---

<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 14, 2019, 8:22pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/5 "2019-01-14T20:22:10Z")

</div>

Yes, that would be a nice one to implement!  
The ‘request’ command already covers this partly. Just need to implement the discovery protocol.

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [January 14, 2019, 9:56pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/6 "2019-01-14T21:56:31Z")

</div>

Just out of curiosity how does this differ from the current MQTT client/server apps?

---

<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 14, 2019, 10:02pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/7 "2019-01-14T22:02:23Z")

</div>

This app makes use of the MQTT Client to send en recieve messages.  
The client connects to a broker and provides Flow cards.  
The Gateway provides an interface for interacting with homey (so you don’t need flow cards):

## Functionality

- Dispatch device state changes for all connected devices.
- Dispatch system info (memory, cpu, etc.) on a regular basis.
- Request info (system, zone, device, capability, etc.).
- Update the state of a device (set capability).

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [January 14, 2019, 10:15pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/8 "2019-01-14T22:15:53Z")

</div>

I think I understand. Will be interested to try it.  
I currently use the MQTT client to swap information with Domoticz. Domoticz listens to my RTS remotes so homey can keep the cover states in sync. Will be interested to see if this can help.

---

<div class="post-metadata">

**Author:** ![Eelke](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eelke/32/9188_2.png) [@Eelke](https://community.homey.app/u/Eelke)\
**Post date:** [January 15, 2019, 9:33am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/9 "2019-01-15T09:33:15Z")

</div>

Nice app! I have made something simular myself but it is not Homey V2 compatible nor available for the public.

I have implemented ‘The Homie Convention’ [https://homieiot.github.io](https://homieiot.github.io) which enables you to auto discover your devices and use them for example in OpenHAB with use of their MQTT binding.

This works pretty well for me and enables you to make a dashboard using [HabPanel](https://www.openhab.org/docs/configuration/habpanel.html).

---

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

</div>

Nice! Implementing the Homie convention could be a next step forward.  
Therefore we need a mapping between Homey capabilities & Homie properties.  
Does this exist already?

Is Homie the ‘default’ implementation for other HAS? Or is it ‘just one of many’ standards?

---

<div class="post-metadata">

**Author:** ![Blarp](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/blarp/32/10278_2.png) [@Blarp](https://community.homey.app/u/Blarp)\
**Post date:** [January 15, 2019, 10:45am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/11 "2019-01-15T10:45:08Z")

</div>

From what I read about it, it is not the same although nearly equal. (Homie & HA implementation of MQTT discovery)  
I have not come across other ‘standards’ of any importance in my last evening search. HA’s MQTT discovery is more widely used in Tasmota/Espurna/Esphomelib/espeasy and that sort of thing.

Does anybody know what the differences are between Homie and HA MQTT discovery?

(PS you just can not have a conversation about this, it reminds me of Airplane (the movie):

---

<div class="post-metadata">

**Author:** ![Eelke](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eelke/32/9188_2.png) [@Eelke](https://community.homey.app/u/Eelke)\
**Post date:** [January 15, 2019, 10:55am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/12 "2019-01-15T10:55:35Z")

</div>

You can find some implementations [here](https://homieiot.github.io/implementations/#). It is not very wide spread but I couldn’t find much other standards like Blarp mentioned also.

Mapping the capabilties vs. the properties is not that hard. The standards has some special properties regarding Light/Color control which you need to adept to the correct Homey capabilities. All the other capabilities can easilly be mapped as strings, numbers (float/int) etc.

If I can assist in any way please let me know. I am willing to help. It is in all our interest to have one nice app which opens a lot of possibilities regarding dashboards, mobile apps etc.

---

<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 15, 2019, 11:17am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/13 "2019-01-15T11:17:07Z")

</div>

The [drivers reference](https://apps.developer.athom.com/tutorial-Drivers-Reference.html) contains a list of all capabilities & classes. Maybe that’s a good starting point?

---

<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 15, 2019, 11:18am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/14 "2019-01-15T11:18:54Z")

</div>

The reference at [https://developer.athom.com/docs/apps-reference](https://developer.athom.com/docs/apps-reference) is probably a better starting point, because you can view the complete definition of each capability there (if you click on the vertical ellipsis on the right).

---

<div class="post-metadata">

**Author:** ![Blarp](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/blarp/32/10278_2.png) [@Blarp](https://community.homey.app/u/Blarp)\
**Post date:** [January 15, 2019, 11:34am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/15 "2019-01-15T11:34:51Z")

</div>

Openhab has a reading about what they have done:

> **[MQTT Arrives in the Modern openHAB 2.x Architecture](https://www.openhab.org/blog/2018-12-16-mqtt-arrives-in-the-modern-openhab-2-x-architecture.html#mqtt-thing-auto-discovery)**
>
> The new MQTT bindings allow an easy point and click configuration to include your MQTT capable device into openHAB. If your device follows any supported MQTT convention, it got even simpler with full auto-discovery of all device capabilities.

They too have noticed there are two ‘standards’ Homie and HA MQTT discovery

They have decided to:  
“The new MQTT Things extension supports two conventions out-of-the-box” Homie and HA MQTT discovery

They stress:  
“It cannot be stressed enough, to consider changing existing MQTT client devices to an MQTT convention like the mentioned Homie 3.x convention. That might not be possible in some cases though.”  
The thing is, there are **few** that do.

Looks like you need both standards to accomplish a MQTT gateway.  
If you want to single out a connection to node red, then maybe homie will be enough.

Hope this helps.

---

<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 15, 2019, 11:51am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/16 "2019-01-15T11:51:05Z")

</div>

Here’s the raw JSON for each capability: [https://github.com/athombv/node-homey-lib/tree/master/assets/capability/capabilities](https://github.com/athombv/node-homey-lib/tree/master/assets/capability/capabilities)

---

<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 15, 2019, 4:49pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/17 "2019-01-15T16:49:52Z")

</div>

Harrie,

Using lights as an example is it correct that On states are reported as ‘true’ and Off states have blank content in MQTT ?

---

<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 15, 2019, 4:56pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/18 "2019-01-15T16:56:49Z")

</div>

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:** ![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 15, 2019, 4:58pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/19 "2019-01-15T16:58:25Z")

</div>

OK,  
I should probably have posted to GitHub too rather than here. Will do so in the future.

---

<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, 7:35am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/20 "2019-01-18T07:35:45Z")

</div>

This is something I really been missing with Homey so thank you for making this app!

However, I can´t get it to work. Is there something you have to activate somewhere or something else?  
I have MQTT and Node-RED running on a RPi connected to Homey via the MQTT Client app, this works great with for example gBridge. But The MQTT Gateway doesn’t seem to connect to it. There is no state changes sent to the server and no commands seems to work so I’m guessing I’m doing something wrong.  
I’m using Homey 2.0 and the beta version of you app.

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