question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MCCGQ02HL BLE (Xiaomi Mijia Window Door Sensor 2) permanent OFF status, no data

See original GitHub issue

I have MCCGQ02HL (Xiaomi Mijia Window Door Sensor 2) and try to integrate with HA (Home Assistant ver 0.118.2 on RPi v4B) using HACS/Passive BLE monitor integration (Xiaomi Mijia BLE MiBeacon monitor) .

configuration.yaml

ble_monitor:
  rounding: True
  decimals: 1
  period: 60
  log_spikes: False
  use_median: False
  active_scan: True
  hci_interface: 0
  batt_entities: True
  discovery: True
  restore_state: True
  report_unknown: True
  devices:
    - mac: E4:AA:EC:35:01:CD

logger:
  default: warn
  logs:
    custom_components.ble_monitor: debug

after conecting device with BLE monitor interation sensor has only status OFF, no date is avialible

below is the data from LOG

2020-11-23 12:25:26 DEBUG (SyncWorker_0) [custom_components.ble_monitor.sensor] Platform startup
2020-11-23 12:25:26 DEBUG (SyncWorker_0) [custom_components.ble_monitor.sensor] BLE monitor initialization
2020-11-23 12:25:26 INFO (SyncWorker_0) [custom_components.ble_monitor.sensor] Attention! Option report_unknown is enabled, be ready for a huge output...
2020-11-23 12:25:26 DEBUG (SyncWorker_0) [custom_components.ble_monitor.sensor] 0 encryptors mac:key pairs loaded.
2020-11-23 12:25:26 DEBUG (SyncWorker_0) [custom_components.ble_monitor.sensor] whitelist: []
2020-11-23 12:25:26 DEBUG (SyncWorker_0) [custom_components.ble_monitor.sensor] 0 whitelist item(s) loaded.
2020-11-23 12:25:26 DEBUG (SyncWorker_0) [custom_components.ble_monitor.sensor] BLE monitor initialized
2020-11-23 12:25:26 DEBUG (Thread-6) [custom_components.ble_monitor.sensor] Dataparser loop started!
2020-11-23 12:25:26 DEBUG (Thread-6) [custom_components.ble_monitor.sensor] Spawning HCIdump thread
2020-11-23 12:25:26 DEBUG (Thread-6) [custom_components.ble_monitor.sensor] HCIdump thread: Init
2020-11-23 12:25:26 DEBUG (Thread-7) [custom_components.ble_monitor.sensor] HCIdump thread: Run
2020-11-23 12:25:26 DEBUG (Thread-7) [custom_components.ble_monitor.sensor] HCIdump thread: connected to hci0
2020-11-23 12:25:26 DEBUG (Thread-7) [custom_components.ble_monitor.sensor] HCIdump thread: start main event_loop
2020-11-23 12:25:26 DEBUG (SyncWorker_0) [custom_components.ble_monitor.sensor] Platform setup finished
2020-11-23 12:25:26 DEBUG (MainThread) [custom_components.ble_monitor.sensor] async_added_to_hass called for ble opening E4AAEC3501CD
2020-11-23 12:25:26 INFO (MainThread) [custom_components.ble_monitor.sensor] <state sensor.ble_opening_e4aaec3501cd=off; sensor type=MCCGQ02HL, mac address=E4:AA:EC:35:01:CD, friendly_name=ble opening E4AAEC3501CD, device_class=opening @ 2020-11-23T10:29:26.380941+01:00>
2020-11-23 12:25:26 DEBUG (MainThread) [custom_components.ble_monitor.sensor] async_added_to_hass called for ble light E4AAEC3501CD
2020-11-23 12:25:26 INFO (MainThread) [custom_components.ble_monitor.sensor] <state sensor.ble_light_e4aaec3501cd=off; sensor type=MCCGQ02HL, mac address=E4:AA:EC:35:01:CD, friendly_name=ble light E4AAEC3501CD, device_class=light @ 2020-11-23T10:29:26.381522+01:00>
2020-11-23 12:25:26 DEBUG (MainThread) [custom_components.ble_monitor.sensor] async_added_to_hass called for ble battery E4AAEC3501CD

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19

github_iconTop GitHub Comments

1reaction
scoat76commented, Nov 25, 2020

just a comment to this issue, with this sensor you will get 4 things in the pairing file: Did: Token: Bindkey: Mac:

to not confuse people, it is a BINDKEY, which is encryption key and this one you is needed in configuration … it might be confusing if you see also TOKEN 😃

1reaction
Magalex2x14commented, Nov 23, 2020

I have already done )

Read more comments on GitHub >

github_iconTop Results From Across the Web

MCCGQ02HL (Xiaomi Mijia Window Door Sensor 2)
Actually i manage to configure it and sensors are working as expected but IT is not doable without android phone and MOD version...
Read more >
Xiaomi Mijia MCCGQ02HL Door Window Sensor (BLE)
Hi,. For the moment we support the Qingping CGH1, this sensor works out of the box due to its unencrypted data format. MCCGQ02HL...
Read more >
By Manufacture - Passive BLE Monitor integration
Passively monitors BLE messages from Xiaomi Mijia BLE MiBeacon, Qingping, ATC, ... 1 a 2 seconds, but the measurement data is only changed...
Read more >
How to connect just about any Xiaomi BLE device to ESPHome
For example, you could use the Xiaomi Mi Smart Home Door/Window Sensor 2 to detect when a window has been opened and let...
Read more >
Xiaomi ble sensors - Albert Schweizer - Bremen
Control Xiaomi Mijia BLE Temperature and Humidity Sensor and E-ink Clock sensor ... for opening doors and windows Xiaomi MCCGQ02HL Window Door Sensor...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found