External Mosquitto Mqtt Connection Failed

Windows Server 2019
Mosquitto Mqtt
Home Assistant running in Hyper Vm

hello,
I am trying to set up an external MQTT connection (mosquitto). my MQTT integration looks like::
Broker:192.168.x.x
Port: 1883z
user xxx
password xxx

I get a “Failed to connect” error and that’s it. All of my Tasmotas connect to this server and in MQTT explorer my $SYS/log/# does not log any connection attempt. I have logging set to all.

Any ideas?

1 Like

Is there really a „z“ at the end of the port number? If so, that‘s the reason.

Typo, the port is 1883

Is that in your configuration.yaml? If so, remove it there and use MQTT integration, configured via UI.

You need to add it manually in your configuration.yaml
something like this:

mqtt:
  broker: 10.0.0.63
  port: 1883
  discovery: true
  discovery_prefix: homeassistant
  username: xxxx
  password: xxxx
  birth_message:
    topic: 'hass/status'
    payload: 'online'
  will_message:
    topic: 'hass/status'
    payload: 'offline'

No you don‘t, infact you even shouldn’t (unless you have a very special setup).

Btw: Did you check general connectivity from HA host to MQTT broker?

@m0wlheld
GlassCake is trying to set up an external broker, not the addon :roll_eyes:

And that is possible, it is up to the user to choose an internal (add-on) or external broker.
Apparantly it is working, as all his Tasmota devices allready use it; he only has issues connecting it to HA :smiley:

I know and if you read the linked docs, you’ll see that the integration (not the add-on) was made to do just that.

Actually, I think @GlassCake is already using the integration, configured via UI:

My suggestion is to check overall connectivity from HA host to the (external) MQTT broker. Because, if IP address and port do match the MQTT criteria, there should be at least some “invalid login” attempt in the MQTT server’s log.

1 Like

I tried manually configuring it in the config file and gave it a reboot, no dice.

Yes, I’ve been trying to connect through the integration. Still no info in the log.
Interestingly enough when I open integrations, MQTT shows up as discovered.

I opened up Wireshark and the IP home assistant is running on does not send any messages other than to the IP of the PC I am using to access it. I have a feeling I am missing something really simple here. Maybe I should just do a fresh install.

I also noticed that under system, settings, network it says “external access disabled” but I assume that’s for out of intranet connection

I have external mosquitto broker running, its running in a docker container.

Recently reconfigured my HA setup, and to add MQTT I used the MQTT integration page
Was very simple that way, so I’d delete the stuff from your config file, and try using the integration.

I have exactly the same issue but can’t solve it :frowning:

Did anyone find a solution?

MQTT suddenly stopped working for me, last update problems?