# \[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:** 3

<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 25, 2019, 8:48pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/41 "2019-03-25T20:48:29Z")

</div>

Nope nothing happens, also checked the client.  
So is the client the problem?

---

<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 25, 2019, 8:54pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/42 "2019-03-25T20:54:49Z")

</div>

Just out of interest is the MQTT broker on your Synology currently or the internal Scanno one on Homey ?

---

<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 25, 2019, 8:56pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/43 "2019-03-25T20:56:37Z")

</div>

The broker in Homey never workt for me… Currently i’m using the broker from [Hass.io](http://Hass.io).  
Before on my Synology.

---

<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 25, 2019, 8:59pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/44 "2019-03-25T20:59:49Z")

</div>

The MQTT broker as installed via an addin in [Hass.io](http://Hass.io) ? So running in a Docker container. I just wonder if there’s any security issue imposed with that - but then MQTT Hub \> MQTT Client from Homey is updating the homie topic correctly so seems OK. You can see it update yes ??.. not just retained old values. I run Mosquitto on the same machine as hass but currently not in a Docker.

---

<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:45pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/45 "2019-03-25T21:45:32Z")

</div>

@David_Maas can you PM me the full MQTT Hub debug log, with only one device enabled?

I expect the MQTT client is not correctly subscribed to the required topic(s), because messages are not being received.

The reason can be multiple: the hub failed to subscribe (e.g. socket error), MQTT client failed to subscribe (e.g. thinks it’s already subscribed), connection failure between mqtt client & broker (security?), something else (an unknown bug?)…

---

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

</div>

