MQTT Broker allows to connect only once and then fail

When I try to re-cofigure mqtt broker i’m getting error like this:

Even that I have a user with homeassistant login. Password is also valid
Funny case is that if I go to the Settings => Add-ons => Mosquitto broker and hit RESTART the credentials above are working for couple of minutes and i can re-configure so I am able to connect…

Rather than attempt remote troubleshooting (although ISTR HASS disables the homeassistant user for MQTT deliberately), can I suggest a walk-though of all MQTT settings including credentials?:

The only way you know for certain if the MQTT broker works is with an external tool like https://mqtt-explorer.com/ . IPv6 / hostname / mDNS names have been known to break MQTT broker access.

Oh, and code fences work a lot better than screen-dumps in forums as they are searchable, and get automatic code colouring which helps spot syntax errors.

I am unable to use mqtt-explorer as I am a mac user. It is not supporting latest MacOS :confused:

As for my config - I have a standard config, nothing weird.
I have a standard config.

Even if I use one of my custom users am I still not able to log in :confused:

I am thinking about removing that add-on and reinstal it again but then I will have to re-connect all of devices?

home-assistant.log

2022-09-09 20:55:30.420 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration xiaomi_cloud_map_extractor which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-09-09 20:55:30.447 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration midea which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-09-09 20:55:30.484 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration midea_dehumidifier_lan which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-09-09 20:55:30.509 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration midea_ac which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-09-09 20:55:30.547 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-09-09 20:56:34.627 INFO (MainThread) [homeassistant.components.rflink] Initiating Rflink connection
2022-09-09 20:56:34.643 INFO (MainThread) [homeassistant.components.rflink] Connected to Rflink
2022-09-09 20:56:34.805 DEBUG (MainThread) [rflink.protocol] connected
2022-09-09 20:56:42.251 DEBUG (MainThread) [rflink.protocol] received data: 20;00;Nodo RadioFrequencyLink - RFLink Gateway V1.1 - R48;
2022-09-09 20:56:42.253 DEBUG (MainThread) [rflink.protocol] got packet: 20;00;Nodo RadioFrequencyLink - RFLink Gateway V1.1 - R48;
2022-09-09 20:56:42.261 DEBUG (MainThread) [rflink.protocol] decoded packet: {'node': 'gateway', 'protocol': 'unknown', 'hardware': 'Nodo RadioFrequencyLink', 'firmware': 'RFLink Gateway', 'version': '1.1', 'revision': '48'}
2022-09-09 20:56:42.263 DEBUG (MainThread) [rflink.protocol] got event: {'id': 'rflink', 'hardware': 'Nodo RadioFrequencyLink', 'firmware': 'RFLink Gateway', 'version': '1.1', 'revision': '48'}
2022-09-09 20:56:42.265 DEBUG (MainThread) [homeassistant.components.rflink] event of type unknown: {'id': 'rflink', 'hardware': 'Nodo RadioFrequencyLink', 'firmware': 'RFLink Gateway', 'version': '1.1', 'revision': '48'}
2022-09-09 20:56:42.265 DEBUG (MainThread) [homeassistant.components.rflink] unhandled event of type: unknown
2022-09-09 20:57:19.836 ERROR (Thread-2 (_thread_main)) [homeassistant.components.mqtt.client] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2022-09-09 20:57:21.096 ERROR (Thread-2 (_thread_main)) [homeassistant.components.mqtt.client] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2022-09-09 20:57:23.232 ERROR (Thread-2 (_thread_main)) [homeassistant.components.mqtt.client] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2022-09-09 20:57:27.405 ERROR (Thread-2 (_thread_main)) [homeassistant.components.mqtt.client] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2022-09-09 20:57:35.468 ERROR (Thread-2 (_thread_main)) [homeassistant.components.mqtt.client] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2022-09-09 20:57:51.569 ERROR (Thread-2 (_thread_main)) [homeassistant.components.mqtt.client] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2022-09-09 20:57:53.796 ERROR (SyncWorker_2) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 20:57:53.842 ERROR (SyncWorker_2) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 20:57:53.850 ERROR (SyncWorker_2) [msmart.security] unexpected data length
2022-09-09 20:57:53.884 ERROR (SyncWorker_2) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 20.93 
2022-09-09 20:58:23.629 ERROR (Thread-2 (_thread_main)) [homeassistant.components.mqtt.client] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2022-09-09 20:58:28.025 ERROR (SyncWorker_6) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 20:58:28.110 ERROR (SyncWorker_6) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 20:58:28.141 ERROR (SyncWorker_6) [msmart.security] unexpected data length
2022-09-09 20:58:28.204 ERROR (SyncWorker_6) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 55.25 
2022-09-09 20:58:45.445 ERROR (MainThread) [homeassistant.components.xiaomi_miio] Timeout fetching roborock.vacuum.s5e data
2022-09-09 20:58:45.530 ERROR (MainThread) [homeassistant.components.ipp.coordinator] Error fetching ipp data: Invalid response from API: Timeout occurred while connecting to IPP server.
2022-09-09 20:59:02.473 ERROR (SyncWorker_1) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 20:59:02.545 ERROR (SyncWorker_1) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 20:59:02.607 ERROR (SyncWorker_1) [msmart.security] unexpected data length
2022-09-09 20:59:02.654 ERROR (SyncWorker_1) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 89.7 
2022-09-09 20:59:17.469 ERROR (SyncWorker_0) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 20:59:17.481 ERROR (SyncWorker_0) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 20:59:17.485 ERROR (SyncWorker_0) [msmart.security] unexpected data length
2022-09-09 20:59:17.525 ERROR (SyncWorker_0) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 104.57 
2022-09-09 20:59:27.798 ERROR (Thread-2 (_thread_main)) [homeassistant.components.mqtt.client] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2022-09-09 20:59:32.464 ERROR (SyncWorker_0) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 20:59:32.500 ERROR (SyncWorker_0) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 20:59:32.520 ERROR (SyncWorker_0) [msmart.security] unexpected data length
2022-09-09 20:59:32.561 ERROR (SyncWorker_0) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 119.6 
2022-09-09 20:59:47.464 ERROR (SyncWorker_5) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 20:59:47.505 ERROR (SyncWorker_5) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 20:59:47.554 ERROR (SyncWorker_5) [msmart.security] unexpected data length
2022-09-09 20:59:47.599 ERROR (SyncWorker_5) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 134.64 
2022-09-09 21:00:02.468 ERROR (SyncWorker_5) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:00:02.518 ERROR (SyncWorker_5) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:00:02.548 ERROR (SyncWorker_5) [msmart.security] unexpected data length
2022-09-09 21:00:02.594 ERROR (SyncWorker_5) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 149.64 
2022-09-09 21:00:17.498 ERROR (SyncWorker_2) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:00:17.507 ERROR (SyncWorker_2) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:00:17.511 ERROR (SyncWorker_2) [msmart.security] unexpected data length
2022-09-09 21:00:17.519 ERROR (SyncWorker_2) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 164.56 
2022-09-09 21:00:32.499 ERROR (SyncWorker_2) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:00:32.507 ERROR (SyncWorker_2) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:00:32.515 ERROR (SyncWorker_2) [msmart.security] unexpected data length
2022-09-09 21:00:32.524 ERROR (SyncWorker_2) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 179.57 
2022-09-09 21:00:47.475 ERROR (SyncWorker_1) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:00:47.524 ERROR (SyncWorker_1) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:00:47.547 ERROR (SyncWorker_1) [msmart.security] unexpected data length
2022-09-09 21:00:47.587 ERROR (SyncWorker_1) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 194.63 
2022-09-09 21:01:02.557 ERROR (SyncWorker_4) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:01:02.567 ERROR (SyncWorker_4) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:01:02.609 ERROR (SyncWorker_4) [msmart.security] unexpected data length
2022-09-09 21:01:02.653 ERROR (SyncWorker_4) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 209.7 
2022-09-09 21:01:17.482 ERROR (SyncWorker_2) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:01:17.527 ERROR (SyncWorker_2) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:01:17.571 ERROR (SyncWorker_2) [msmart.security] unexpected data length
2022-09-09 21:01:17.616 ERROR (SyncWorker_2) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 224.66 
2022-09-09 21:01:27.935 ERROR (Thread-2 (_thread_main)) [homeassistant.components.mqtt.client] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2022-09-09 21:01:32.570 ERROR (SyncWorker_0) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:01:32.611 ERROR (SyncWorker_0) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:01:32.649 ERROR (SyncWorker_0) [msmart.security] unexpected data length
2022-09-09 21:01:32.698 ERROR (SyncWorker_0) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 239.74 
2022-09-09 21:01:47.508 ERROR (SyncWorker_4) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:01:47.563 ERROR (SyncWorker_4) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:01:47.606 ERROR (SyncWorker_4) [msmart.security] unexpected data length
2022-09-09 21:01:47.651 ERROR (SyncWorker_4) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 254.69 
2022-09-09 21:02:02.502 ERROR (SyncWorker_1) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:02:02.536 ERROR (SyncWorker_1) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:02:02.579 ERROR (SyncWorker_1) [msmart.security] unexpected data length
2022-09-09 21:02:02.625 ERROR (SyncWorker_1) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 269.67 
2022-09-09 21:02:17.572 ERROR (SyncWorker_6) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:02:17.637 ERROR (SyncWorker_6) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:02:17.668 ERROR (SyncWorker_6) [msmart.security] unexpected data length
2022-09-09 21:02:17.688 ERROR (SyncWorker_6) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 284.73 
2022-09-09 21:02:32.512 ERROR (SyncWorker_6) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:02:32.547 ERROR (SyncWorker_6) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:02:32.587 ERROR (SyncWorker_6) [msmart.security] unexpected data length
2022-09-09 21:02:32.616 ERROR (SyncWorker_6) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 299.66 
2022-09-09 21:02:47.527 ERROR (SyncWorker_0) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:02:47.550 ERROR (SyncWorker_0) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:02:47.580 ERROR (SyncWorker_0) [msmart.security] unexpected data length
2022-09-09 21:02:47.620 ERROR (SyncWorker_0) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 314.66 
2022-09-09 21:03:02.553 ERROR (SyncWorker_6) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:03:02.607 ERROR (SyncWorker_6) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:03:02.646 ERROR (SyncWorker_6) [msmart.security] unexpected data length
2022-09-09 21:03:02.691 ERROR (SyncWorker_6) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 329.73 
2022-09-09 21:03:17.516 ERROR (SyncWorker_5) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:03:17.552 ERROR (SyncWorker_5) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:03:17.616 ERROR (SyncWorker_5) [msmart.security] unexpected data length
2022-09-09 21:03:17.679 ERROR (SyncWorker_5) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 344.72 
2022-09-09 21:03:28.055 ERROR (Thread-2 (_thread_main)) [homeassistant.components.mqtt.client] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2022-09-09 21:03:32.528 ERROR (SyncWorker_5) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:03:32.544 ERROR (SyncWorker_5) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:03:32.565 ERROR (SyncWorker_5) [msmart.security] unexpected data length
2022-09-09 21:03:32.616 ERROR (SyncWorker_5) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 359.66 
2022-09-09 21:03:47.516 ERROR (SyncWorker_4) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:03:47.567 ERROR (SyncWorker_4) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:03:47.606 ERROR (SyncWorker_4) [msmart.security] unexpected data length
2022-09-09 21:03:47.650 ERROR (SyncWorker_4) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 374.69 
2022-09-09 21:04:02.531 ERROR (SyncWorker_4) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:04:02.565 ERROR (SyncWorker_4) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:04:02.610 ERROR (SyncWorker_4) [msmart.security] unexpected data length
2022-09-09 21:04:02.638 ERROR (SyncWorker_4) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 389.68 
2022-09-09 21:04:17.520 ERROR (SyncWorker_5) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:04:17.533 ERROR (SyncWorker_5) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:04:17.558 ERROR (SyncWorker_5) [msmart.security] unexpected data length
2022-09-09 21:04:17.575 ERROR (SyncWorker_5) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 404.62 
2022-09-09 21:04:32.563 ERROR (SyncWorker_5) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:04:32.613 ERROR (SyncWorker_5) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:04:32.633 ERROR (SyncWorker_5) [msmart.security] unexpected data length
2022-09-09 21:04:32.700 ERROR (SyncWorker_5) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 419.74 
2022-09-09 21:04:47.569 ERROR (SyncWorker_6) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:04:47.577 ERROR (SyncWorker_6) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:04:47.585 ERROR (SyncWorker_6) [msmart.security] unexpected data length
2022-09-09 21:04:47.592 ERROR (SyncWorker_6) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 434.63 
2022-09-09 21:05:02.532 ERROR (SyncWorker_5) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:05:02.568 ERROR (SyncWorker_5) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:05:02.607 ERROR (SyncWorker_5) [msmart.security] unexpected data length
2022-09-09 21:05:02.648 ERROR (SyncWorker_5) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 449.69 
2022-09-09 21:05:17.542 ERROR (SyncWorker_0) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:05:17.553 ERROR (SyncWorker_0) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:05:17.557 ERROR (SyncWorker_0) [msmart.security] unexpected data length
2022-09-09 21:05:17.576 ERROR (SyncWorker_0) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 464.62 
2022-09-09 21:05:28.174 ERROR (Thread-2 (_thread_main)) [homeassistant.components.mqtt.client] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2022-09-09 21:05:32.570 ERROR (SyncWorker_0) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:05:32.578 ERROR (SyncWorker_0) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:05:32.583 ERROR (SyncWorker_0) [msmart.security] unexpected data length
2022-09-09 21:05:32.596 ERROR (SyncWorker_0) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 479.64 
2022-09-09 21:05:47.536 ERROR (SyncWorker_3) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:05:47.587 ERROR (SyncWorker_3) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:05:47.598 ERROR (SyncWorker_3) [msmart.security] unexpected data length
2022-09-09 21:05:47.649 ERROR (SyncWorker_3) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 494.69 
2022-09-09 21:06:02.542 ERROR (SyncWorker_3) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:06:02.615 ERROR (SyncWorker_3) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:06:02.665 ERROR (SyncWorker_3) [msmart.security] unexpected data length
2022-09-09 21:06:02.677 ERROR (SyncWorker_3) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 509.72 
2022-09-09 21:06:17.563 ERROR (SyncWorker_4) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:06:17.621 ERROR (SyncWorker_4) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:06:17.665 ERROR (SyncWorker_4) [msmart.security] unexpected data length
2022-09-09 21:06:17.704 ERROR (SyncWorker_4) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 524.75 
2022-09-09 21:06:32.578 ERROR (SyncWorker_4) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:06:32.628 ERROR (SyncWorker_4) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:06:32.650 ERROR (SyncWorker_4) [msmart.security] unexpected data length
2022-09-09 21:06:32.695 ERROR (SyncWorker_4) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 539.74 
2022-09-09 21:06:47.559 ERROR (SyncWorker_1) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:06:47.606 ERROR (SyncWorker_1) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:06:47.654 ERROR (SyncWorker_1) [msmart.security] unexpected data length
2022-09-09 21:06:47.709 ERROR (SyncWorker_1) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 554.75 
2022-09-09 21:07:02.556 ERROR (SyncWorker_5) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:07:02.587 ERROR (SyncWorker_5) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:07:02.626 ERROR (SyncWorker_5) [msmart.security] unexpected data length
2022-09-09 21:07:02.662 ERROR (SyncWorker_5) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 569.7 
2022-09-09 21:07:17.623 ERROR (SyncWorker_4) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:07:17.691 ERROR (SyncWorker_4) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:07:17.726 ERROR (SyncWorker_4) [msmart.security] unexpected data length
2022-09-09 21:07:17.771 ERROR (SyncWorker_4) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 584.81 
2022-09-09 21:07:28.314 ERROR (Thread-2 (_thread_main)) [homeassistant.components.mqtt.client] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2022-09-09 21:07:32.570 ERROR (SyncWorker_4) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:07:32.614 ERROR (SyncWorker_4) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:07:32.646 ERROR (SyncWorker_4) [msmart.security] unexpected data length
2022-09-09 21:07:32.692 ERROR (SyncWorker_4) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 599.73 
2022-09-09 21:07:47.607 ERROR (SyncWorker_1) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:07:47.616 ERROR (SyncWorker_1) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:07:47.623 ERROR (SyncWorker_1) [msmart.security] unexpected data length
2022-09-09 21:07:47.630 ERROR (SyncWorker_1) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 614.67 
2022-09-09 21:08:02.597 ERROR (SyncWorker_2) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:08:02.647 ERROR (SyncWorker_2) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:08:02.686 ERROR (SyncWorker_2) [msmart.security] unexpected data length
2022-09-09 21:08:02.698 ERROR (SyncWorker_2) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 629.74 
2022-09-09 21:08:17.581 ERROR (SyncWorker_4) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:08:17.595 ERROR (SyncWorker_4) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:08:17.629 ERROR (SyncWorker_4) [msmart.security] unexpected data length
2022-09-09 21:08:17.674 ERROR (SyncWorker_4) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 644.72 
2022-09-09 21:08:32.611 ERROR (SyncWorker_5) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:08:32.620 ERROR (SyncWorker_5) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:08:32.628 ERROR (SyncWorker_5) [msmart.security] unexpected data length
2022-09-09 21:08:32.635 ERROR (SyncWorker_5) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 659.68 
2022-09-09 21:08:47.588 ERROR (SyncWorker_2) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:08:47.629 ERROR (SyncWorker_2) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:08:47.672 ERROR (SyncWorker_2) [msmart.security] unexpected data length
2022-09-09 21:08:47.716 ERROR (SyncWorker_2) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 674.76 
2022-09-09 21:09:02.591 ERROR (SyncWorker_5) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:09:02.646 ERROR (SyncWorker_5) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:09:02.685 ERROR (SyncWorker_5) [msmart.security] unexpected data length
2022-09-09 21:09:02.732 ERROR (SyncWorker_5) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 689.77 
2022-09-09 21:09:17.596 ERROR (SyncWorker_4) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:09:17.641 ERROR (SyncWorker_4) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:09:17.659 ERROR (SyncWorker_4) [msmart.security] unexpected data length
2022-09-09 21:09:17.703 ERROR (SyncWorker_4) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 704.75 
2022-09-09 21:09:28.373 ERROR (Thread-2 (_thread_main)) [homeassistant.components.mqtt.client] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2022-09-09 21:09:32.600 ERROR (SyncWorker_6) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:09:32.641 ERROR (SyncWorker_6) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:09:32.670 ERROR (SyncWorker_6) [msmart.security] unexpected data length
2022-09-09 21:09:32.704 ERROR (SyncWorker_6) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 719.75 
2022-09-09 21:09:47.799 ERROR (SyncWorker_1) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:09:47.808 ERROR (SyncWorker_1) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:09:47.816 ERROR (SyncWorker_1) [msmart.security] unexpected data length
2022-09-09 21:09:47.823 ERROR (SyncWorker_1) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 734.87 
2022-09-09 21:10:02.732 ERROR (SyncWorker_3) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:10:02.786 ERROR (SyncWorker_3) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:10:02.821 ERROR (SyncWorker_3) [msmart.security] unexpected data length
2022-09-09 21:10:02.867 ERROR (SyncWorker_3) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 749.91 
2022-09-09 21:10:17.740 ERROR (SyncWorker_6) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:10:17.797 ERROR (SyncWorker_6) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:10:17.836 ERROR (SyncWorker_6) [msmart.security] unexpected data length
2022-09-09 21:10:17.877 ERROR (SyncWorker_6) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 764.92 
2022-09-09 21:10:32.737 ERROR (SyncWorker_1) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:10:32.764 ERROR (SyncWorker_1) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:10:32.792 ERROR (SyncWorker_1) [msmart.security] unexpected data length
2022-09-09 21:10:32.821 ERROR (SyncWorker_1) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 779.86 
2022-09-09 21:10:47.740 ERROR (SyncWorker_5) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:10:47.790 ERROR (SyncWorker_5) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:10:47.829 ERROR (SyncWorker_5) [msmart.security] unexpected data length
2022-09-09 21:10:47.859 ERROR (SyncWorker_5) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 794.9 
2022-09-09 21:11:02.742 ERROR (SyncWorker_0) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:11:02.783 ERROR (SyncWorker_0) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:11:02.828 ERROR (SyncWorker_0) [msmart.security] unexpected data length
2022-09-09 21:11:02.861 ERROR (SyncWorker_0) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 809.9 
2022-09-09 21:11:17.785 ERROR (SyncWorker_4) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:11:17.793 ERROR (SyncWorker_4) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:11:17.800 ERROR (SyncWorker_4) [msmart.security] unexpected data length
2022-09-09 21:11:17.803 ERROR (SyncWorker_4) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 824.85 
2022-09-09 21:11:28.399 ERROR (Thread-2 (_thread_main)) [homeassistant.components.mqtt.client] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2022-09-09 21:11:32.747 ERROR (SyncWorker_6) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:11:32.788 ERROR (SyncWorker_6) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:11:32.818 ERROR (SyncWorker_6) [msmart.security] unexpected data length
2022-09-09 21:11:32.831 ERROR (SyncWorker_6) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 839.87 
2022-09-09 21:11:47.751 ERROR (SyncWorker_5) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:11:47.765 ERROR (SyncWorker_5) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:11:47.809 ERROR (SyncWorker_5) [msmart.security] unexpected data length
2022-09-09 21:11:47.844 ERROR (SyncWorker_5) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 854.89 
2022-09-09 21:12:02.760 ERROR (SyncWorker_0) [msmart.lan] Connect Error: 192.168.0.166:6444 timed out
2022-09-09 21:12:02.771 ERROR (SyncWorker_0) [msmart.lan] Sokcet is None: 192.168.0.166:6444
2022-09-09 21:12:02.815 ERROR (SyncWorker_0) [msmart.security] unexpected data length
2022-09-09 21:12:02.828 ERROR (SyncWorker_0) [msmart.lan] Authentication failed for None -> 192.168.0.166:6444 retries: 0 time: 869.87 

You can’t use that username. From the docs

This add-on is attached to the Home Assistant user system, so MQTT clients can make use of these credentials. Local users may also still be set independently within the configuration options for the add-on. For the internal Home Assistant ecosystem, we register homeassistant and addons , so these may not be used as user names

.

I have also mqtt user which is also not working until I restart the addon.
Then it is fine for 5-30 minutes and then it fails again9

Where is mqtt user defined?