Skip to content
nubicula edited this page Dec 13, 2020 · 6 revisions

Introduction

SwitchBot Bot's are small devices that help to add a little "Smart" to non-Smart devices. https://www.switch-bot.com/products/switchbot-bot

Reference

SwitchBot have documented their BLE API. https://github.com/OpenWonderLabs/python-host/wiki/Bot-BLE-open-API

Perform Actions

To perform a basic button press, Publish to MQTT :

Topic

 <PREFIX>/<MAC_ADDRESS>/SwitchBotBot/Request/Set

Data

87,1,0

esp32-ble2mqtt/data/config.json

{
    "wifi": {
    },
    "mqtt": {
        "server": {
        },
        "publish": {
            "retain": true
        },
        "topics" :{
            "prefix": "<PREFIX>",
            "get_suffix": "/Get",
            "set_suffix": "/Set"
        }
    },
    "ble": {
        "services": {
            "definitions": {
                "CBA20D00-224D-11E6-9FB8-0002A5D5C51B" : {
                    "name": "SwitchBotBot"
                }
            }
        },
        "characteristics": {
            "definitions": {
                "CBA20002-224D-11E6-9FB8-0002A5D5C51B" : {
                    "name": "Request"
                },
                "CBA20003-224D-11E6-9FB8-0002A5D5C51B" : {
                    "name": "Response"
                }
            }
        }
    }
}