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

<div class="post-metadata">

**Author:** ![PascalB](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@PascalB](https://community.homey.app/u/PascalB)\
**Post date:** [November 10, 2020, 3:04pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/161 "2020-11-10T15:04:37Z")

</div>

HASS does not have to run on Synology, a Raspberry Pi or VM will also work fine. How did you install? And have you got a MQTT broker running?

---

<div class="post-metadata">

**Author:** ![mattrix](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mattrix/32/17475_2.png) [@mattrix](https://community.homey.app/u/mattrix)\
**Post date:** [November 10, 2020, 3:18pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/162 "2020-11-10T15:18:40Z")

</div>

omg somebody (and not anyone i checked some of your posts) is here !

I finally managed to see my homey devices and then they disappeared.

1/ They were showing in home assistant dashboard but i was not able to switch ON but i could see the live state of them (when switch on in homey, light goes on and off goes off)

2/ Now i restarted HA to check if it wrks on restart and now they can come back even after restart MQTT Client and Hub in HOMEY. I restarted HA MOSQUITTO BROCKER they still are grey

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/8/5805512141b8c29b65598457db7ade9b69b7d261.png)

For info  
My configuration.yaml is like that  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/7/672d1f7f6689470940c24bd01fa8755b1ae10814.png)

I have not SSL not SSH

That is my HA-\>CONF-\>INTEGRATION-\>MOSQUITTO SETTING/CONF

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

And that is my addon setting

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

Here few logs that seem service not restarting because is 16:10 when i restarted HA

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

---

<div class="post-metadata">

