# \[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:** 11\
**Page:** 8

<div class="post-metadata">

**Author:** ![ChrisG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chrisg/32/8825_2.png) [@ChrisG](https://community.homey.app/u/ChrisG)\
**Post date:** [June 28, 2024, 4:12pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/146 "2024-06-28T16:12:34Z")

</div>

Sorry I was too quick, because it works with a trick77. I got the idea because of this query:

[https://github.com/search?q="homey"+AND+"onUnload"&ref=opensearch&type=repositories](https://github.com/search?q=%22homey%22+AND+%22onUnload%22&ref=opensearch&type=repositories)

Now my onInit() looks like this:

```auto
this.homey.on('unload', this.onUnload.bind(this));

```

---

<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:** [June 28, 2024, 5:02pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/147 "2024-06-28T17:02:56Z")

</div>

That’s still broken, try this for instance:

```auto
  onUnload() {
    this.log('unUnload called!');
    Promise.resolve().then(() => console.log('GOT HERE!'));
  }

```

Then run your app in one window, keep it running, then run it again in another window. You’ll see that it will log `unUnload called!` but _not_ `GOT HERE!`

That’s because any asynchronous code (like most likely any cleanup code will be) inside the handler will not be run.

---

<div class="post-metadata">

**Author:** ![ChrisG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chrisg/32/8825_2.png) [@ChrisG](https://community.homey.app/u/ChrisG)\
**Post date:** [June 28, 2024, 7:22pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/148 "2024-06-28T19:22:38Z")

</div>

This is how I use it with devices, for example:

onInit()

```auto
this.#mqttClient = MqttClient.getInstance(this, options.rootTopic);

```

onUnload()

```auto
this.#mqttClient.end(true);

```

I haven’t had any problems since then.

---

<div class="post-metadata">

**Author:** ![ChrisG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chrisg/32/8825_2.png) [@ChrisG](https://community.homey.app/u/ChrisG)\
**Post date:** [July 2, 2024, 7:13am UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/149 "2024-07-02T07:13:10Z")

</div>

Hi Menno

Sorry for the delay, but I was able to test the new version and it seems to work fine, except for the problem with the configuration. If you still have problems just contact me again.

Chris

---

<div class="post-metadata">

**Author:** ![AltonV](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/altonv/32/130229_2.png) [@AltonV](https://community.homey.app/u/AltonV)\
**Post date:** [July 25, 2024, 6:15am UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/150 "2024-07-25T06:15:13Z")

</div>

The app was constantly crashing with the following error.  
Uninstalling and installing either of the regular or experimental versions didn’t work.  
It seems to have stopped after disabling password hashing.  
The password didn’t contain any special characters, just letters and numbers.

```auto
TypeError [ERR_INVALID_ARG_TYPE]: The "password" argument must be of type string or an instance of ArrayBuffer, Buffer, TypedArray, or DataView. Received undefined
    at check (node:internal/crypto/pbkdf2:89:14)
    at Object.pbkdf2Sync (node:internal/crypto/pbkdf2:67:5)
    at hashPassword (/app/hashpwd.js:24:22)
    at machPasswords (/app/hashpwd.js:46:17)
    at Object.machPasswords (/app/hashpwd.js:11:14)
    at Aedes.authUser [as authenticate] (/app/broker.js:245:34)
    at ClientPacketStatus.authenticate (/app/node_modules/aedes/lib/handlers/connect.js:106:17)
    at makeCallTwo (/app/node_modules/fastseries/series.js:150:3)
    at release (/app/node_modules/fastseries/series.js:138:7)
    at resultList (/app/node_modules/fastseries/series.js:125:3)

```

---

<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:** [August 2, 2024, 10:44am UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/151 "2024-08-02T10:44:32Z")

</div>

Since it seems Athom has created their own MQTT broker, I will abandon this app. Unless someone gives me a good reason why I should continue this.

---

<div class="post-metadata">

**Author:** ![Henrik\_Johnsson](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/henrik_johnsson/32/13707_2.png) [@Henrik\_Johnsson](https://community.homey.app/u/Henrik_Johnsson)\
**Post date:** [August 2, 2024, 10:47pm UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/152 "2024-08-02T22:47:05Z")

</div>

I’m not sure Athom’s MQTT Server is a “general purpose” broker. For the moment i haven’t been able to use it in place of this app.  
My use case will probably seem unorthodox. As there is no app for my solar inverter I crafted a python script that runs on an RPI that is used for various other tasks also. The script reads data from the inverter and sends it as MQTT messages through this app, the MQTT Client app picks up relevant topics and then a flow updates a virtual device. Convoluted but it works reliably.  
So far I haven’t been able to get this to work with Athom’s app. Clients appear to connect but no messages comes through.

---

<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:** [August 3, 2024, 4:32am UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/153 "2024-08-03T04:32:00Z")

</div>

> [@Henrik\_Johnsson](#):
>
> So far I haven’t been able to get this to work with Athom’s app. Clients appear to connect but no messages comes through.

Have you reported this issue [on Github](https://github.com/WeeJeWel/net.weejewel.mqttserver/issues)?

From what I understand, the “official” app only gained trigger cards for topic a few days ago:

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

---

<div class="post-metadata">

**Author:** ![Henrik\_Johnsson](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/henrik_johnsson/32/13707_2.png) [@Henrik\_Johnsson](https://community.homey.app/u/Henrik_Johnsson)\
**Post date:** [August 3, 2024, 8:32am UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/154 "2024-08-03T08:32:16Z")

</div>

Nope, haven’t reported, just assumed it wasn’t in the intended scope of the official app.  
Hadn’t noticed that it now got cards, perhaps it only works with it’s built in client. Will check when I get a chance, only have the “production system” to test on.

---

<div class="post-metadata">

**Author:** ![Henrik\_Johnsson](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/henrik_johnsson/32/13707_2.png) [@Henrik\_Johnsson](https://community.homey.app/u/Henrik_Johnsson)\
**Post date:** [August 5, 2024, 8:43am UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/157 "2024-08-05T08:43:30Z")

</div>

With regard to my previous comments on the need for this app, after further experimenting with the official app I have concluded that it supports my use case. Basically, forget everything I said in this thread.

---

<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:** [July 16, 2025, 9:38am UTC](https://community.homey.app/t/app-pro-mqtt-broker-for-homey/5129/159 "2025-07-16T09:38:28Z")

</div>

Please move your post to the MQTT Hub topic, the app your question is about.

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