Connecting remote zigbee2mqtt to HA Mosquitto add-on - **Resolved**

I have managed to resolve this issue: I changed the server address from it’s name to the IP address. Using the name of the home assistant server worked in MQTT Server, but not in zigbee2mqtt, although no error message was given.

Good afternoon all,

I am having issues getting a remote zigbee2mqtt instance to connect to mosquitto in Home Assistant. This is the background to my problem:

I have the following hardware setup:

  • Raspberry Pi 4, with zigbee2mqtt running in a docker container. Located in the house, so in range with the zigbee devices.
  • Home Assistant is installed in a on a virtual server on a computer in my workshop (connected to the house network by ethernet - on the same net/subnet).

Software:

  • I installed mosquitto as a home assistant add-on, and configured a username and password. The configuration for mosquitto is the default provided with the installation.
  • All the software is at the current (non beta) level.

When I start up the zigbee2mqtt instance, I get an error message: “Not connected to MQTT server!”. If I change the server, user and password fields in the configuration in the zigbee2mqtt to match another mosquitto installation on the above Pi, the connection works correctly. This mosquitto instance is not known to Home Assistant - I use it for other unrelated stuff.

If I startup MQTT Explorer on my desktop computer, I can connect to the Home Assistant mosquitto instance with the credentials I set up in Home Assistant.

Have any of you come across a similar issue? I am not sure what I have to change now to resolve this issue. I won’t be offended if you point me back at the documentation if I have missed something!

Thanks in advance for your comments!

EDIT: I have seen this in the HA logs:

21-03-26 19:09:12 INFO (SyncWorker_2) [supervisor.docker.addon] Starting Docker add-on homeassistant/amd64-addon-mosquitto with version 5.1.1
21-03-26 19:09:13 ERROR (MainThread) [supervisor.services.modules.mqtt] There is already a MQTT service in use from core_mosquitto

Seems to be a clash somewhere. Of course, since I can connect with MQTT Explorer, I don’t think this explains my problem, but I should find and fix this! :smile:

Can you explain to me how to have zigbee2mqtt on a remote hassios? I know how to read the devices connected to the remote coordinator but I can’t get zigbee2mqtt to work remotely.

Thanks in advance.