Skip to content

Seestern93/ble_shelly_scan_switchbot_meter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Functionality

The script is using bluetooth low energy (BLE) to listen for Switchbotmeter devices and their broadcast messages. Over a whitelist of MAC addresses, only devices you like to read are checked. The data is parsed and finally broadcasted over WiFi with MQTT so that other devices can use the information (or your home automation system can import and show you the values).

Prerequisites

The script needs following hardware (other variants may work too): Prices are for EU

I have tested it on following shelly devices:

  • Shelly RGBW PM (Plus device)
  • Shelly Plus 1 (Plus device)

How to install on Shelly Gen2 or higher

  1. You need to activate Bluetooth on your shelly device

  2. Disable "Bluetooth Gateway", otherwise active scan will not work grafik

  3. Make sure, that no other script is running which uses BLE Scanner, otherwise scripts will interfere each other (if you have multiple Shelly devices, you can split the load over them)

  4. Create new script and copy the code to the script

  5. Enter the MAC addresses from the Switchbotmeter devices to the script, and start the script

  6. Make sure, that "Run on startup" is marked for the script, so that after startup it still works

  7. Check on console, if the devices are found and useful values are printed

Open Points

  • Verify that script is bug-free
    • Check proper parsing of negative °C temperatures
  • Cleanup code and enhance in-code docu
  • Support other Switchbot devices like SBM Pro or Outdoor or Switchbot Hub
  • Check that code works

Remark

If you find any bugs, please raise an issue. Since I am very busy, it may take some time to answer. If you have improvements, you can create a pull-request and I will takeover useful code enhancements :) Apart from that, I cannot give any guarantee that the script works or work in the future (since maybe some firmware changes and BLE broadcast payload is being changed by Switchbot or something similar).

Releases

No releases published

Packages

No packages published