Skip to content

Xiaomi Mijia BLE Temperature Hygrometer 2 integration for Home Assistant

License

Notifications You must be signed in to change notification settings

leonxi/mitemp_bt2

Repository files navigation

English | 简体中文

Xiaomi Mijia BLE Temperature Hygrometer 2

GitHub Release hacs_badge

This is a custom component for home assistant to use bluetooth adapter directly integrate the Xiaomi Mijia BLE Temperature Hygrometer (LYWSDCGQ/01ZM) and Mijia BLE Temperature Hygrometer 2 (LYWSD03MMC).

Auto discovery supported without any configuration from v0.2.0-dev release.

No Bluetooth Gateway required.

LYWSD03MMC LYWSDCGQ/01ZM
LYWSD03MMC LYWSDCGQ/01ZM

Requirements

  • Supported & tested on HassOS 4.13 (HassOS Release-4 build 13 (Stable))
    • Warning: HassOS 4.14 has BLE bugs need fix, BLE devices can not be connected.
    • Other versions need to be tested
  • Hardware need bluetooth adapter and be actived, tested on Raspberry PI 3 Model B
    • Other hardwares need to be tested

Supported devices

Name Model Model no.
Xiaomi Mijia BLE Temperature Hygrometer LYWSDCGQ/01ZM
Xiaomi Mijia BLE Temperature Hygrometer 2 LYWSD03MMC

Features

Mijia BLE Temperature Hygrometer (LYWSDCGQ/01ZM)

  • Attributes
    • temperature
    • humidity
    • battery

Mijia BLE Temperature Hygrometer 2 (LYWSD03MMC)

  • Attributes
    • temperature
    • humidity
    • battery

Install

You can install this custom component by adding this repository (https://github.com/leonxi/mitemp_bt2) to HACS in the settings menu of HACS first. You will find the custom component in the integration menu afterwards, look for 'Xiaomi Mijia BLE Temperature Hygrometer 2 Integration'. Alternatively, you can install it manually by copying the custom_component folder to your Home Assistant configuration folder.

Setup (Optional)

From v0.2.0-dev releases, it will auto discovery without any configuration.

# configuration.yaml

sensor:
  - platform: mitemp_bt2
    mac: 'A4:C1:38:AA:AA:AA'
    mode: 'LYWSD03MMC'
    name: book room
    period: 60
  - platform: mitemp_bt2
    mac: 'A4:C1:38:FF:FF:FF'
    mode: 'LYWSD03MMC'
    name: living room
    period: 60

Configuration variables:

  • mac (Required): The MAC of your device.
  • mode (Optional): The mode of your device. Default LYWSD03MMC
  • name (Optional): The name of your device.
  • period (Optional): The scan period of your device. Default 300 seconds.

Panel Sample

LYWSD03MMC_PANEL_SHOW

Todo

  • Integration Options
    • (Supported) Add auto discovery option, to control enable or disable discovery
    • (Supported) Add period option, to control period of fetching devices' data, default period is 15 minutes. Avoid frequent access to Bluetooth devices, resulting in high power consumption of them.
  • Known issues
    • (Fixed) When installation, discoverred devices can not be displayed, and set their own areas.
    • (Fixed) In devices list, area or name can not be modified.