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

<div class="post-metadata">

**Author:** ![Zimo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/zimo/32/16621_2.png) [@Zimo](https://community.homey.app/u/Zimo)\
**Post date:** [May 23, 2023, 3:52pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1194 "2023-05-23T15:52:23Z")

</div>

I have reinstalled app with 3.6.1 version and everything works as should.

---

<div class="post-metadata">

**Author:** ![SvenRhein](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@SvenRhein](https://community.homey.app/u/SvenRhein)\
**Post date:** [May 24, 2023, 8:17am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1195 "2023-05-24T08:17:28Z")

</div>

@HarriedeGroot

with my hp23 the MQTT hub crashes after a few seconds, minutes… I have no clue why - the app consumes lots of memory and crashes after a while and restarts…

Could you support me, please? version 3.6.1

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/3/93602d97c54424257da5ba24a760e0d216bb3728.png)

---

<div class="post-metadata">

**Author:** ![Tomasz\_Sacha](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tomasz_sacha/32/51772_2.png) [@Tomasz\_Sacha](https://community.homey.app/u/Tomasz_Sacha)\
**Post date:** [May 28, 2023, 8:24pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1196 "2023-05-28T20:24:17Z")

</div>

Hi after automatically upgrading honey 2019 to 8.1.4 I noticed a lack of data sent over nqtt . After several reboots of the hub. The statuses of sensors and devices started to appear but I can’t control from outside with Home Assistant . . I have tried various ways but no fix so far. Please give me a hint

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [May 28, 2023, 9:01pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1197 "2023-05-28T21:01:42Z")

</div>

Not related to FW v8.1.4, but it might help:

> [@MQTT Home Assistant - Devices shown, but can't control them](https://community.homey.app/t/mqtt-home-assistant-devices-shown-but-cant-control-them/81139/2):
>
> With my Pro 2019 I had ‘frozen’ Homey devices on HA very often.  
> Someone in the MQTT Hub app topic, pointed me to these settings, and the problems are gone.  
> It might help on a Pro 2023 as well!  
> _If I were you I would not change the **topic field** you have right now_
> 
> > ![signal-2023-05-26-025946_002](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/7/47b79db69cc2b6d74a53315567012aebf378b253.jpeg)

---

<div class="post-metadata">

**Author:** ![Teun\_Pasterkamp](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/teun_pasterkamp/32/81191_2.png) [@Teun\_Pasterkamp](https://community.homey.app/u/Teun_Pasterkamp)\
**Post date:** [July 10, 2023, 11:17am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1199 "2023-07-10T11:17:53Z")

</div>

Sorry for the late reply but started to use a Homey just a few weeks ago. After days of looking through the code I found a quick and dirty solution for your problem. In the Topics setting of the device change the text “displayName” to “title” like this:

```auto
{
  "measure_temperature": {
    "capability": "measure_temperature",
    "stateTopic": "ECODAN/tele/0x0B",
    "commandTopic": "",
    "valueTemplate": "Outside_Temperature",
    "outputTemplate": "",
    "title": "Outside"
  }

```

instead of (faulty):

```auto
{
  "measure_temperature": {
    "capability": "measure_temperature",
    "stateTopic": "ECODAN/tele/0x0B",
    "commandTopic": "",
    "valueTemplate": "Outside_Temperature",
    "outputTemplate": "",
    "displayName": "Outside"
  }

```

Hope this helps

---

<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:** [July 10, 2023, 2:39pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1201 "2023-07-10T14:39:05Z")

</div>

You can use an outputTemplate with JSON-T notation like:

```auto
{ “SetRoomTemperature” : {{value}} }

```

from example:

> [@MQTT Hub/Gateway](https://community.homey.app/t/mqtt-hub-gateway/6766/842):
>
> MQTT Devices are now able to handle JSON input & output. Version 3.1.0 MQTT device: grab input value from json messages (jsonPath) MQTT device: format output message payload to json (JSON-T template) I added two optional config parameters per capability: value path: point to a value within the JSON payload of the state messate using [JSONPath](https://github.com/dchester/jsonpath#readme). output template: format the output using [JSON-T](https://github.com/lightsofapollo/json-templater). Both string & object output are supported. All values from the device state (capabilities)…

Tested by @robertklep:

> [@How to call a Homey script from an App](https://community.homey.app/t/how-to-call-a-homey-script-from-an-app/84313/15):
>
> And also make sure everything is properly quoted. Here’s an example I’m testing with, which is working fine: { "measure\_battery": { "capability": "measure\_battery", "stateTopic": "test/state", "setTopic": "test/set", "valueTemplate": "$.value", "outputTemplate": "{\"xxx\":{{value}}}", "displayName": "Battery" } } Pushing a value: $ mqtt\_pub -vh 192.168.23.2 'test/state' '{"value":80}' Output (on the test/set topic): {"xxx":80}

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [July 10, 2023, 7:32pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1202 "2023-07-10T19:32:49Z")

</div>

Hello @HarriedeGroot  
would it be possible to add additional states to exported capabilities?

Example:  
I export meter\_water and meter\_gas and want to use it in HA for energy dashboard.  
But these entities can only be added if they have attributes like:  
device\_class: gas  
state\_class: total\_increasing

The Hub only seems to export friendly\_name and unit, but nothing capability based.  
Do you think this could be added to device.\_publishMessage()? I could add some cases if you want and create PR. Or is there a better way? An alternative could be to add attributes to for devices in app settings, but this would need more adjustments.

Edit:  
I just added a template sensor to HA which inlo takes the value from the Mqtt sensor and added device\_class and state\_class.

---

<div class="post-metadata">

**Author:** ![rkollman](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rkollman/32/41874_2.png) [@rkollman](https://community.homey.app/u/rkollman)\
**Post date:** [July 11, 2023, 6:05pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1203 "2023-07-11T18:05:09Z")

</div>

That works great for me! Now finally the displayname shows the correct name and also at the insights-page.

Thanks for your reply!

---

<div class="post-metadata">

**Author:** ![Bos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bos/32/8527_2.png) [@Bos](https://community.homey.app/u/Bos)\
**Post date:** [July 29, 2023, 11:16pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1204 "2023-07-29T23:16:16Z")

</div>

Hi,

I successfully connected the ovos/mycroft voice assistance with mqtt hub. This mqtt hub has endless possibilities compared to a straight forward mqtt solution.

I use the skill-homey voor ovos/mycroft and in this skill I have the option to select a location/room. This enables me to switch a specific light in a room, e.g “switch light in office”. Unfortunately, i do not see the homey locations being send over mqtt by hub. I expected this to happen, because I see all my devices including room in the “devices” menu of the Hub.

Can I receive room information over mqtt?

thanks Menne

---

<div class="post-metadata">

**Author:** ![Brian\_Monninkhof](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/brian_monninkhof/32/59307_2.png) [@Brian\_Monninkhof](https://community.homey.app/u/Brian_Monninkhof)\
**Post date:** [August 7, 2023, 9:28am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1205 "2023-08-07T09:28:33Z")

</div>

hello everyone, I am trying to get all my devices from FHEM (on my RPI) to Homey. I am a bit confused with the MQTThub. I think it’s a tool to export the devices from the Homey to for example home assistant. I need the other way around.

---

<div class="post-metadata">

**Author:** ![Undertaker](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/undertaker/32/53278_2.png) [@Undertaker](https://community.homey.app/u/Undertaker)\
**Post date:** [August 7, 2023, 9:48am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1206 "2023-08-07T09:48:10Z")

</div>

> **[Home Assistant Community](https://homey.app/de-de/app/io.home-assistant.community/Home-Assistant-Community/)**
>
> Verbinde dich mit Home Assistant

---

<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:** [August 7, 2023, 10:06am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1207 "2023-08-07T10:06:10Z")

</div>

You can also use MQTT devices to create virtual devices with capabilities bound to MQTT topics.

---

<div class="post-metadata">

**Author:** ![Brian\_Monninkhof](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/brian_monninkhof/32/59307_2.png) [@Brian\_Monninkhof](https://community.homey.app/u/Brian_Monninkhof)\
**Post date:** [August 7, 2023, 1:04pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1208 "2023-08-07T13:04:59Z")

</div>

were can I find the information to create virtual devices and bound those MQTT topics?

 ![Scherm­afbeelding 2023-08-07 om 15.11.43](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/2/22141300f5c1c19a2832295889dd997d85b7d50f.png)  
I can add this to my homey, but don’t know how to proceed.

---

<div class="post-metadata">

**Author:** ![Kringloper](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kringloper/32/70714_2.png) [@Kringloper](https://community.homey.app/u/Kringloper)\
**Post date:** [August 7, 2023, 2:44pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1209 "2023-08-07T14:44:09Z")

</div>

You can’t see the buttons at the bottom of the wizard. Try clicking in the right lower corner to proceed.

---

<div class="post-metadata">

**Author:** ![Brian\_Monninkhof](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/brian_monninkhof/32/59307_2.png) [@Brian\_Monninkhof](https://community.homey.app/u/Brian_Monninkhof)\
**Post date:** [August 7, 2023, 3:09pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1210 "2023-08-07T15:09:11Z")

</div>

Thanks, if everything would be that simple 🙂 I found the button and fixed it!  
I can control my lights now! I am really happy now.

---

<div class="post-metadata">

**Author:** ![Janbuijs91](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/janbuijs91/32/34384_2.png) [@Janbuijs91](https://community.homey.app/u/Janbuijs91)\
**Post date:** [August 8, 2023, 8:35pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1211 "2023-08-08T20:35:54Z")

</div>

I was wondering if it’s possible to add capabilities that are not in the dropdown when adding a custom MQTT device?

I’m tinkering with a mmWave presence detector connected to an ESP32 microcontroller and I programmed MQTT publishing to Homey on it using the Arduino IDE. This app seems to be the ideal way to add it to Homey and I basically have it working now, just not with the correct capabilities:

 ![Schermafbeelding 2023-08-08 222027](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/a/3af1cf41aba92df629529d9962886bf9302d6fff.png)

The sensor has a “distance” property and an “energy” property (basically the signal strength in percentage, so 0-100). As you can see, I added the distance topic as rain capability (measure\_rain) because that seems to be the only one in there measuring a distance/length and I added the energy/signal strength topic as humidity (measure\_humidity).  
It works, but isn’t there a way of adding a more appropriate capability for those?

Apart from this, thanks for the app! I also use it to let Homey communicate to HA and that part works flawlessly.

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [August 8, 2023, 9:17pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1212 "2023-08-08T21:17:31Z")

</div>

> [@Janbuijs91](#):
>
> let Homey communicate to HA

With the [Home Assistant Community app](https://community.homey.app/t/71477), you can add HA devices as you like, add and remove entities from a device as well

 ![Screenshot_20230808-231648_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/b/cbf10b7a561ef334e9acee9a1db3d66822e25a28.jpeg)

---

<div class="post-metadata">

**Author:** ![Janbuijs91](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/janbuijs91/32/34384_2.png) [@Janbuijs91](https://community.homey.app/u/Janbuijs91)\
**Post date:** [August 9, 2023, 11:28am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1214 "2023-08-09T11:28:25Z")

</div>

Funny, I hadn’t even thought of adding it to HA directly instead of adding it to Homey first (and then read the values in HA).  
Probably because I use Homey for all the logic for flows and use HA mainly for my dashboard, so Home Assistant has almost no device added directly added to it but communicates with Homey for that (using this MQTT Hub app).

Wouldn’t there be any noticable lag if you add a sensor to HA first and then send its values to Homey for use in flows instead of adding it to Homey directly?

---

<div class="post-metadata">

**Author:** ![Undertaker](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/undertaker/32/53278_2.png) [@Undertaker](https://community.homey.app/u/Undertaker)\
**Post date:** [August 9, 2023, 1:03pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1215 "2023-08-09T13:03:12Z")

</div>

> [@Janbuijs91](#):
>
> Wouldn’t there be any noticable lag if you add a sensor to HA first and then send its values to Homey for use in flows instead of adding it to Homey directly?

No, it works in real time.

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [August 9, 2023, 6:39pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/1216 "2023-08-09T18:39:07Z")

</div>

Well, you’ll be surprised. As example, most of my zigbee devices respond around 1s quicker than using native Homey (2019) zigbee, but when you look at the steps below it you’d expect the opposite:  
Zigbee motion sensor event \> zigbee2mqtt add-on \> wifi \> Homey flow gets triggered and sends a command to turn on a zigbee light \> wifi \> zigbee2mqtt add-on \> zigbee light turns on

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

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