I’m following this with great interest as my issue is approx the same. Hopefully the solution to David’s problem also solves my issue.  
One thing I find strange on my [hass.io](http://hass.io) installation on Rpi (image from [hass.io](http://hass.io) for Pi2) is I can’t see the configuration.yaml file. I can’t ssh to it (connection refused) and through Windows SAMBA the Pi’s IP also is not accessible. I don’t have any experience with programming, so don’t know how to set-up [hass.io](http://hass.io) or the MQTT broker in [hass.io](http://hass.io).  
When I install the add-on package for configuration it should appear in the left menu bar of [hass.io](http://hass.io). But this is not happening… I’m kinda lost

---

<div class="post-metadata">

**Author:** ![KonradWalsh](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/konradwalsh/32/147_2.png) [@KonradWalsh](https://community.homey.app/u/KonradWalsh)\
**Post date:** [March 26, 2019, 3:33pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/47 "2019-03-26T15:33:40Z")

</div>

Thats more of a [HASS.IO](http://HASS.IO) issue that the purpose of this topic…

However, dont fear your lack of experience…  
Follow this guide and you will have SSH. Hardest part, depending on your set up is getting your pi hooked up to a monitor/keyboard/mouse

> **[Raspberry Pi — Teach, Learn, and Make with Raspberry Pi](https://www.raspberrypi.org/documentation/remote-access/ssh/)**
>
> The Raspberry Pi is a tiny and affordable computer that you can use to learn programming through fun, practical projects. Join the global Raspberry Pi community.

---

<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 26, 2019, 4:17pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/48 "2019-03-26T16:17:24Z")

</div>

I pulled out the SD card of the Pi2 and inserted it in a Linux Mint installation. Under 1 of the 4 partitions on the SD-card I found the configuration.yaml file. It looks like a virgin… brand new 😉

> Blockquotehomeassistant:  
> #Name of the location where Home Assistant is running  
> name: Home  
> #Location required to calculate the time the sun rises and sets  
> latitude: 52.4592  
> longitude: 4.6119  
> #Impacts weather/sunrise data (altitude above sea level in meters)  
> elevation: 0  
> #metric for Metric, imperial for Imperial  
> unit\_system: metric  
> #Pick yours from here: [List of tz database time zones - Wikipedia](http://en.wikipedia.org/wiki/List_of_tz_database_time_zones)  
> time\_zone: Europe/Amsterdam  
> #Customization file  
> customize: !include customize.yaml  
> #Configure a default setup of Home Assistant (frontend, api, etc)  
> default\_config:  
> #Show the introduction message on startup.  
> introduction:  
> #Uncomment this if you are using SSL/TLS, running in Docker container, etc.  
> #http:  
> #base\_url: [example.duckdns.org:8123](http://example.duckdns.org:8123)  
> #Discover some devices automatically  
> discovery:  
> #Sensors  
> sensor:  
> #weather prediction  
> -platform: yr  
> #Text to speech  
> tts:  
> -platform: google  
> group: !include groups.yaml  
> automation: !include automations.yaml  
> script: !include scripts.yaml

It looks like it is write protected 🤔

---

<div class="post-metadata">

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

</div>

when I go to : [https://www.home-assistant.io/docs/installation/synology/](https://www.home-assistant.io/docs/installation/synology/) I see an error about pyhton. but I don’t quie get whether when I use docker whetehr it works then with the newest home automation version? I really’d like a dashboard function in my homey…so yeah 🙂

---

<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 27, 2019, 8:36pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/50 "2019-03-27T20:36:04Z")

</div>

I’m one step further in configuring the [hass.io](http://hass.io), the configuration.yaml and the broker.

I only need to know how to configure the broker (what to add to configuration.yaml).

I have the embedded mqtt broker in [hass.io](http://hass.io).  
So I don’t need to add an IP address to the configuration file (I assume).  
What about username and password? Is this still the same as in Homey mqtt client?

---

<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 28, 2019, 2:00pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/51 "2019-03-28T14:00:05Z")

</div>

It works! After days of stuggling, i decided to remove all apps on the homey - restarted homey, reinstalled the client (make sure you uncheck both checkmarks) and hub. I’m using the broker on my rassberry hassio installation. And it is working!

@NoClaim You can still enter the web gui - Go to addons- configure addon - open it and you will see Use Web Gui.

Thank everyone for your patience.

Edit: And special thanks to Harrie, helped me a lot in private. Bought you a beer for your help and great app!

---

<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 28, 2019, 8:06pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/52 "2019-03-28T20:06:04Z")

</div>

Ok… this keeps me motivated 🙂 I just removed everything from homey (client and hub) and turned off the RPI. Now I will start trying again.  
Anything special I need to look at? I’m guessing I all has to do with how I setup the Broker under [hass.io](http://hass.io) and the configuration.yaml

And I managed (with a little bit of reading on [hass.io](http://hass.io)) to add the configurator to the left panel in [hass.io](http://hass.io). And during this exercise I also noticed I could use the Web GUI link in the add on… sometime a little bit of reading (and patience) will help 🙂

With mqtt client configuration on Homey no checkmarks are checked.So there is nothing to uncheck… or am I missing something? (except for a few braincells ☹ )

---

<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 28, 2019, 8:37pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/53 "2019-03-28T20:37:46Z")

</div>

I have no section mqtt in my configuration.yaml file. This clearly is not automated. Do I need to add something to the configuration file?

I have set a username and password in both mqtt client and broker, is this required?

When I check the mqtt addon log I see for almost every line (where noclaim is the username I use)

> mosquitto\_auth\_acl\_check(…, client id not available, noclaim, homie/homey/essent-stroom/measure-power, MOSQ\_ACL\_READ)  
> 1553805216: |-- aclcheck(noclaim, homie/homey/essent-stroom/measure-power, 1) CACHEDAUTH: 0

---

<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 31, 2019, 10:44am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/54 "2019-03-31T10:44:37Z")

</div>

Having some trouble setting all up. Few questions I don’t understand yet.

1: I’m using the mqtt client, mqtt hub and mqtt broker on homey. Then I have installed HA on raspberry pi with the add-on mosquitto broker. As stated above the topics will go from: Homey - hub - client - broker - HA. Do I use the broker double now? In other words. Can I delete the broker app from my homey and use the HA mosquitto broker to connect to the client app on Homey?

2: When setting up a dashboard on the HA interface, I have to select the entity (device). Should all Homey devices appear with their name on my entity list in HA or do I have to add them all manually?

---

<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 31, 2019, 10:47am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/55 "2019-03-31T10:47:52Z")

</div>

1. Yes. You can remove the Homey broker app. Use Mosquitto on your pi.
2. Yes. All devices should appear automatically (see [MQTT Discovery](https://www.home-assistant.io/docs/mqtt/discovery/)).

---

<div class="post-metadata">

**Author:** ![roel\_hendr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/roel_hendr/32/2900_2.png) [@roel\_hendr](https://community.homey.app/u/roel_hendr)\
**Post date:** [March 31, 2019, 10:51am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/56 "2019-03-31T10:51:54Z")

</div>

I’m currently configuring and learning HA. I’ve set up MQTT stuff as described in tutorial and works fine. While configuring HA, i have to restart it several times. I notice sometimes in MQTT explorer the HA topics are gone. I can fix this by restarting the MQTT hub and client.

How can I make sure I don’t have to do this? Like I said this happens sometimes, so it’s mostly working when I restart HA.

---

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

</div>

> [@Dennisvm8](#):
>
> Do I use the broker double now?

As Harrie replied you only ever need one MQTT Broker. I too recommend avoiding the Homey inbuilt option. It’s very likely your other hardware that you’re using for HomeAssistant, openHAB or whatever is more powerful than Homey and installing Mosquitto there will work better , leaving Homey less encumbered.

> [@roel\_hendr](#):
>
> I notice sometimes in MQTT explorer the HA topics are gone. I can fix this by restarting the MQTT hub and client.

When you send data to an MQTT broker you predefine whether that data should be retained (stored on) the broker or not. What this means is that a later connecting client can retrieve the last data and so be kept up to date with the last 'published data. MQTT Explorer is such a client - if previous data was published with ‘retained’ flag set then it will be able to read that data, if retained was ‘false’ then nothing has been stored on the broker and it will only get an update when new data is sent.

Whether you should publish data ‘retained’ or not is important and impacts how the topics work together. MQTT Hub via Homie3 and the HA Discovery protocol use both appropriately. What you are noticing is that the HA topics are correctly published without a ‘retained’ flag.

Now - there are a couple of ways around this. You can manually push the ‘broadcast’ button in MQTT Hub - this will send again the HA topics. You don’t need to totally restart it. Obviously this is a manual solution.

The preferred way is to set up the ‘last will and testament’ from HA. What this does is send a message when HomeAssistant leaves/joins the MQTT broker. MQTT Hub sees this and will automatically resend the HA topic tree so it is kept bang up to date. Details on how to configure this are in this or one of the related topics. I’m in a bit of a rush currently but I’ll have a search later and update - if you haven’t found it before.

---

<div class="post-metadata">

**Author:** ![roel\_hendr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/roel_hendr/32/2900_2.png) [@roel\_hendr](https://community.homey.app/u/roel_hendr)\
**Post date:** [March 31, 2019, 5:44pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/58 "2019-03-31T17:44:15Z")

</div>

I already configured this ‘last will and testament’ on HA. This is in my configuration under mqtt:

birth\_message:  
topic: ‘hass/status’  
payload: ‘online’  
will\_message:  
topic: ‘hass/status’  
payload: ‘offline’

Not sure if this is correct?

I also had it enabled in MQTT Hub. I didn’t change topics and message values there. Is all of this what you mean or do I miss something to fix it?

---

<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 31, 2019, 7:05pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/59 "2019-03-31T19:05:41Z")

</div>

I already thought so by reading the posts above. Configured all well now. The broker on the pi receives the topics when I change temperature in example. Now need to figure out how to setup the dashboard. I can’t seem to find how the entities work on HA dashboard. Entities won’t show automatically.

Edit: switched the discover home assistent off and back on and broadcast devices again and all devices showing up now. Only messages dont seem to go back to homey yet but Will figure out this week.

---

<div class="post-metadata">

**Author:** ![Casper181](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/casper181/32/5389_2.png) [@Casper181](https://community.homey.app/u/Casper181)\
**Post date:** [April 1, 2019, 10:59am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/60 "2019-04-01T10:59:50Z")

</div>

Let me know if you work this out as mine are only one way (change on Homey reflected in HA but can’t change them from HA).

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

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