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

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?

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

For info
My configuration.yaml is like that
image

I have not SSL not SSH

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

And that is my addon setting

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

And the settings in your MQTT apps on Homey?

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

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)

:frowning:

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

Thank you !

1 Like

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

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

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.

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?

Probably you need this:

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

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.

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"}}

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.

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)

1 Like

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.

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

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) 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.

For completeness: these issues should be solved by now.

1 Like

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?


And in MQTT Explorer: