I’m excited to share that we’ve developed and released a brand-new add-on using the SwitchBot API specifically tailored for MQTT integration.
One of the standout features is its comprehensive support for virtual infrared remote devices. Plus, it’s capable of receiving and processing Webhooks, which is quite a game-changer.
What’s more, the core of this add-on is built using C# .NET 6, and you’ll be amazed to know that the user interface is powered by Blazor Server, bringing a unique touch to the Ingress screen.
I understand that some folks might have security concerns, but we’ve taken a novel approach by incorporating Ngrok internally to enable Webhook reception without the need to open ports externally. It’s something you probably haven’t seen before.
Lastly, since it’s running on the .NET , it does have a slightly higher memory consumption (around 300MB on the amd64 architecture).
I invite you to check out the repository and would absolutely love to hear your feedback. Pull requests are more than welcome too!
Looks like a great add-on. Just getting started with it and when I try to pull in my devices, the list remains blank. The logs show a success/100 message back, and I can see all of my devices in the array, but then it appears to hit an error:
10:11:00 fail: SwitchBotMqttApp.Logics.DeviceConfigurationManager[0] LoadDevicesAsync error. System.InvalidOperationException: Sequence contains no matching element at System.Linq.ThrowHelper.ThrowNoMatchException() at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate) at SwitchBotMqttApp.Logics.DeviceConfigurationManager.<>c__DisplayClass9_0.<LoadDevicesAsync>b__0(Devicelist d) in C:\github\hsakoh\switchbot-mqtt\src\SwitchBotMqttApp\Logics\DeviceConfigurationManager.cs:line 86 at System.Linq.Enumerable.SelectArrayIterator`2.ToList() at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at SwitchBotMqttApp.Logics.DeviceConfigurationManager.LoadDevicesAsync(DevicesConfig currentData, CancellationToken cancellationToken)
I am so happy to have found this post.
It’s been weeks if not months that I am trying to implement my K10+ vaccuum in HA.
As suggested by hskoh, just had to configure in the addon:
Switchbo S10 integrated in HA easily thanks to this add on. Thanks a lot for that ! Works like a charm. Just a few issues with some of the functions of the robot, maybe due to the API, but the most important is working fine. In case you need feedback to work on the S10 piece and test though, I’m happy to help !
To compensate for a missing feature in the SwitchBot Keypad Pro, I want to create an automation that generates a one-time password for the person who will be cleaning my house. I managed to do this using the web interface of this add-on but I can’t figure out the MQTT payloads to use in a n automation. Can someone help me?
Unfortunately not, I have the same problem as shown in the screenshot from jimmy.edison. Would love to get this working. If I can help with any testing / validation, happy to support.
Through MQTT, I see the your same device info, but when I try to set the disposable password using the interface provided by the integration, I can set it.
Regarding the sensor values for KeyPad Touch and KeyPad:
In short, the values for eventName, commandId, and result will only be populated when Webhook reception is enabled and you receive a Webhook for creating or deleting a passcode.
SwitchBot devices have values that can be obtained through the GetDeviceStatusAPI and those that can be obtained via Webhook.
For instance, for the Curtain, slidePosition can be obtained from both sources. The KeyPad is somewhat unique in that meaningful values cannot be retrieved through the GetDeviceStatusAPI.
If you do not plan to receive Webhooks, it is advisable to disable the relevant fields in the device configuration page.
In the image below, the clock icon represents values that can be obtained through the GetDeviceStatusAPI, while the cloud icon represents values that can be obtained through Webhook.
(If possible, please write issue in a GitHub so that I can notice it promptly!)
At this time, the Outdoor Spotlight Cam 2K does not return meaningful responses via the GetStatus API, and webhooks are not triggered even when an event occurs, making it difficult to integrate with Home Assistant.
Hey there, I’m looking at getting a k10+ and am trying to figure out what level of control you get from this add-on. Do you get a map with room names or just a vacuum entity or some services?? Sorry, really having a hard time finding that info without having the device to try it out
@jackson.moormeier In short, no, is the answer to your question. The K10+ commands and responses are found in the actual API document - just scroll down.