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

Strange, my MQTT in HA says the hub is offline but the MQTT in Homey says status=online
192.168.0.129 is HA, 192.168.0.113 is Homey.


I6JBToGEfQ5hfEaqwQ7NaZhF6.png)

So you’re using two MQTT brokers?

I have followed instructions and according to them I should have one broker, one hub and one client on Homey.
On HA I have Mosquito broker that connects to Homey’s broker. If I stop the broker on Homey I can’t connect with HA at all.
Right now I can connect with HA to the Homey broker and I have found devices before. I have 20 devices and 33 entities in HA from Homey.
But when I added more devices on Homey the other day, HA don’t find them, it doesn’t update somehow.
So basically, my question is how I can update MQTT in HA to pick up the new devices?

Did you try reloading the integration? Press the three dots icon in the bottom right corner and choose “Reload”.

I’m having some issues here, and hope someone’s able to help me out :slight_smile:

  1. I’ve edited the config file for HA, but when I restart it I get the following:

  2. If I try to add an integration, I get the following:
    image

As far as I can see, everything should be set. I initially followed this tutorial (before I found this topic): Homey MQTT Guide til HomeAssistant | Patrick Leisegang

Also, I’m unable to find the three dots to show unused entities, but I guess that could be because everything else is going wrong :wink:

I’m running everything as a docker image (Docker) with HA 2023.5.4.

You don’t need to edit the HA configuration file, you should enter the MQTT details when adding an integration.

What details did you enter when adding it?

image

If I telnet to this IP and port the MQTT broker displays it in the logs.

MQTT broker setup:

MQTT client:

MQTT hub:



image

@robertklep Now, this is strange - I installed MQTT explorer and was able to connect. THEN HA would receive devices. No other changes were done :thinking:

Might be related:
I often had non responsive Homey devices in HA; these custom settings fixed that:

Try enabling “Disable User Authentication” in the broker. See this post and the one following it.

1 Like

I’ve tried both the suggestions here, but HA still stops updating. Pressing the broadcast button in the app solves it. Could there be something in the HA MQTT setup that needs changing? I’d guess no, as it starts working as soon as I press broadcast, but
you never know.

MQTT Explorer picks up a lot of messages, so I guess the Homey side is correctly set ut.

Hello, i am having issues installing a new sensor. I did this in the past but i cant seem to get it working now. I think my mistake is in the topic i use? if i am correct i need to add device “homie discovery” and then use the topic; homie/ ;

The device is an ESP easy unit with Home assustant MQTT ; (Controller IP = Homey IP)


in MQTT Explorer i find the Unit under the IP of the homey;
afbeelding

The unit ESP/Regenput_2 is currently running for months like this but now i am not finding any topics whe ni search in the mqtt hub app?

You don’t have 'homie' in your topics


So the topic just reads ESP_regenput_2.
It’s a direct topic under the controller (broker) IP, which you run on Homey.
When you click in the triangle in front of it, you’ll find the next parts of that topic.
Like for example ESP_regenput_2/switch/watermeter

Peter,
I can not find the device. I need to add the ESP_DieselRood so if correct i just need to search for the Topic ESP_DieselRood ? Or do i need to specify the exact Switch or sensor?

I am trying to post the status of multiple variables to Home Assistant (numbers, strings and boleans). So not from a specific device (that works perfectly through MQTT Hub), but from a Homey Variable.

Setup:
Homey Pro with MQTT Client and MQTT Hub
Home Assistant with MQTT server.

Tried a simple flow to post the bolean information for example to a certain topic, but then the entity is not recognized by HA (while visible in my MQTT Explorer).

What is the mandatory requirement for the payload such that HA can recognize it as a device or sensor value?

In you case, the HA autodiscovery Mqtt topic is not create.
You only export a single topic.
So you have to import this topic as a Mqtt entity into HA.
I don’t know if that possible now via GUI. In the past I created such entities in the yaml config file.

Yeah I only know you can export it to HA by adding an mqtt.yaml

  • At HA, add the line mqtt: !include mqtt.yaml to configuration.yaml
  • Create a file called mqtt.yaml in the same ‘config’ folder
  • to add a Homey variable called “Seizoen”, add this to the mqtt.yaml:
sensor:
  - name: varhmy_seizoen
    unique_id: 'varhmy_seizoen_mqtt'
    state_topic: 'homey1/variabelen/seizoen'
    icon: 'mdi:eye'
    force_update: true
    ### additional stuff: ###
    #value_template: >
    #  {{ value.split(',')[0] }}
    #device_class: 'energy'
    #unit_of_measurement: "kWh"
    
    • The ‘name’ and ‘unique_id’ are just made up by me, you can use your own.
      By adding _mqtt suffix at the ‘unique_id’, I’m sure I always create real unique ID’s from my variable names.
    • The state_topic used, should be the same as you use in the Homey MQTT Client flow card

Flow:

HA entity: