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

<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:** [May 3, 2021, 12:53pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/951 "2021-05-03T12:53:25Z")

</div>

Wat are the allowed mired values? 153-500 is the default setting. Don’t know if these values can be read from the capability info from Homey? Homey works with a 0…1 value…

---

<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:** [May 3, 2021, 1:55pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/952 "2021-05-03T13:55:43Z")

</div>

**Version 3.4.0**

- MQTT Device: allow [mathJS](https://mathjs.org/) expressions as value template for incoming messages

Both [mathJS](https://mathjs.org/) & [jsonPath](https://github.com/dchester/jsonpath) expression are allowed as value template for incoming messages.  
The value is accessible via the `value` param if the message is a raw value.  
If the message is JSON formatted: `path.within.json` can be used to target the value.

Example: Convert incoming Wh to kWh

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/b/1be1bf29a06637e755621a6de293ef564cdf40f8.png)

---

<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:** [May 3, 2021, 3:30pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/953 "2021-05-03T15:30:02Z")

</div>

I never even heard of Mired… 😕 Long live Google! 🙂  
Now learned that a lot of questions are raise in the HA community why Mired is uses instead of the very much more commonly used Kelvin.

The desired Mired value for my Ikea bulbs would be 454.54 for most warm (2200K) and 250.00 for most cold. If I understand correctly the formula would be: Mired = 1.000.000/Kelvin.  
In MQTT Exporer see the following lines in the config. Can something be done there, or do I (as I expect) have to sort this out in HA?

 ![MQTT_Explorer_97BnBznAG2](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/b/fb6b82f0e1fa4967e5b76106f3a480b37956e90b.png)

BTW: Since the last update(s) to v3.3.0 or 3.4.0 MQTT Explorer keeps displaying red notifications “disconnected from server” which I didn’t see before. But is reconnects immediately as well (and then disconnects again). Everything is working well though…  
Can it have something to do with the updates?

---

<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:** [May 3, 2021, 3:47pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/954 "2021-05-03T15:47:36Z")

</div>

To be honest, I wouldn’t bother to much about the actual displayed value in HA. The HA temperature slider is interpreted as a % scale (0…100) and the Homey IKEA driver converts this to the appropriate temperature between the min & max of the bulb’s capability. Or do you mis any functionality?

---

<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:** [May 3, 2021, 4:48pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/955 "2021-05-03T16:48:22Z")

</div>

No the functionality is there. Is morefrom a cosmetic point of view. .

When you adjust the slider, the value is shown, just above and you can show the value right next to it.  
In the screenshot below I am adjusting the slider; the value that is now at 500 gets updated when releasing the slider.  
Those values are now incorrect.

 ![SmartSelect_20210503-184334_Photos](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/a/5a9c936cfc1c6e55a5da04ac8c3750716ac3e0f5.jpeg)

I am already very happy so far! Thanks again for all the great help!

---

<div class="post-metadata">

**Author:** ![Metatron](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/metatron/32/40136_2.png) [@Metatron](https://community.homey.app/u/Metatron)\
**Post date:** [May 3, 2021, 5:22pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/956 "2021-05-03T17:22:30Z")

</div>

Works fine, thanks a million!

---

<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:** [May 3, 2021, 8:59pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/957 "2021-05-03T20:59:54Z")

</div>

Just tried JSONpath and it’s a godsend for zigbee2mqtt! Great job!

---

<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:** [May 3, 2021, 11:19pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/958 "2021-05-03T23:19:38Z")

</div>

**Version 3.4.1**

- MQTTDevice: allow mathJS expressions as output template for outgoing messages
- MQTTDevice: removed default ‘{{value}}’ output template

For version history, see: [CHANGE\_LOG](https://github.com/harriedegroot/nl.hdg.mqtt/blob/master/CHANGE_LOG.md).

---

<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:** [May 3, 2021, 11:56pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/959 "2021-05-03T23:56:00Z")

</div>

> [@Henk\_Renting](#):
>
> MQTT Explorer keeps displaying red notifications “disconnected from server” which I didn’t see before

You have something(s) logging on to the MQTT broker twice with the same client ID

---

<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:** [May 4, 2021, 6:11am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/960 "2021-05-04T06:11:04Z")

</div>

Ah, thx for the tip!  
Will try to sort that out then!

---

<div class="post-metadata">

**Author:** ![Joost\_van\_Kempen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/joost_van_kempen/32/10067_2.png) [@Joost\_van\_Kempen](https://community.homey.app/u/Joost_van_Kempen)\
**Post date:** [May 4, 2021, 8:40pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/961 "2021-05-04T20:40:13Z")

</div>

Tnx for this great app @HarriedeGroot !! In addition to @Henk_Renting’s question on color temperature, I’ve got another one:

I’ve got a zigbee lamp on Homey that is connected to Home Assistant using MQTT. It is capable of showing different colors ánd different light temperature. (screenshot). However to change from temperature to color or the other way around, the lamp ‘mode’ has to be changed. In the Homey UI this is done by picking the other circle (screenshot).

In Homey developer you can see there is a capability ‘light\_mode’ which can be set. However, in Home Assistant it is shown as a separate sensor, not an attribute of the lamp. Is this something that can be changed in MQTT Hub? Or do I need to look somewhere else for a solution?

 ![Schermafbeelding 2021-05-04 222949](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/b/8b5ee36d4c10da63971c333c7d2716dbd90f2a4f.jpeg)

 ![Schermafbeelding 2021-05-04 223037](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/f/1f5a9ee6604235d4a3ebc2bd963803a4c231233b.jpeg)

---

<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:** [May 4, 2021, 8:43pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/962 "2021-05-04T20:43:30Z")

</div>

Unfortunately light modes is not implemented (yet).

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/5/35550bf5317a5025c530104bf222304d173eb018.png)

Screenshot from (r557):

> <https://github.com/harriedegroot/nl.hdg.mqtt/blob/master/dispatchers/HomeAssistantDispatcher.js>

---

<div class="post-metadata">

**Author:** ![Joost\_van\_Kempen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/joost_van_kempen/32/10067_2.png) [@Joost\_van\_Kempen](https://community.homey.app/u/Joost_van_Kempen)\
**Post date:** [May 4, 2021, 8:48pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/963 "2021-05-04T20:48:57Z")

</div>

I’m really trying to understand these kind of things, so maybe one day I can actually contribute with code… So out of curiosity: how can Home Assistant discover a MQTT sensor ‘light mode’ for this lamp ?

---

<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:** [May 4, 2021, 8:51pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/964 "2021-05-04T20:51:12Z")

</div>

The HA MQTT Light contains a `color_mode` config:

> **[MQTT Light](https://www.home-assistant.io/integrations/light.mqtt/)**
>
> Instructions on how to setup MQTT lights using default schema within Home Assistant.

This needs to be mapped to the Homey `light_mode` capability.  
But to be honest; I need to look into this further one day, not sure if thats the full picture…

---

<div class="post-metadata">

**Author:** ![Joost\_van\_Kempen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/joost_van_kempen/32/10067_2.png) [@Joost\_van\_Kempen](https://community.homey.app/u/Joost_van_Kempen)\
**Post date:** [May 4, 2021, 9:03pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/965 "2021-05-04T21:03:18Z")

</div>

I’m already happy the light is working and all my other devices are too, so I’ll happily wait . However I still don’t understand why HA is showing a sensor (screenshot) when there’s no mapping for light\_mode. Or do all capabilities that have no mapping show up as a sensor?

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/9/799852d0b705f2cd5020bbd08a40ff648ca62c1d.png)  
 ![Schermafbeelding 2021-05-04 225709](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/2/a2a02e6951a8fd85adb93f28886703906ff4f1dc.jpeg)

---

<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:** [May 4, 2021, 11:27pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/966 "2021-05-04T23:27:46Z")

</div>

**Version 3.4.2**

- MQTTDevice: Display capability details
- Readme update

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

For version history, see: [CHANGE\_LOG](https://github.com/harriedegroot/nl.hdg.mqtt/blob/master/CHANGE_LOG.md)

---

<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:** [May 8, 2021, 5:18pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/967 "2021-05-08T17:18:50Z")

</div>

> [@scanno](#):
>
> Retained messages should be working on the client.

It appears that the Homey MQTT Broker app is not retaining messages - 1.0.5. You need to use an external broker and then it works fine, so MQTT Client seems OK. I tested with direct broker access from MQTT Explorer too.

@scanno I know you’re busy and it’s not an issue for me as I use an external broker - just flagging it for others.

---

<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:** [May 8, 2021, 5:58pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/968 "2021-05-08T17:58:01Z")

</div>

On the MQTT broker app messages are NOT retained when the broker or homey is restarted. The messages are stored in memory, just for the simple fact that there is (or was) no database available to store messages in. That would have meant writing a storage mechanism myself. Not something that is easily done as you can imagine.

---

<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:** [May 8, 2021, 6:01pm UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/969 "2021-05-08T18:01:17Z")

</div>

**Sneak peek!**  
MQTT Device icons

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/8/28c27fa96b9db9a0fbec583489320519e428362d.png)  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/9/e9a5edf57fed8749cd552b183544096c42d4d4c2.png)

---

<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:** [May 9, 2021, 12:31am UTC](https://community.homey.app/t/mqtt-hub-gateway/6766/970 "2021-05-09T00:31:16Z")

</div>

Wow, just documenting that would have helped so many people diagnose the issues they were having with HA etc.

Don’t use the Homey based MQTT broker with MQTT Hub - use an external fully featured broker !

It would be good to update the instructions accordingly and remove the compatibility recommendation Harrie.

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

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