MQTT Client - configure for secure websockets?

Hi,

I am looking to use MQTT integration to connect to an external Mosquitto broker over secure websockets. The documentation at MQTT Broker - Home Assistant does not explain how to configure this - is it possible?

Thanks
Alasdair

1 Like

I was curious about this so spent a couple of minutes researching it out. It looks like HA uses eclipse paho as its mqtt client and this implementation does support websockets.
According to eclipse docs:

Client(client_id="", clean_session=True, userdata=None, protocol=MQTTv311, transport="websockets")

The default transport is raw tcp, so the transport parameter has to be set to websockets.

But looking at the HA mqtt code, I don’t see anywhere that they would possibly set up the client to use websockets, instead simply using the default tcp, so I think the answer is that its not currently possible.

1 Like

Thanks for researching that - appreciate it. I will just fall back to mqtts then.