UPDATE 20 Mar 2021 - Added Docker container option in the Github repository.
The SwitchBot integration for Home Assistant does not support SwitchBot Meter Temperature & Humidity Sensors. sbm2mqtt is an easy way to integrate your Meters with Home Assistant using MQTT instead.
Look here on GitHub.
sbm2mqtt scans for BLE advertisements from Switchbot Meters, grabs temperature, humidity & battery information from them and then publishes the data to an MQTT topic for easy integration with Home Assistant.
sbm2mqtt cannot be run using the python_script component or under non-“Core” Home Assistant (was Hassio), because it requires extra Python libraries to be imported. Instead run it on a separate pi or similar, or in a separate container.
sbm2mqtt works like this:
- Scan for Bluetooth Low Energy devices, looking for SwitchBot Meters.
- For each SwitchBot Meter, grab the MAC address, temperature, humidity and battery level from the BLE advertisement.
- Publish the temperature, humidity and battery level for each SwitchBot Meter separately to an MQTT topic that includes the MAC address.
- Print the values to the terminal (if not running in the background) and save them to a log.
- Based on your configuration of Home Assistant with MQTT sensors for the sbm2mqtt MQTT topics, HA updates the states of those sensors with every new MQTT message.
Enjoy.