# \[APP\]\[Pro\] MQTT Hub - Community version

**URL:** <https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463>\
**Category:** Apps\
**Tags:** app, mqtt, homey-pro\
**Created:** [July 26, 2024, 3:58pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463 "2024-07-26T15:58:53Z")\
**Posts on this page:** 20\
**Page:** 9

<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 5, 2025, 11:03am UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/169 "2025-01-05T11:03:52Z")

</div>

> [@RonnyW](#):
>
> Currently only based on capability id (meter\* vs. measure\*)?

Yeah that’s what I was thinking too, although I’m not sure of `meter` is always “total” or if it can also be “total increasing” (which means that it will always increase, but it can also be reset to 0, like “daily usage” values).

---

<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:** [January 6, 2025, 3:15pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/170 "2025-01-06T15:15:54Z")

</div>

I added the state\_class attribute to HA auto discovery:

 ![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/4/340f97508ea610130efa6339e81bc0554e6cd552.png)

 ![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/9/e97257cc80969de36a0fed45367d4033b456d1bc.png)

 ![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/f/8f76a393e2be7f870ef25b26b2cc8bfca05b7b6f.png)

Should be ok this way, right?

Harrie already started to add capability dependent values like device\_class.  
This could also be added. Buut this will need a static mapping for every capability and its HA states I think.

---

<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 6, 2025, 3:27pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/171 "2025-01-06T15:27:43Z")

</div>

> [@RonnyW](#):
>
> Should be ok this way, right?

I’m not 100% familiar with the format that HA requires, but it looks okay to me 👍🏻

---

<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:** [January 6, 2025, 6:13pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/172 "2025-01-06T18:13:42Z")

</div>

New **live version 4.3.6** :

- Fixed show/hide details in app settings.
- Added state\_class for measure/meter capabilities.

---

<div class="post-metadata">

**Author:** ![JohanW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/johanw/32/121596_2.png) [@JohanW](https://community.homey.app/u/JohanW)\
**Post date:** [January 7, 2025, 1:24pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/173 "2025-01-07T13:24:00Z")

</div>

Hi!  
Pretty new Homey User so bare with me 🙂  
I added my Nibe Heatpump as a MQTT Device with MQTT-hub and client…  
Works perfectly good except I´m missing a capability for a quite important value.  
Its called “Degree Minutes” and is a negativ 16-bit value (normally between -60 and -2000)  
The raw MQTT json looks like below.  
I´m struggling to find a capability to match it ot, I saw one of the previous post about custom cababilites but it it possible to solve in any good way?

Thank you 🙂

{  
“register”: “43005”,  
“factor”: 10,  
“size”: “s16”,  
“mode”: “R/W”,  
“titel”: “Degree Minutes (16 bit)”,  
“info”: “Degree minutes, 16bit value (-32768 \< x \< 32767). Values outside valid values are rounded to the closest valid value.”,  
“unit”: “”,  
“min”: “-30000”,  
“max”: “30000”,  
“logset”: false,  
“data”: -56,  
“raw\_data”: -56,  
“timestamp”: 1736256148208  
}

---

<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:** [January 7, 2025, 5:25pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/174 "2025-01-07T17:25:09Z")

</div>

New **test version 4.3.7** :

- Added generic Number and Text capabilities.

> **[MQTT Hub](https://homey.app/en-us/app/org.mqtt.hub/MQTT-Hub/)**
>
> Turn your Homey into a HUB and let external applications discover & control all your connected devices.

@JohanW  
Standard Homey capabilities are use case specific (don’t know a better description). They all have a meaning or unit.  
So I just added two generic capabilities to the app: “Number” and “Text”.  
That are simple capabilities to store numbers or strings without unit or other dependencies.  
There is also a capability changed trigger added.  
Please install the test version (link above) and try it this fits your needs.

---

<div class="post-metadata">

**Author:** ![JohanW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/johanw/32/121596_2.png) [@JohanW](https://community.homey.app/u/JohanW)\
**Post date:** [January 7, 2025, 7:22pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/175 "2025-01-07T19:22:46Z")

</div>

Thanks for the swift reply, seem to work perfectly as far as I can see 🙂

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/2/c2f7836f7f9f9fe1259259a689d54c2c81bd808f.jpeg)

---

<div class="post-metadata">

**Author:** ![Marius\_Stensrod](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marius_stensrod/32/56540_2.png) [@Marius\_Stensrod](https://community.homey.app/u/Marius_Stensrod)\
**Post date:** [January 8, 2025, 7:41pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/176 "2025-01-08T19:41:12Z")

</div>

Hello @RonnyW ,

Running latest version of your app. For some reason, my tamper alarm, motion alarm, switches and locks only get published as “sensor” in MQTT, and then it broke my HA Devices/Automations from devices in Homey . Do you have any clue why this happened?  
 ![bilde](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/c/dccb3ae205278b90b2bcd1a39465a2f0aa9058cc.png)  
Old:  
 ![bilde](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/4/14e0d1da149a1f5b10bc41fbc94051ff101fcc5e.png)  
New:  
 ![bilde](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/e/deda54328ff91a6e98aafbe033b7ba9b123f85ba.png)

---

<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:** [January 8, 2025, 7:58pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/177 "2025-01-08T19:58:50Z")

</div>

I published a new test version that should fix this bug. Can you please check and give a feedback? If it’s ok again, I want to release it to live channel asap.

Thanks for your feedback and sorry for the circumstances 🙂

> **[MQTT Hub](https://homey.app/en-us/app/org.mqtt.hub/MQTT-Hub/)**
>
> Turn your Homey into a HUB and let external applications discover & control all your connected devices.

---

<div class="post-metadata">

**Author:** ![Marius\_Stensrod](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marius_stensrod/32/56540_2.png) [@Marius\_Stensrod](https://community.homey.app/u/Marius_Stensrod)\
**Post date:** [January 8, 2025, 8:02pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/178 "2025-01-08T20:02:34Z")

</div>

@RonnyW , Thanks! You can publish to live.

---

<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:** [January 8, 2025, 8:07pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/179 "2025-01-08T20:07:10Z")

</div>

Thanks, 4.3.9 is live now.

---

<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:** [January 9, 2025, 8:59pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/180 "2025-01-09T20:59:02Z")

</div>

New **test version 4.3.10** :

- Added **capability specific device\_class** for HA auto discovery.

This added a device\_class attribute for sensors that are passed to MQTT HA auto discovery.

If anyone wants to check if the mapping is correct:

That’s the mapping:

- [homey.mqtthub/dispatchers/capability\_config.js at main · RonnyWinkler/homey.mqtthub · GitHub](https://github.com/RonnyWinkler/homey.mqtthub/blob/main/dispatchers/capability_config.js#L171)

That are the device classes used:

- [Sensor entity | Home Assistant Developer Docs](https://developers.home-assistant.io/docs/core/entity/sensor/#available-device-classes)
- [Binary sensor entity | Home Assistant Developer Docs](https://developers.home-assistant.io/docs/core/entity/binary-sensor#available-device-classes)

Please let me know if you notice any wrong states in your HA entities.

---

<div class="post-metadata">

**Author:** ![Greg\_McKinney](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/greg_mckinney/32/81500_2.png) [@Greg\_McKinney](https://community.homey.app/u/Greg_McKinney)\
**Post date:** [January 13, 2025, 2:25am UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/181 "2025-01-13T02:25:45Z")

</div>

I have a Linknlink motion detector connected to the Homey MQTT Broker. I can see messages being correctly sent with MQTT Explorer. I also have the Homey MQTT Hub installed. I have a MQTT Client installed, but I don’t think I need it for this configuration.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/3/23dd80411ceb30774e98d00d7a4aeebd322a139a.jpeg)

{  
“alarm\_motion”: {  
“capability”: “alarm\_motion”,  
“stateTopic”: “home/e04b4100adac0000000000007bac0000\_m/status”,  
“setTopic”: “”,  
“valueTemplate”: “$.pir\_detected”,  
“outputTemplate”: “”,  
“displayName”: “Motion alarm”  
}  
}  
I added a MQTT device. I have tried many variations in the valueTemplate format, but the device is not showing any values being received. The history stays blank, but I see the status toggling between 0 and 1. Please help.

---

<div class="post-metadata">

**Author:** ![OH2TH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/oh2th/32/111414_2.png) [@OH2TH](https://community.homey.app/u/OH2TH)\
**Post date:** [January 13, 2025, 3:29am UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/182 "2025-01-13T03:29:39Z")

</div>

MQTT Hub uses the MQTT Client to connect with the broker. So yes, you need both for it to work.

---

<div class="post-metadata">

**Author:** ![Greg\_McKinney](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/greg_mckinney/32/81500_2.png) [@Greg\_McKinney](https://community.homey.app/u/Greg_McKinney)\
**Post date:** [January 13, 2025, 3:43am UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/183 "2025-01-13T03:43:07Z")

</div>

I tried with and without the MQTT Client. How do I verify that the client is configured correctly? The MQTT Client logs don’t flag anything for me.

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

---

<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:** [January 13, 2025, 5:56am UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/184 "2025-01-13T05:56:02Z")

</div>

Your Mqtt topic doesn’t have a boolean value used by an alarm\_motion capability. You have to convert it to true/false.  
This would be easy with MathJS conversion. But you also have a JSON string as value that needs to pe parsed.  
So I think a JS function is needed.

Please try this as value template (not checked, just as idea).

```auto
(value) => { return (JSON.parse(value).pir_detected == 1) }
 

```

---

<div class="post-metadata">

**Author:** ![Greg\_McKinney](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/greg_mckinney/32/81500_2.png) [@Greg\_McKinney](https://community.homey.app/u/Greg_McKinney)\
**Post date:** [January 13, 2025, 9:58pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/185 "2025-01-13T21:58:32Z")

</div>

I tried this:

```auto
{
  "alarm_motion": {
    "capability": "alarm_motion",
    "stateTopic": "home/e04b4100adac0000000000007bac0000_m/status",
    "setTopic": "",
    "valueTemplate": "(value) => { return (JSON.parse(value).pir_detected == 1) }",
    "outputTemplate": "",
    "displayName": "Motion"
  }
}

```

I also tried:  
“valueTemplate”: “(JSON.parse(value).pir\_detected == 1)”

“valueTemplate”: “($.pir\_detected == 1)”

I have tried some other variations too, but no data is showing up in the MQTT device. Is there any source or tools that I can use for figuring this out?

---

<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:** [January 13, 2025, 10:44pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/186 "2025-01-13T22:44:27Z")

</div>

Please format code by using the `</>` button.  
Because when you actually use fancy qoutes nothing works  
`“` ❌  
`"` ✅

---

<div class="post-metadata">

**Author:** ![luguber](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/luguber/32/16795_2.png) [@luguber](https://community.homey.app/u/luguber)\
**Post date:** [January 14, 2025, 9:43am UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/188 "2025-01-14T09:43:33Z")

</div>

Hi,

Is it possible to set number of decimals in a capability?  
I have a capability like this:

```auto
  "measure_monetary.import.0": {
    "capability": "measure_monetary",
    "stateTopic": "Pow-U/prices",
    "setTopic": "",
    "valueTemplate": "$.prices.0",
    "outputTemplate": "",
    "units": "kr",
    "decimals": "4",
    "title": "Price Now"
  }

```

But, it is rounding to two decimals. (otherwise it works fine).

The source json is like this (just a small excerpt):

```auto
"prices":{"0":1.0149,"1":1.0127, ...

```

---

<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:** [January 14, 2025, 9:44pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/189 "2025-01-14T21:44:42Z")

</div>

> [@luguber](#):
>
> ```auto
> "measure_monetary.import.0": {
> "capability": "measure_monetary",
> "stateTopic": "Pow-U/prices",
> "setTopic": "",
> "valueTemplate": "$.prices.0",
> "outputTemplate": "",
> "units": "kr",
> "decimals": "4",
> "title": "Price Now"
> }
> 
> ```

```auto
    "decimals": 4,

```

should work (value as number, not as string).  
You can use all elements of capability options:

> **[Capabilities | Homey Apps SDK](https://apps.developer.homey.app/the-basics/devices/capabilities#capability-options)**
>
> A capability is a programmatic representation of a device's state.

[Previous page](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463.md?page=8)

[Next page](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463.md?page=10)