**Author:** ![PascalB](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@PascalB](https://community.homey.app/u/PascalB)\
**Post date:** [November 10, 2020, 6:29pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/163 "2020-11-10T18:29:50Z")

</div>

And the settings in your MQTT apps on Homey?

Otherwise, try troubleshooting with MQTT explorer as mentioned a few times in this thread

---

<div class="post-metadata">

**Author:** ![mattrix](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mattrix/32/17475_2.png) [@mattrix](https://community.homey.app/u/mattrix)\
**Post date:** [November 10, 2020, 7:25pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/164 "2020-11-10T19:25:39Z")

</div>

Now thereareonly twothings not cool.

1/ when i restart HA, i have to got o my MQTT HUB app on HOMEY and broadcast again and all gets connected again in HA  
2/ In HA, i am never able to switch On or Off a light for example, i can only see its state (if it s On or Off)

☹

---

<div class="post-metadata">

**Author:** ![mattrix](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mattrix/32/17475_2.png) [@mattrix](https://community.homey.app/u/mattrix)\
**Post date:** [November 10, 2020, 7:33pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/165 "2020-11-10T19:33:44Z")

</div>

Ii had the idea of restarting/rebooting homey  
Now all is solved …

Thank you !

---

<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:** [November 14, 2020, 11:52am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/166 "2020-11-14T11:52:58Z")

</div>

Im using this setup and it works almost great. One problem I have however is that Home Assistant looses state on devices. I then go in to MQTT Hub and press broadcast. I then works directly again. I have to do this at least once aday. Is there a workaround for this? Otherwise it would be nice to via a flow trigger the broadcast to avoid the issue.

Thanks for great help

---

<div class="post-metadata">

**Author:** ![PascalB](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@PascalB](https://community.homey.app/u/PascalB)\
**Post date:** [November 14, 2020, 6:35pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/167 "2020-11-14T18:35:32Z")

</div>

Does this happen spontaneously, or after a restart of HA?

---

<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:** [November 14, 2020, 6:47pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/168 "2020-11-14T18:47:50Z")

</div>

Every now and then. No clear connection to anything. I found now the Brodcast system state every 30s. Will see if that works for me.

---

<div class="post-metadata">

**Author:** ![anon61197305](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@anon61197305](https://community.homey.app/u/anon61197305)\
**Post date:** [November 21, 2020, 10:14am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/169 "2020-11-21T10:14:38Z")

</div>

I have the same problem @Ludvig has. I’ve done a ton of things… for me it’s for sure when I restart Home Assistant. When I push the broadcast button from the hub app on Homey it’s all fine.  
Will the Broadcast system state fix this?

---

<div class="post-metadata">

**Author:** ![PascalB](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@PascalB](https://community.homey.app/u/PascalB)\
**Post date:** [November 21, 2020, 2:12pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/170 "2020-11-21T14:12:44Z")

</div>

Probably you need this:

> [@\[TUTORIAL\] Setting up MQTT on Homey for configuring Home Assistant for dashboard purposes](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/136):
>
> I think your problem will be solved then…

---

<div class="post-metadata">

**Author:** ![anon61197305](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@anon61197305](https://community.homey.app/u/anon61197305)\
**Post date:** [November 22, 2020, 7:40am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/171 "2020-11-22T07:40:34Z")

</div>

I do not, even after that it fails.  
The tutorial doesn’t mention broadcast state…

---

<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:** [November 22, 2020, 1:07pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/172 "2020-11-22T13:07:09Z")

</div>

It works better but not perfect still. Still loses it to often. Strange is that it puts it unavailable state. Any idea?

A broadcast fixes it direct.

---

<div class="post-metadata">

**Author:** ![rindler](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rindler/32/5501_2.png) [@rindler](https://community.homey.app/u/rindler)\
**Post date:** [December 15, 2020, 9:17am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/173 "2020-12-15T09:17:06Z")

</div>

Pretty new to this, and most things are working out well, but one device cannot be found by HA. A qubino 0-10v dimmer (ZMNHVD). Any ideas how to solve this? Have restarted HA, the mqtt hub/client, broadcasted again and again.  
This is from mqtt explorer.

`{"name":"Takflakt","unique_id":"0cdbc263-f5cf-45ea-8a2f-7212dac22047_light","payload_on":"true","payload_off":"false","state_topic":"homie/homey-topic/takflakt/onoff","state_value_template":"{{ value }}","command_topic":"homie/homey-topic/takflakt/onoff/set","on_command_type":"brightness","icon":"mdi:toggle-switch-off-outline","brightness_state_topic":"homie/homey-topic/takflakt/dim","brightness_command_topic":"homie/homey-topic/takflakt/dim/set","brightness_value_template":"{{ value }}","brightness_scale":100,"device":{"identifiers":"homey ********************","name":"Takflakt"}}`

---

<div class="post-metadata">

**Author:** ![rindler](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rindler/32/5501_2.png) [@rindler](https://community.homey.app/u/rindler)\
**Post date:** [December 15, 2020, 9:48am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/174 "2020-12-15T09:48:19Z")

</div>

And obviously I got an error message in the log saying `[homeassistant.util.logging] Exception in async_discover when dispatching 'mqtt_discovery_new_light_mqtt'`.

And there’s no light connected to the dimmer, but a fan. Doesn’t matter if I change the device type in Homey or not.

---

<div class="post-metadata">

**Author:** ![Stephen\_Fenne](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stephen_fenne/32/34717_2.png) [@Stephen\_Fenne](https://community.homey.app/u/Stephen_Fenne)\
**Post date:** [January 25, 2021, 7:42pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/175 "2021-01-25T19:42:14Z")

</div>

I just got to say, thank you all! I stumbled upon this thread while desperately trying to add Homey z-wave devices over to HomeAssistant.

For clarity, if anyone still struggles;

Install both the MQTT client and hub on your Homey.  
Install the MQTT broker on your Home Assistant configure the yaml (set up a login)  
Connect the client to your broker.  
Configure the hub. Toggle it to be running and enable Home Assistant Discovery.

Your devices should be poppin up in HomeAssistant.

If you have problems:  
Check logs in client, hub and broker  
Use a MQTT explorer (application for all plattforms) to check if your connection works (or to sniff)

---

<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:** [January 26, 2021, 7:28pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/176 "2021-01-26T19:28:08Z")

</div>

For HA to be able to synch states on startup the Homey devices must have state published retained. I believe the beta/experimental build does this. Or using LWT you can trigger Homey to send states again when HA reconnects.

---

<div class="post-metadata">

**Author:** ![sebyldino](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebyldino/32/20067_2.png) [@sebyldino](https://community.homey.app/u/sebyldino)\
**Post date:** [January 27, 2021, 5:58am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/177 "2021-01-27T05:58:12Z")

</div>

MQTT Home Assitant Discovery does not work very well. All the devices are not recognized and states not updated all times. I have manually add all my devices in configuration.yaml.  
To update the states off my devices, i have an automatisation to braodcast states devices from Homey MQTT Hub app when HA restart.

@rindler, Try to add this in your configuration.yaml

```
light:
  - platform: mqtt
    name: Takflakt
    unique_id: "0cdbc263-f5cf-45ea-8a2f-7212dac22047_light"
    payload_on: "true"
    payload_off: "false"
    state_topic: "homie/homey-topic/takflakt/onoff"
    state_value_template: "{{ value }}"
    command_topic: "homie/homey-topic/takflakt/onoff/set"
    on_command_type: "brightness"
    icon: "mdi:toggle-switch-off-outline"
    brightness_state_topic: "homie/homey-topic/takflakt/dim"
    brightness_command_topic: "homie/homey-topic/takflakt/dim/set"
    brightness_value_template: "{{ value }}"
    brightness_scale: 100
    device:
      identifiers: "homey ********************"

```

Fan icon: mdi:fan

---

<div class="post-metadata">

**Author:** ![rindler](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rindler/32/5501_2.png) [@rindler](https://community.homey.app/u/rindler)\
**Post date:** [January 27, 2021, 7:22am UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/178 "2021-01-27T07:22:56Z")

</div>

I think there are two issues (at least). For some devices there is an unsupported parameter - icon - added, which causes an error in HA and the device is not discovered. When I copied the config json message and posted a mqtt message to the very same “device name”/config (according to [MQTT Discovery - Home Assistant](https://www.home-assistant.io/docs/mqtt/discovery/)) but deleting the icon part everything worked and I didn’t have to create the device manually in configuration.yaml.

The other issue with devices being lost when HA is restarted depends (in my case) that the mqtt configuration in HA posted birth message to homeassistant/status but I was listening to hass/status, which is the default setting in the Homey mqtt hub app. Setting those value to the same adress solves that issue.

---

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

</div>

For completeness: these issues should be solved by now.

---

<div class="post-metadata">

**Author:** ![Henk\_Renting](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/henk_renting/32/87634_2.png) [@Henk\_Renting](https://community.homey.app/u/Henk_Renting)\
**Post date:** [May 17, 2021, 1:04pm UTC](https://community.homey.app/t/tutorial-setting-up-mqtt-on-homey-for-configuring-home-assistant-for-dashboard-purposes/10880/180 "2021-05-17T13:04:02Z")

</div>

Not sure if this is the right topic, but I hope you guys and girls can help me out here:

My Duux smartfan is supported by Homey since a few days. That gives me the opportunity to integrate it in my HA dashboard too.  
On/off and oscillate horizontal and vertical are all working fine.

I can see the speed value as well in HA, but am not able to control it.  
The entity that Homey reports is “sensor”. I suppose that is the problem? It seems only logical that a sensor can not be adjusted…

What can I do about it, or is this something that Duux (as developer of the Duux app) has to change?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/e/7ed65b07704cfb8807394a97cb4f50cd36e7ebfb.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/2/d2cbb2fa1527fce34173c1dc8d6a2070d59d41c4.jpeg)

And in MQTT Explorer:

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

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

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