Services not starting since last update
Since the last Update all Services are not starting an in the log is the following message
11:01:33 info: SwitchBotMqttApp.Logics.DeviceConfigurationManager[0] device configuration file found. 4,0 11:01:34 fail: SwitchBotMqttApp.Services.MqttCoreService[0] StartAsync failed. System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request). at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() at System.Net.Http.Json.HttpClientJsonExtensions.<FromJsonAsyncCore>g__Core|12_0[TValue,TJsonOptions](HttpClient client, Task1 responseTask, Boolean usingResponseHeadersRead, CancellationTokenSource linkedCTS, Func4 deserializeMethod, TJsonOptions jsonOptions, CancellationToken cancellationToken) at HomeAssistantAddOn.Mqtt.SupervisorApi.GetServicesMqtt() in /home/runner/work/switchbot-mqtt/switchbot-mqtt/src/HomeAssistant/HomeAssistantAddOn.Mqtt/SupervisorApi.cs:line 12 at HomeAssistantAddOn.Mqtt.MqttService.StartAsync() in /home/runner/work/switchbot-mqtt/switchbot-mqtt/src/HomeAssistant/HomeAssistantAddOn.Mqtt/MqttService.cs:line 75 at SwitchBotMqttApp.Services.MqttCoreService.StartAsync(CancellationToken cancellationToken) in /home/runner/work/switchbot-mqtt/switchbot-mqtt/src/SwitchBotMqttApp/Services/MqttCoreService.cs:line 36
all other MQTT devices can connect to the MQTT Broker.
As an event, it appears that the system is attempting to retrieve MQTT connection information but is failing to communicate with the HAOS Supervisor API.
This functionality has not been modified in the most recent add-on update.
Do you know what the version of the add-on was before the update? What is the current version of the add-on? What is the current version of Home Assistant OS? Have you tried restarting HAOS to see if the issue improves?
Thanks for the quick reply.
HAOS was rebooted 2-3 times since the Problem startet
Installed of the Addon is 1.0.42 I installed from 1.0.40 to 1.0.41 and then 1.0.42
Versions of Home Assistant: Core 2025.6.3 Supervisor 2025.06.2 Operating System 15.2
I switched the MQTT configuration to manual now it works
Manual configuration is a very effective impact reduction measure. I am glad that functionality was restored first.
My environment is as follows: Home Assistant OS Core 2025.6.3 Supervisor 2025.06.2 Operating System 15.2
I’m using the Mosquitto broker add-on, and the automatic configuration is working.
There might be an issue specific to your environment. Could there be any errors showing up in the Supervisor logs?
I checked the logs but i can't see something with de Mosquitto Broker.
but i see that in de Broker log there are a lot login attempts from one IP Address without user and it directly disconnects
2025-06-27 13:19:09: New connection from 172.30.32.2:40840 on port 1883. 2025-06-27 13:19:09: Client <unknown> closed its connection.
And it seems that this is de supervisor
➜ ~ nslookup 172.30.32.2 ;; Got recursion not available from 172.30.32.3 2.32.30.172.in-addr.arpa name = hassio. 2.32.30.172.in-addr.arpa name = hassio.local.hass.io. 2.32.30.172.in-addr.arpa name = supervisor. 2.32.30.172.in-addr.arpa name = supervisor.local.hass.io.
i think i have to check the broker and the supervisor
Processing Flow:
- If automatic configuration is enabled, the system calls the SupervisorAPI (/services/mqtt) to retrieve connection information such as Host, Port, and UserName.
- An attempt is made to establish an MQTT connection.
The log you initially shared indicates that the process failed at step 1, meaning the system did not connect to the MQTT broker.
Since a 400 response was returned, i suspect that something may be occurring within the supervisor container. https://github.com/home-assistant/supervisor/issues I've had a quick look at the Issues and there doesn't seem to be any recent related bug events. Could it be 5812?
hm so i just checked the Supervisor API from the Terminal:
curl -X GET
-H "Authorization: Bearer MYTOKEN"
-H "Content-Type: application/json"
http://supervisor/services/mqtt {"result":"error","message":"Service not enabled"}#
and if i just check the services i get this
➜ ~ curl -X GET
-H "Authorization: Bearer MYTOKEN"
-H "Content-Type: application/json"
http://supervisor/services
{"result":"ok","data":{"services":[{"slug":"mqtt","available":false,"providers":["core_mosquitto"]},{"slug":"mysql","available":false,"providers":[]}]}}#
so i investigated a little bit more: i used a homeassistant user for authentication in Mosquitto and just configured this user in de Mosquitto Settings -->
http://supervisor/services {"result":"ok","data":{"services":[{"slug":"mqtt","available":true,"providers":["core_mosquitto"]},{"slug":"mysql","available":false,"providers":[]}]}}#
now i can set switchbot-mqtt to get the configuration from the supervisor and it works.
I see! I'm glad to see it resolved. When the mosquitto addon is simply installed, the HomeAssistant user should be able to authenticate unconditionally, but perhaps the authentication credentials were somehow lost due to some trigger?
https://github.com/home-assistant/addons/blob/master/mosquitto/DOCS.md#access-control-lists-acls
Whatever the cause may be, this will likely help other users who encounter the same issue in the future. Thanks for the feedback.
I just had exactly the same issue from the latest update - setting to manual seems to have worked too!
I just had exactly the same issue from the latest update - setting to manual seems to have worked too!
Can you please share how to "setting to manual"? I'm not able to solve. Thanks.
Hi I have a similar issue, that the services are not getting started (and fail also) and also not automatically start.
In the LOG I can the following messages
09:40:29 fail: SwitchBotMqttApp.Services.MqttCoreService[0] StartAsync failed. System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request). at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() at System.Net.Http.Json.HttpClientJsonExtensions.<FromJsonAsyncCore>g__Core|12_0[TValue,TJsonOptions](HttpClient client, Task`1 responseTask, Boolean usingResponseHeadersRead, CancellationTokenSource linkedCTS, Func`4 deserializeMethod, TJsonOptions jsonOptions, CancellationToken cancellationToken) at HomeAssistantAddOn.Mqtt.SupervisorApi.GetServicesMqtt() in /home/runner/work/switchbot-mqtt/switchbot-mqtt/src/HomeAssistant/HomeAssistantAddOn.Mqtt/SupervisorApi.cs:line 12 at HomeAssistantAddOn.Mqtt.MqttService.StartAsync() in /home/runner/work/switchbot-mqtt/switchbot-mqtt/src/HomeAssistant/HomeAssistantAddOn.Mqtt/MqttService.cs:line 75 at SwitchBotMqttApp.Services.MqttCoreService.StartAsync(CancellationToken cancellationToken) in /home/runner/work/switchbot-mqtt/switchbot-mqtt/src/SwitchBotMqttApp/Services/MqttCoreService.cs:line 36
09:40:32 info: SwitchBotMqttApp.Logics.DeviceConfigurationManager[0] device configuration file found. 2,0
09:51:07 info: SwitchBotMqttApp.Logics.DeviceConfigurationManager[0] device configuration file found. 2,0
09:51:25 info: SwitchBotMqttApp.Logics.DeviceConfigurationManager[0] old device configuration file renamed to /data/switchbot_config_20250716075125.json
09:51:25 info: SwitchBotMqttApp.Logics.DeviceConfigurationManager[0] device configuration file saved.
09:51:26 info: SwitchBotMqttApp.Logics.DeviceConfigurationManager[0] old device configuration file renamed to /data/switchbot_config_20250716075126.json
09:51:26 info: SwitchBotMqttApp.Logics.DeviceConfigurationManager[0] device configuration file saved.
09:51:26 warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100] Unhandled exception rendering component: The file '/data/switchbot_config_20250716075126.json' already exists. System.IO.IOException: The file '/data/switchbot_config_20250716075126.json' already exists. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException) at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite) at SwitchBotMqttApp.Logics.DeviceConfigurationManager.SaveFileAsync(DevicesConfig data, CancellationToken cancellationToken) in /home/runner/work/switchbot-mqtt/switchbot-mqtt/src/SwitchBotMqttApp/Logics/DeviceConfigurationManager.cs:line 45 at SwitchBotMqttApp.Components.Pages.DeviceConfiguration.Save() in /home/runner/work/switchbot-mqtt/switchbot-mqtt/src/SwitchBotMqttApp/Components/Pages/DeviceConfiguration.razor.cs:line 57 at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task) at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
09:51:26 fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111] Unhandled exception in circuit '9KOtiMddlwy0c7J5P7kW9SEePuvxfHDOShTLb7jIBGs'. System.IO.IOException: The file '/data/switchbot_config_20250716075126.json' already exists. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException) at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite) at SwitchBotMqttApp.Logics.DeviceConfigurationManager.SaveFileAsync(DevicesConfig data, CancellationToken cancellationToken) in /home/runner/work/switchbot-mqtt/switchbot-mqtt/src/SwitchBotMqttApp/Logics/DeviceConfigurationManager.cs:line 45 at SwitchBotMqttApp.Components.Pages.DeviceConfiguration.Save() in /home/runner/work/switchbot-mqtt/switchbot-mqtt/src/SwitchBotMqttApp/Components/Pages/DeviceConfiguration.razor.cs:line 57 at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task) at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
09:52:22 info: SwitchBotMqttApp.Services.MqttCoreService[0] stopped
09:52:23 info: SwitchBotMqttApp.Logics.DeviceConfigurationManager[0] device configuration file found. 2,0
09:52:23 fail: SwitchBotMqttApp.Services.MqttCoreService[0] StartAsync failed. System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request). at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() at System.Net.Http.Json.HttpClientJsonExtensions.<FromJsonAsyncCore>g__Core|12_0[TValue,TJsonOptions](HttpClient client, Task`1 responseTask, Boolean usingResponseHeadersRead, CancellationTokenSource linkedCTS, Func`4 deserializeMethod, TJsonOptions jsonOptions, CancellationToken cancellationToken) at HomeAssistantAddOn.Mqtt.SupervisorApi.GetServicesMqtt() in /home/runner/work/switchbot-mqtt/switchbot-mqtt/src/HomeAssistant/HomeAssistantAddOn.Mqtt/SupervisorApi.cs:line 12 at HomeAssistantAddOn.Mqtt.MqttService.StartAsync() in /home/runner/work/switchbot-mqtt/switchbot-mqtt/src/HomeAssistant/HomeAssistantAddOn.Mqtt/MqttService.cs:line 75 at SwitchBotMqttApp.Services.MqttCoreService.StartAsync(CancellationToken cancellationToken) in /home/runner/work/switchbot-mqtt/switchbot-mqtt/src/SwitchBotMqttApp/Services/MqttCoreService.cs:line 36
09:52:25 info: SwitchBotMqttApp.Services.MqttCoreService[0] stopped
Can someone help with that pls. Thanks!
I just had exactly the same issue from the latest update - setting to manual seems to have worked too!
Can you please share how to "setting to manual"? I'm not able to solve. Thanks.
In the settings of the Addon set AutoConfig: false and fill in the mqtt user and password.
Giving up on automatic configuration and switching to manual configuration is a quick solution. The issue with automatic configuration not working is likely due to a problem with either the Supervisor or the core_mosquitto add-on.
Assuming you are using the core_mosquitto add-on in HAOS... You should check the contents of the following files. Please make sure to mask any passwords when presenting them. I will share the configuration of my environment for reference.
- /mnt/data/supervisor/addons/data/core_mosquitto/options.json
{
"logins": [],
"require_certificate": false,
"certfile": "fullchain.pem",
"keyfile": "privkey.pem",
"customize": {
"active": false,
"folder": "mosquitto"
}
- /mnt/data/supervisor/addons/data/core_mosquitto/system_user.json
{"homeassistant":{"password":"xxxxxxxxxx"},"addons":{"password":"xxxxxxxxxx"}}
https://github.com/home-assistant/addons/blob/master/mosquitto/rootfs/etc/services.d/mosquitto/discovery
docker logs addon_core_mosquitto
This issue will be closed due to lack of additional information. Please comment with further details if available, and we will reopen the issue.