Switchbot-Mqtt is no longer connecting to Mosquitto

Hi everyone,

Yesterday I noticed that Switchbot-Mqtt is no longer connecting to Mosquitto, or rather, the connection is being rejected.

Unfortunately, I can’t quite make sense of the error message. :frowning:

Switchbot-Mqtt:

11:19:38 fail: HomeAssistantAddOn.Mqtt.MqttService[0] ConnectingFailed null MQTTnet.Adapter.MqttConnectingFailedException: Connecting with MQTT server failed (NotAuthorized). at MQTTnet.Client.MqttClient.Authenticate(IMqttChannelAdapter channelAdapter, MqttClientOptions options, CancellationToken cancellationToken) at MQTTnet.Client.MqttClient.ConnectInternal(IMqttChannelAdapter channelAdapter, CancellationToken cancellationToken) at MQTTnet.Client.MqttClient.ConnectAsync(MqttClientOptions options, CancellationToken cancellationToken) at MQTTnet.Client.MqttClient.ConnectAsync(MqttClientOptions options, CancellationToken cancellationToken) at MQTTnet.Extensions.ManagedClient.ManagedMqttClient.ReconnectIfRequiredAsync(CancellationToken cancellationToken)
What I understand is that the connection failed (unauthorized). The username and password are correct, though.

What I understand is that the connection failed. Mosquitto writes:

2025-12-27 11:23:18: Client SwitchBotMqttApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null disconnected, not authorized.

PublickeyToken=null ???

It would be really great if someone could help me. I can also share further settings if needed. :slight_smile:

How do you know this?

I would try to set-up another login-password in the Broker, then have the device try that login. Almost looks to me like it’s trying to connect without a password and being rejected. Not certain, but it’s the vibe I’m getting.

1 Like

Hello,

I copied and pasted the username and password into both Switchbot and Mosquitto.

I agree about the denial; I’m sure the problem is simple. However, I just can’t see the solution. I’ll read through the link right away. Thanks so much for that! :slight_smile: