MQTT not working with local brokers, only works with internet brokers

Hello everybody. I’m trying to configure MQTT service (Home Assistant in Raspberry 1 192.168.188.11) to connect to a local broker (Solar Assistant in Raspberry 2 192.168.188.10) in the same LAN but I always get the error “Failed to connect”.

The broker (Solar Assistant in Raspberry 2) is workinkg ok because I can connect to this broker with MQTT Explorer running in the same LAN in Windows PC.

And the strangest thing is that I can connect with MQTT service from Home Assistant in Raspberry 1 to any test brokers over the internet… it seems that the problem is only between Home Assistant Raspberry and SolarAssistant Raspberry…

Any help is so much appreciated!! Thank you.

I just had an idea: before the two Raspberrys were conected to the same LAN switch… now I connected one to the router directly and the other one to the switch and… MAGIC it works!! I don’t understand why… and I need to connect both to teh switch since it is a POE switch located in the storage room.

Any ideas?

Lan isolation on the ports? VLAN tagging? You’d have to look at your switch’s port settings (if it’s a managed switch) and see what’s happening there. Could also just be a dead port too.

1 Like

Your description is confusing. You can only have one MQTT broker on your network. Everything else is a client.

That only brings more confusion :wink:
You can have any number of MQTT brokers (servers) on your network. HA can only use a single one of them, though.

Thank you so much you gave me the solution!!!
It was Port isolation Switch in the POE Switch that was causing the problem.
Solved!!! :pray:t2:

1 Like

The broker si only one (in the Solar Assistant Raspberry) :wink:

My bad. Of course you are correct. In fact, (I do have two MQTT brokers on my network). The OP’s terminology confused me to think he had two brokers.

I do use both of my brokers in Node Red at the same time- I don’ know how you could do this in Home Assistant.

1 Like