scheb / switchbot-ip65

Read data from Switchbot IP65 device

Repository from Github https://github.comscheb/switchbot-ip65Repository from Github https://github.comscheb/switchbot-ip65

Read data from Switchbot IP65 device

This Python script is designed to read data from a Switchbot IP65 device using the BLE (Bluetooth Low Energy) protocol. It specifically targets a device with a given MAC address, retrieves temperature and humidity data from the advertising packets, and prints this information.

Usage

Update the MAC_ADDRESS variable in the script to the MAC address of your target Bluetooth device.

Run the script

The script will begin scanning for BLE devices. If it finds the device with the specified MAC address, it will extract temperature and humidity data from the advertisement packets.

Data Format

The Switchbot IP65 device encodes the temperature and humidity data in the manufacturer data:

  • humidity percent is presented as an integer in the 11th byte
  • temperature in °C is presented in two bytes:
    • The 10th byte is the integer part of the temperature
    • The 9th byte contains the fraction of .0-.9 presented as an integer (the value needs to be divided by 10)
    • The highest bit of the 10th byte is 0 for negative numbers and 1 for positive numbers

Contributions

Thanks for your interest in contributing to this project! Glad you like it 😊

I typically do not accept contributions to this project, as it is just meant as a demonstration how to read from the Switchbot IP65 device.

License

This library is available under the MIT license.

About

Read data from Switchbot IP65 device

License:MIT License


Languages

Language:Python 100.0%