When Zigbee2MQTT will not connect to the MQTT broker in Home Assistant, the cause is almost always a mismatch rather than a fault: the address, username or password in Zigbee2MQTT does not line up with what Mosquitto expects, or the wrong serial port is set for your Zigbee coordinator. Both are config problems you can fix in minutes once you know where to look.
Quick Answer
Check two things first. Confirm the MQTT server address, username and password in the Zigbee2MQTT config exactly match the credentials set in the Mosquitto broker, and confirm the serial port points to your actual Zigbee coordinator. A wrong credential causes a connection refused error; a wrong serial port stops the coordinator initialising. Fix the mismatch and it connects.
Start With The MQTT Credentials
The most common failure is an authentication mismatch. Zigbee2MQTT tries to log into the Mosquitto broker with a username and password, and if either does not match what you configured in Mosquitto, the broker refuses the connection. In the Zigbee2MQTT configuration, find the mqtt section and check the server, user and password entries.
If you are using the Mosquitto broker add-on, make sure the user and password you set there are the ones Zigbee2MQTT is sending. A frequent slip is leaving the server set to localhost when it should point at your Home Assistant instance's address, depending on how your setup is structured. After correcting credentials, restart the Mosquitto add-on and then Zigbee2MQTT, and watch the log.
Then Check The Serial Port
If the MQTT side looks right but Zigbee2MQTT still will not start properly, the serial port for the coordinator is the next suspect. Pointing it at the wrong device, or using a path that changes on reboot, stops the coordinator from initialising.
The reliable fix is to use the stable path under the serial by-id directory rather than a generic device name that can shift after a restart. The by-id path stays tied to your specific dongle, so it survives reboots and other USB devices being plugged in. Set that path in the configuration, restart, and the coordinator should be recognised.
Read The Log, It Tells You Which Layer Failed
The Zigbee2MQTT log is the fastest diagnostic you have. On a healthy start you will see it connect to the MQTT broker and then initialise the coordinator, ending with a message that Zigbee2MQTT has started. The point where it stops tells you the layer to fix: an MQTT connection or authentication error means credentials or address, while a failure to open or initialise the coordinator means the serial port. Work the one the log points to rather than changing everything at once.
If you do not have a broker installed at all, add the Mosquitto broker from the Home Assistant add-on store, start it, set a user and password, and then point Zigbee2MQTT at those same details. For the dongles, USB extensions and powered hubs that keep a coordinator reliable, the smart home range and the everyday cabling in the accessories best sellers cover what you need.
Frequently Asked Questions
Why does Zigbee2MQTT show a connection refused error?
That is almost always an MQTT authentication mismatch. The username or password in the Zigbee2MQTT config does not match what Mosquitto expects, so the broker refuses the connection. Align the credentials and restart both.
Should I use localhost or an IP address for the broker?
It depends on your setup. If Zigbee2MQTT cannot reach the broker on localhost, point the server entry at your Home Assistant instance's address instead, using the credentials configured in Mosquitto.
How do I set the right serial port?
Use the stable path under the serial by-id directory rather than a generic device name. That path stays linked to your specific coordinator and survives reboots and other USB devices being added.
What should a successful start look like in the log?
You should see Zigbee2MQTT connect to the MQTT broker, then initialise the coordinator, and finish with a message that it has started. Where it stops tells you whether the problem is MQTT or the serial port.
I have no MQTT broker yet. What do I do?
Install the Mosquitto broker add-on from the Home Assistant add-on store, start it, and set a username and password. Then enter those same details in the Zigbee2MQTT mqtt configuration.
A coordinator that will not connect is usually one config line away from working. Browse the smart home range at Evetech for the dongles, hubs and extensions that keep a Zigbee setup stable.