# \[App\]\[Pro\] MQTT Broker for Homey

**URL:** <https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129>\
**Category:** Apps\
**Tags:** app, tools\
**Created:** [December 8, 2018, 7:18pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129 "2018-12-08T19:18:31Z")\
**Posts on this page:** 20\
**Page:** 1

<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:** [December 8, 2018, 7:18pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/1 "2018-12-08T19:18:31Z")

</div>

# MQTT Broker for Homey

Since this post was on the old forum, i decided to post it also in the new forum.

 ![](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/d/d6c2432cdebfae88ba1bbc84271e8aaccf4bb8a2.jpeg)

Today the MQTT Broker App has been released in the App store beta channel.

With this App it is now possible to have a complete MQTT Broker on Homey. The app is based on the Mosca nodejs library. The Mosca library is a library that is used to implement a MQTT Broker on a web based platform using nodejs.

So you no longer need to install a MQTT Broker on a NAS, homeserver or use a MQTT Broker in the cloud. You can simply install one on your Homey ([MQTT Broker | Homey](https://apps.athom.com/app/nl.scanno.mqttbroker) ).

**What is a MQTT broker?**  
A MQTT Broker is a service that provides a Publish / Subscribe mechanism often used in IoT solutions. This means that an App or Device can subscribe to a topic. When another App or Device publishes a message on that topic, all Apps or devices subscribed to that topic, will receive that message.

**What do I need?**  
You just have to install the MQTT Broker for Homey App and go to its settings page. There you have to provide the IP port you want the broker to listen on for messages. If you don’t know what to enter there, use the default 1883 value.  
Second you will need to enter usernames and passwords for Apps or Devices that need to have access to the Broker. And that’s 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:** [December 8, 2018, 7:20pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/2 "2018-12-08T19:20:35Z")

</div>

# **Selfsigned certificates**

With the MQTT broker for Homey it is possible to generate selfsigend certificates to enable TLS connections. Using offically signed certificates is always better, but not everybody knows how to do this and even with a service like Letsencrypt it is still difficult to do so without having a running HTTP server that is connected to the internet.

Generating a selfsigned certificate is very easy with the MQTT Broker for Homey. After you have installed the MQTT Broker for Homey from the App Store, go to the settings page an go to the Session Settings. On that page check the _ **Generate a selfsigned** _ certificate checkbox.

In the _ **CommonName** _ field enter the DNS name where your Homey resolves to (or use the internet IP adress). As default the **Days Valid** field is set to 365 days. That means that the certificate will be valid for 365 days. After 365 days you will need to generate a new one.

 ![](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/5/57049b7fc9f7361599fd1fffe0edd66b5a471362.png)

After entering the CommonName field, just press the Generate Certificate button to start generating the selfsigned certificates. Please be patient because it can take up to 30 seconds (or more) until the generation has been completed.

Once generation has been completed, you will see the Private key and Certificate text boxes filled with data:

 ![](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/b/b4ef1d8a1b6e55385246d698ef43779bd49bed3f.png)

After the text boxes are filled, the generation process has finished. Press the Save certificate button to save them the the internal storage of homey.

Make sure you have enabled TLS also:

 ![](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/e/e7d218f06de97da4e9af59d0a49079a9018a225f.png)

The secure connection will be available once you Stop en Start the Broker again:

![](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/4/484e051bc3c18bb8a306bd2f4333eee6bc0d5e3f.png)

Please enable Selfsigned certificates in apps like the Owntracks client and MQTT client if you use them.

---

<div class="post-metadata">

**Author:** ![Cyanopsis](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/cyanopsis/32/17840_2.png) [@Cyanopsis](https://community.homey.app/u/Cyanopsis)\
**Post date:** [November 16, 2019, 5:00pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/3 "2019-11-16T17:00:27Z")

</div>

Quick question: does retained messages work with this broker? I’m trying to attach a device which should react to retained messages if the device is disconnected or woken up from deep sleep. However, the retained message doesn’t seem to be received. Switching to mosquitto without doing any other changes 🔝 my code works as expected!

---

<div class="post-metadata">

**Author:** ![Magnus\_P](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/magnus_p/32/4344_2.png) [@Magnus\_P](https://community.homey.app/u/Magnus_P)\
**Post date:** [December 6, 2019, 11:18pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/4 "2019-12-06T23:18:37Z")

</div>

Does anyone know if WebSockets is supported in the Broker app? I trying to use an MQTT IOS Dashboard but I do not get it to connect.

I test with this [http://www.hivemq.com/demos/websocket-client/](http://www.hivemq.com/demos/websocket-client/)

---

<div class="post-metadata">

**Author:** ![Ashley\_Wolf](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ashley_wolf/32/16534_2.png) [@Ashley\_Wolf](https://community.homey.app/u/Ashley_Wolf)\
**Post date:** [December 10, 2019, 6:24pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/5 "2019-12-10T18:24:53Z")

</div>

Hi guys, how do I find out whats the MQTT Host() ? Not sure how do I obtain that IP address. Need it to complete MQTT configuration of a tasmotized sonoff.

---

<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:** [December 10, 2019, 8:06pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/6 "2019-12-10T20:06:08Z")

</div>

You need the op adres of your Homey?  
In the homey app:  
Settings / General / About

---

<div class="post-metadata">

**Author:** ![Tim\_Hyrup](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tim_hyrup/32/16580_2.png) [@Tim\_Hyrup](https://community.homey.app/u/Tim_Hyrup)\
**Post date:** [December 23, 2019, 11:26am UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/7 "2019-12-23T11:26:11Z")

</div>

Hi  
Is there anyone who can tell me how to use topic command.  
i have an esp with espeasy on and can see it in my broker. It’s a temperature sensor. How do I get tempature in a flow.

---

<div class="post-metadata">

**Author:** ![MoPepettes](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mopepettes/32/14988_2.png) [@MoPepettes](https://community.homey.app/u/MoPepettes)\
**Post date:** [August 27, 2020, 1:45pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/8 "2020-08-27T13:45:19Z")

</div>

Hi there, since a few days, my MQTT Broker is somehow rebooting many mornings between 7:20 and 7:24am, and sometimes in the afternoon.

I’ve got those messages in Homey:

The MQTT broker is UNAVAILABLE  
The MQTT broker is AVAILABLE again

I’ve got no flow that intercats with the app. The big change i’ve made lately is Node-Red MQTT connected in a Raspberry. Any thoughts?

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [August 27, 2020, 2:13pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/9 "2020-08-27T14:13:42Z")

</div>

U get the same when WiFi is down:

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/b/7bc80b6fe2c3babe2b8e30b22e6f1cd097d9b8b1.jpeg)

---

<div class="post-metadata">

**Author:** ![MoPepettes](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mopepettes/32/14988_2.png) [@MoPepettes](https://community.homey.app/u/MoPepettes)\
**Post date:** [August 27, 2020, 3:06pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/10 "2020-08-27T15:06:25Z")

</div>

So it may be my Orbi that’s reseting the connection with Homey? I’ll take a look into that, thanks.

---

<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, 4:38pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/11 "2021-05-08T16:38:16Z")

</div>

> [@Cyanopsis](#):
>
> Quick question: does retained messages work with this broker? I’m trying to attach a device which should react to retained messages if the device is disconnected or woken up from deep sleep. However, the retained message doesn’t seem to be received. Switching to mosquitto without doing any other changes 🔝 my code works as expected!

Was this ever ascertained? I too think they may not be being correctly retained.

---

<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:54pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/12 "2021-05-08T17:54:37Z")

</div>

On this broker 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:** ![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:28am UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/13 "2021-05-09T00:28:49Z")

</div>

You should really state that in the ‘not implemented’ features

---

<div class="post-metadata">

**Author:** ![Felho](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/felho/32/38916_2.png) [@Felho](https://community.homey.app/u/Felho)\
**Post date:** [October 19, 2021, 10:53am UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/14 "2021-10-19T10:53:09Z")

</div>

I set my homey mqtt broker there are all family member owntrecks but I not see all member, only one. can you tell why? Or I need install mqtt my synology and that is work fine… I need help. thanks .  
I installed the homey mqtt broker and location & persence and iPhone owntracks. I only 1 account add to mqtt broker that is I used location app configuration  
And the owntracks settings dns and separate userid like wife name and childrens name but same password make broker settings. There is connection is connected. And see all devices location & presence app configuration page.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/6/e61d2c2ecb95582f694d86862bf0e809dca44d6e.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/a/7a9ea6a1847878b562d77f87d1dbc3a4c05d3113.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/a/cabd998c0b5df5805b333cbcf0995fe6838b04b8.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/d/4d27551d501f1480324a87284dd51fd85c2be792.jpeg)

---

<div class="post-metadata">

**Author:** ![Ludvig](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ludvig/32/129091_2.png) [@Ludvig](https://community.homey.app/u/Ludvig)\
**Post date:** [February 20, 2022, 4:08pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/15 "2022-02-20T16:08:11Z")

</div>

Hey. Im building a MQTT dashboard for Homey, [SpaceHomey](https://community.homey.app/t/spacehomey-just-another-dashboard-nextjs-react-mqtt/60439). In this Im using MQTT to create it. The problem with web is that you need Web Socket to be able to talk to MQTT. For me I have a separate mosquito server running where I have enabled it but I want to make it simple for everyone else. Is it possible to add the option to this app to enable Web Socket? Then users can just use this app together with MQTT Hub and we are good go.

---

<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:** [February 20, 2022, 4:36pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/16 "2022-02-20T16:36:07Z")

</div>

Hey. The MQTT broker needs a complete overhaul because the used node library has been depricated. But is was possible to use a websocket as far as I can remember. But as said, I need to find a replacement MQTT broker library I can use.

---

<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 19, 2022, 5:54pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/17 "2022-03-19T17:54:12Z")

</div>

Hi all,

I have mentioned this before, but the MQTT broker app is based on the Mosca MQTT library. The problem is that this library is not maintained anymore and has the depricated status. If I keep using Mosca there will be a moment it will stop working.

However, there is a replacement called Aedes and currently I am trying to get the MQTT broker app up and running using Aedes.

I have the app running with the new Aedes library (still needs some work to get all the settings working). But I need your help to test everything. At first glance everything seems to be working and with less memory usage as far as I can tell. This is with roughly the same functionality as the current app.

Please let me know if you want to test the new broker version as soon as it is ready for testing. I would not want to release it and find out half of the users have problems.

---

<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:** [March 20, 2022, 1:04am UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/18 "2022-03-20T01:04:51Z")

</div>

Will it handle retained topics ?

---

<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:** [March 20, 2022, 1:50am UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/19 "2022-03-20T01:50:07Z")

</div>

I would be happy to test for you

---

<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:** [March 20, 2022, 4:54am UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/20 "2022-03-20T04:54:00Z")

</div>

I’d like to help testing too

[Next page](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129.md?page=2)
