I currently have a Mosquitto broker instance up and running. It is running on the same server as Home Assistant however I am attempting to connect to the broker via public fqdn/Cloudflare (connecting to localhost doesn’t work either).
The traffic flow is as follows:
Home Assistant -> mqtt.domain.com:443 -> Cloudflare -> haproxy -> Mosquitto Broker
I am able to connect to the broker from my Android phone using OwnTracks (including at home on the same network as the Home Assistant service). I am also able to connect from http://www.hivemq.com/demos/websocket-client/
Home Assistant fails to connect but in the logs reports “[homeassistant.components.mqtt] Successfully reconnected to the MQTT server” every 2 minutes.
Thanks for the response. I have tried different client IDs but it doesn’t seem to make a difference. Mosquitto never even seems to see a connection coming from the HA server even though the HA server claims to have connected.
I have also checked that mosquitto is definitely running on port 1883 because I had originally tried to use the built-in hbmqtt service.
Quick followup on this since I have managed to get mqtt to work using websockets. The only difference is setting the mqtt host in the .yaml to ws://mqtt.domain.com/ws and port to 443. This doesn’t work through the web UI integrations config of MQTT though.