From 70d6a5b63c9092948d392809bf9de31080eef6e6 Mon Sep 17 00:00:00 2001 From: Jc2k Date: Sun, 24 Jul 2022 21:25:11 +0100 Subject: [PATCH] Xiaomi MiBeacon/BLE support (#23491) Co-authored-by: Martin Hjelmare --- source/_integrations/xiaomi_ble.markdown | 48 ++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 source/_integrations/xiaomi_ble.markdown diff --git a/source/_integrations/xiaomi_ble.markdown b/source/_integrations/xiaomi_ble.markdown new file mode 100644 index 00000000000..3c6c8a7e969 --- /dev/null +++ b/source/_integrations/xiaomi_ble.markdown @@ -0,0 +1,48 @@ +--- +title: Xiaomi BLE +description: Instructions on how to integrate Xiaomi BLE devices into Home Assistant. +ha_category: + - Sensor +ha_bluetooth: true +ha_release: 2022.8 +ha_iot_class: Local Push +ha_codeowners: + - '@Jc2k' + - '@Ernst79' +ha_domain: xiaomi_ble +ha_config_flow: true +ha_platforms: + - sensor +ha_integration_type: integration +--- + +Integrates devices that implement the Xiaomi Mijia BLE MiBeacon protocol and other Xiaomi BLE devices that support passive collection. It listens to Bluetooth broadcasts that the device makes by itself, allowing us to track the latest sensor values without needing to wake it up from deep sleep to poll and conserving its battery power. + +The integration will automatically discover devices once the [Bluetooth](/integrations/bluetooth) integration is enabled and functional. + +{% include integrations/config_flow.md %} + +## Supported device classes + +It is possible that we detect your device because it uses the MiBeacon protocol but don't yet support any or all of its sensors. We currently actively test devices with the following sensor classes. + +- Temperature +- Humidity +- Moisture +- Illumination +- Conductivity +- Battery + +## Encryption + +Some devices use AES encryption to protect the sensor values they are broadcasting. + +* MiBeacon v2/v3 use unauthenticated AES with a 24 character hexadecimal (12 byte) key +* MiBeacon v4/v5 use authenticated AES with a 32 character hexadecimal (16 byte) key + +This key is called the bindkey or beaconkey. + +There are a few ways to obtain a bindkey for your device: + +* Set your own. The [Telink Flasher](https://atc1441.github.io/TelinkFlasher.html) allows you to generate new bindkeys for devices it supports. The new bind key will work with Home Assistant, but the Mi Home app will not recognize the sensor anymore once the device has been activated by the TeLink flasher application. To use the sensor again with the Xiaomi Mi Home app, the device needs to be removed and then re-added inside the Mi Home app. +* Extract the keys from Xiaomi Cloud using a [token extractor](https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor) tool.