Skip to content

Allows you to connect SwitchBot devices to HomeAssistant without the need of a hub.

License

Notifications You must be signed in to change notification settings

1RandomDev/switchbot-bridge

Repository files navigation

switchbot-bridge

This script allows you to connect SwitchBot devices to HomeAssistant without the need of a hub. I'm aware of the official SwitchBot integration, but in some cases the machine running HomeAssistant is too far away from the bot or doesn't support Bluetooth.

Raspberry Pi

It's recommended to use an external USB Bluetooth adapter and not the integrated module in most Raspberry Pis to avoid connection issues or slow response time.

Installation

To install and run the script execute:

    $ git clone https://github.com/1RandomDev/switchbot-bridge
    $ npm install
    $ cp config.sample.json config.json
    $ node index.js

Configuration

  • devices
    • List of your devices
      • name: Device name displayed in HomeAssistant
      • address: Bluetooth mac address (SwitchBot app -> Device settings -> 3 dots -> BLE MAC)
  • mqtt: MQTT broker which HA is connected to
    • ...
  • updateInterval: The update interval for the device info (in hours)
  • optimisticMode: Weather the switch entities in HomeAssistant should be in optimistic mode. (There is no feedback from the SwitchBot, in normal mode the last known state will be used.)
  • logLevel: Application log level (available log levels)

About

Allows you to connect SwitchBot devices to HomeAssistant without the need of a hub.

Resources

License

Stars

Watchers

Forks