MagicSwitchbot (Bluetooth Proxy) integration

Hi everyone,

I’ve created a custom Home Assistant integration for Magic Switchbot devices that communicate over Bluetooth Low Energy (BLE).

The original MagicSwitchbot integration has not been maintained for years and no longer works with current versions of Home Assistant.

I made it because I wanted to use these devices directly in Home Assistant, including through an ESPHome Bluetooth proxy. The integration supports automatic discovery and also provides a config flow for adding a device manually by its MAC address.

Features

  • Automatic Bluetooth device discovery
  • Manual setup by MAC address
  • switch and button entities
  • Optional battery and RSSI sensors
  • Configuration options for enabling entities, command retries and command timeout
  • Local BLE communication through a Bluetooth adapter or a connectable ESPHome Bluetooth proxy

The battery level comes from BLE advertisements, so it updates when the device sends an advertisement; it is not polled continuously.

This is a community integration and is still being tested. I’d appreciate feedback, especially from anyone using a Magic Switchbot device with a different Bluetooth adapter or proxy setup.

GitHub: GitHub - mnowok/magicswitchbot_ble: Home Assistant integration for Magic Switchbot via BLE / ESPHome proxy · GitHub

To try it with HACS, add the repository above as a custom repository with the category Integration.