# \[TUTORIAL\] Setting up MQTT on Homey for configuring Home Assistant for dashboard purposes

**URL:** <https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880>\
**Category:** Questions & Help\
**Created:** [March 21, 2019, 11:46am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880 "2019-03-21T11:46:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ferry\_van\_E](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ferry_van_e/32/10953_2.png) [@Ferry\_van\_E](https://community.homey.app/u/Ferry_van_E)\
**Post date:** [March 21, 2019, 11:46am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/1 "2019-03-21T11:46:12Z")

</div>

Hi, i would like to share instructions of how to setup MQTT on Homey to make your devices visible in Home Assistant with a Synology NAS. Thanks a lot to @HarriedeGroot for creating the MQTT Hub, @scanno for the MQTT Client (and Broker, which unfortunately will not be included in this tutorial since my setup is on a Synology NAS with Mosquitto as a broker) and @Gustav_Tillback for initially sharing the first steps in creating this setup which will be explained in further detail below

**DISCLAIMER** \*\*  
I am no developer or wizzard nor do i state this tutorial is the only or best way to configure MQTT for Home Assistant. I’ve bought my Homey 2019 in February 2019 and ran into MQTT on March 18th for the first time in my life. I just practically followed any instruction i could find on the internet as addition on the above mentioned first steps  
**DISCLAIMER** \*\*

The following setup consists of apps on Homey and a so called package on Synology NAS.

**What do you need?**

- MQTT Client (Homey app)
- MQTT Hub (Homey app)
- Docker (Synology package)
- Mosquitto (Synology package)

**Steps in instruction**

1. Install and configure Home Assistant on Synology NAS in Docker (package)
2. Install and configure a Mosquitto broker (package) on Synology NAS
3. Install MQTT client app on Homey and configure it to connect to the broker  
[MQTT Client for Homey](https://apps.athom.com/app/nl.scanno.mqtt)
4. Install MQTT Hub app on Homey and configure it for Home Assistant discovery  
[MQTT Hub](https://apps.athom.com/app/nl.hdg.mqtt)
5. Set up an integration to the broker in Home Assistant configuration

**1. Install and configure Home Assistant on Synology NAS in Docker (package)**  
[Instructions how to install and setup Docker under title ‘Synology NAS’ until the Z-wave USB stick part (halfway page)](https://www.home-assistant.io/docs/installation/docker/)

**2. Install and configure a Mosquitto broker (package) on Synology NAS**  
[Instructions how to install Mosquitto](https://www.youtube.com/watch?v=b3A1RJdDf-w)  
I_n the video above a fix is shown when Mosquitto isn’t working with the default configuration. I did not ran into the same problem because this issue probably has been solved since this video is from 2017_

**3. Install MQTT client app on Homey and configure it to connect to the broker**  
[MQTT Client for installation on Homey](https://apps.athom.com/app/nl.scanno.mqtt)  
Make sure:

- you fill in the IP address of your Synology NAS and port 1883
- disable both checkmarks at ‘using a safe connection with broker (TLS)’ and ‘disable certificate check’  
_i already can predict a storm of comments because this probably isn’t a safe way to configure but i don’t have any knowledge to do better so please share your thoughts. With TLS enabled it wouldn’t work anyhow_
- you keep alive set at 60 (don’t know why 😅)
- you keep the rest empty since there is a lack of instructions for a noob like me. If you decide to fill in a username and password make sure you use these same credentials in configuration.yaml at **step 5**  
_Again i would be thankful if someone could share how to appropriately apply username and password in the rest of the setup_

**4. Install MQTT Hub app on Homey and configure it for Home Assistant discovery**  
[MQTT Hub for installation on Homey](https://apps.athom.com/app/nl.hdg.mqtt)  
Make sure that:

- Running is ENABLED
- Under ‘HOME ASSISTANT DISCOVERY’ the switch is ENABLED
- Broadcast button will be used later on once the config in Home Assistant has been modified to be able to discover this broadcast by the MQTT Hub

**5. Set up an integration to the Mosquitto broker in Home Assistant configuration**  
The following steps are Home Assistant related and needs to be done in the configuration.yaml file, which can be found in the folder which you’ve created in **step 1**  
_For example in \<your\_folder\_name\>/config_

- open configuration.yaml

- add the following:

_YAML is very sensitive to spaces - all lines except mqtt: should have two spaces at the beginning_  
For username and password fill in the same credentials as for the MQTT Client in **step 3**

- save your configuration.yaml file
- restart the Home Assistant container in Docker  
-Open Docker in Synology NAS  
-look for Container and go to homeassist-home-assistant and click on it  
-on the Action button above choose restart
- Now it is time to open Home Assistant by entering in your browser http://\<your\_Synology\_IP\_address\>:8123 where you are prompted for a username and password
- when Home Assistant opens you need to go back to your MQTT Hub on your Homey and press on the Broadcast button

On the upper right corner (3 dots) you can click and search for ‘Unused entities’ which will show you all the devices connected to Homey

Happy configuring your entities in cards, glance etc.  
More info about Home Assistant and edit the user interface can be found [here](https://www.home-assistant.io/lovelace/)

Good luck and greetings from a noob 🙂

---

<div class="post-metadata">

**Author:** ![Dennisvm8](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dennisvm8/32/3508_2.png) [@Dennisvm8](https://community.homey.app/u/Dennisvm8)\
**Post date:** [March 21, 2019, 12:19pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/2 "2019-03-21T12:19:36Z")

</div>

Definately going to try this. Unfortunately I’m running a WD my cloud at home, so don’t know if that one can be used too. Docker is available for it. Don’t know yet if Mosquito can be installed. I read the thread that it also should work without a personal cloud. If someone have any explanations about that, i would love to see some instructions added to the OP.

---

<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 21, 2019, 1:44pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/3 "2019-03-21T13:44:27Z")

</div>

> [@Ferry\_van\_E](#):
>
> i’m aware this command could be expanded with username and password but i need more info, so please share your how-to

You literally just have to add your credentials - as below. (you can use `!secret MQTTpassword` if you wish)  
N.B. YAML is very sensitive to spaces - all lines except mqtt: should have two spaces at the beginning. You might want to emphasise that in your tutorial by popping the YAML into a code block

```
mqtt:
  broker: <please_fill_in_the_IP_address_of_your_Synology_NAS>
  username: myUsername
  password: myPassword
  discovery: true
  discovery_prefix: homeassistant

```

If you have Docker available then you should be able to install on that as long as the CPU architecture is supported.

---

<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:** [March 21, 2019, 2:57pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/4 "2019-03-21T14:57:18Z")

</div>

> [@Issues Setting Up MQTT For HASS](https://community.homey.app/t/issues-setting-up-mqtt-for-hass/10774/14):
>
> Before you know, you’re the one with 95% of the knowledge and explaining others how to get things up and running 😉.

Told you!

---

<div class="post-metadata">

**Author:** ![Ferry\_van\_E](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ferry_van_e/32/10953_2.png) [@Ferry\_van\_E](https://community.homey.app/u/Ferry_van_E)\
**Post date:** [March 22, 2019, 12:06am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/5 "2019-03-22T00:06:41Z")

</div>

> [@Dennisvm8](#):
>
> Don’t know yet if Mosquito can be installed.

I already mentioned that there is an alternative MQTT broker for Homey by the same developer of the MQTT client.

---

<div class="post-metadata">

**Author:** ![Dennisvm8](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dennisvm8/32/3508_2.png) [@Dennisvm8](https://community.homey.app/u/Dennisvm8)\
**Post date:** [March 22, 2019, 4:48am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/6 "2019-03-22T04:48:20Z")

</div>

Yes i have that working. Now running the broker, cliënt and hub succesfully at homey. My struggle now is to install HA. I can’t manage to find good instructions on how to install docker + HA on my wd my cloud nas. Thinking about getting the rasp pi 3+. Seems to be alot easier and way more guides.

---

<div class="post-metadata">

**Author:** ![NoClaim](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/noclaim/32/9817_2.png) [@NoClaim](https://community.homey.app/u/NoClaim)\
**Post date:** [March 23, 2019, 4:54pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/7 "2019-03-23T16:54:59Z")

</div>

I have installed everything (i assume) correctly (HA on RPi, MSQTT on Synology), all devices are discovered by HA, but I can’t switch on/off lights or any other command.  
Seems to be only one way direction. If I open a door (or something) I can see the contact alarm in HA, so there is communication from Homey to HA.  
Something wrongly configured?

---

<div class="post-metadata">

**Author:** ![Ruud\_Poleij](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ruud_poleij/32/8160_2.png) [@Ruud\_Poleij](https://community.homey.app/u/Ruud_Poleij)\
**Post date:** [March 23, 2019, 6:24pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/8 "2019-03-23T18:24:48Z")

</div>

When you got a connection and don’t see the devices, press Broadcast in the MQTT Hub app on the Homey.  
Then when you open de MQTT on the HA, you will see al the devices.  
Remember, when you restart HA, push Broadcast again on de MQTT Hub app.

Do someone else know how to fix ?

---

<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:** [March 23, 2019, 6:31pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/9 "2019-03-23T18:31:01Z")

</div>

TIP: The broadcast will be executed automatically if the HA [birth & last will](https://www.home-assistant.io/docs/mqtt/birth_will/) topics are setup correctly.

---

<div class="post-metadata">

**Author:** ![Ruud\_Poleij](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ruud_poleij/32/8160_2.png) [@Ruud\_Poleij](https://community.homey.app/u/Ruud_Poleij)\
**Post date:** [March 23, 2019, 6:43pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/10 "2019-03-23T18:43:01Z")

</div>

Bedankt voor de snelle reactie.  
Nu nog even kijken hoe ik de kaarten op het dashboard kan verkleinen

---

<div class="post-metadata">

**Author:** ![David\_Maas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/david_maas/32/25776_2.png) [@David\_Maas](https://community.homey.app/u/David_Maas)\
**Post date:** [March 23, 2019, 8:10pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/11 "2019-03-23T20:10:44Z")

</div>

If have got exactly the same problem.  
I can see all the devices, if i toggle the state in homey i see the change in realtime  
But if i trie to change it in HA it does nothing. It sets the state after 3 seconds to the old state.  
I hope it is clear.

Broker tried on a Synology and Homey.  
Client and hub on Homey.  
HA on Synology and Rassberry.

No luck so far.

---

<div class="post-metadata">

**Author:** ![Sigge](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sigge/32/12687_2.png) [@Sigge](https://community.homey.app/u/Sigge)\
**Post date:** [March 23, 2019, 10:42pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/12 "2019-03-23T22:42:41Z")

</div>

I find it amazing that this is a topic that is needed. Why can’t Athom get a working integration to Google home working?? Just had a mail about Alexa and homey in my inbox. Is Amazon giving more kickbacks than Google?

Starting the timer to see how fast the Athom moderators catch this one…

---

<div class="post-metadata">

**Author:** ![Ferry\_van\_E](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ferry_van_e/32/10953_2.png) [@Ferry\_van\_E](https://community.homey.app/u/Ferry_van_E)\
**Post date:** [March 23, 2019, 11:49pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/13 "2019-03-23T23:49:03Z")

</div>

This topic is a tutorial and tutorials are necessary to share experiences with every community member with better user experience as a result.

As an inexperienced user i am happy to see people share tutorials so i can learn even more. That’s why i wanted to return the favor and wrote down this extensive tutorial, which is mostly build on apps developed by this community and shows the capabilities of Homey despite this setup isn’t one ‘by the book’.

Despite i can understand your frustration your comment is inappropriate since this tutorial has nothing to do with Google Home.

Maybe there is a positive approach which has more added value motivating people to help you out.

---

<div class="post-metadata">

**Author:** ![Sigge](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sigge/32/12687_2.png) [@Sigge](https://community.homey.app/u/Sigge)\
**Post date:** [March 24, 2019, 12:11am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/14 "2019-03-24T00:11:39Z")

</div>

Sorry if I offended you in any way. It’s people like you that keep me from throwing the Homey out in the yard for target practice… My point was really that what you have done should be native to Homey and prioritized by the Homey developers rather than wasting time on mobile phone app frontends…

Also, to understand what I’m after, MQTT, seems to be the only way today to get Google assistant to work with Homey unless you are living in the UK. Alexa does not work att all unless you speak the right language…

---

<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 24, 2019, 1:19am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/15 "2019-03-24T01:19:45Z")

</div>

> [@David\_Maas](#):
>
> If have got exactly the same problem.

> [@David\_Maas](#):
>
> It sets the state after 3 seconds to the old state.

This is usually an indication that the MQTT broker is only being updated one way. HA should write the updated state back to the ‘set ‘ topic and MQTT Hub should see that, update the device and publish the new state back to ‘onoff’, ‘dim’ or whatever which HA then sees. However it’s not being updated and so in the HA UI it reverts back to the older published state.

You are using latest version of MQTT Hub aren’t you on v2 Homey ?

Either of you got MQTT Explorer installed ?

---

<div class="post-metadata">

**Author:** ![NoClaim](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/noclaim/32/9817_2.png) [@NoClaim](https://community.homey.app/u/NoClaim)\
**Post date:** [March 24, 2019, 6:09pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/16 "2019-03-24T18:09:25Z")

</div>

I’ve got MQTT Client and Hub on Homey. Broker on my Synology NAS (Mosquitto package) and [HASS.io](http://HASS.io).  
I have checked the broker options, but there is not much to configure here…

Not installed MQTT explorer indeed (Is this the missing link? to get MQTT Broker to work both ways?)

---

<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:** [March 24, 2019, 6:41pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/17 "2019-03-24T18:41:22Z")

</div>

Nope, MQTT explorer is just a tool to check which messages are being send. It gives some insights on what might be the problem.

---

<div class="post-metadata">

**Author:** ![David\_Maas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/david_maas/32/25776_2.png) [@David\_Maas](https://community.homey.app/u/David_Maas)\
**Post date:** [March 24, 2019, 10:05pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/18 "2019-03-24T22:05:26Z")

</div>

Yes, I’m using the latest updates on my homey device. Client and hub.

I also installed [Hass.io](http://Hass.io) on a rassberry and installed the broker on the rasberry.  
Explorer installed, but i don’t know where to look for.

The only thing i can think of is the Hub is not working well.  
It is driving me crazy.

---

<div class="post-metadata">

**Author:** ![NoClaim](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/noclaim/32/9817_2.png) [@NoClaim](https://community.homey.app/u/NoClaim)\
**Post date:** [March 25, 2019, 7:54am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/19 "2019-03-25T07:54:32Z")

</div>

I’ve installed the broker on as a package under [hass.io](http://hass.io) to remove the Synology as possible cause, but unfortunately the same issue with one way communication (in [Hass.io](http://Hass.io) seeing everything but unable to manage the home through the Homey from [Hass.io](http://Hass.io))

Don’t know where to continue trouble shooting

(someone is actually having this operational?.. not that we are working on something which is not operational at all 🙂 )

---

<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:** [March 25, 2019, 9:20am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/20 "2019-03-25T09:20:06Z")

</div>

Sounds like the hub/client is not correctly subscribed.

1. Did you try restarting the MQTT Client & hub apps (via app details; see below)?
2. Did you try rebooting Homey (keep unplugged for \>30 sec.)?

Messages travel: HA \> broker \> client \> hub \> Homey.  
So if rebooting stuff does not resolve the issue, you need to start debugging where the messages stranded.

1. Broker: Try MQTT Explorer. Do you see incoming messages from HA when you e.g. switch a light.
2. MQTT Client: try the log in the app settings. Do you see incoming messages?
3. Hub: Go to the log tab in app settings and set it to **debug**. Do you see incoming messages? If not, keep it on debug and restart the Hub (via app details). Go back to the log tab. Maybe the full debug boot log of the Hub will give some additional info.

How-to restart an app: apps \> select app \> details (cog wheel) \> restart app.

[Next page](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880.md?page=2)
