Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aqara lock N100 #484

Closed
skaken opened this issue Aug 28, 2021 · 35 comments
Closed

Aqara lock N100 #484

skaken opened this issue Aug 28, 2021 · 35 comments
Labels
new sensor Request for a new sensor

Comments

@skaken
Copy link

skaken commented Aug 28, 2021

Thank you for all your great work with this component! I’m wondering if it is possible to implement support for BLE advertisements from the Aqara N100 lock? Could you please have a look at the samples I’ve collected?

2021-08-23 23:13:03 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0687918aeb441fd72d0100 2021-08-23 23:13:05 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0687918aeb441fd72d0100 2021-08-23 23:13:08 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0687918aeb441fd72d0100 2021-08-23 23:13:14 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0687918aeb441fd72d0100 2021-08-23 23:13:17 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0687918aeb441fd72d0100 2021-08-23 23:13:20 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -86, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0687918aeb441fd72d0100 2021-08-23 23:13:20 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0687918aeb441fd72d0100 2021-08-23 23:13:22 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e0688918aeb441fd70a100564710f2461 2021-08-23 23:13:22 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -90, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e0688918aeb441fd70a100564710f2461 2021-08-23 23:13:23 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0689918aeb441fd72d0100 2021-08-23 23:13:23 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0689918aeb441fd72d0100 2021-08-23 23:13:24 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -86, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0689918aeb441fd72d0100 2021-08-23 23:13:29 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0689918aeb441fd72d0100 2021-08-23 23:13:33 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0689918aeb441fd72d0100 2021-08-23 23:13:42 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0689918aeb441fd72d0100 2021-08-23 23:13:44 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -90, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0689918aeb441fd72d0100 2021-08-23 23:13:47 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0689918aeb441fd72d0100 2021-08-23 23:13:52 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -86, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e068a918aeb441fd70a1005648f0f2461 2021-08-23 23:13:52 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -86, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e068a918aeb441fd70a1005648f0f2461 2021-08-23 23:13:56 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068b918aeb441fd72d0100 2021-08-23 23:13:59 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068b918aeb441fd72d0100 2021-08-23 23:14:02 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068b918aeb441fd72d0100 2021-08-23 23:14:05 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068b918aeb441fd72d0100 2021-08-23 23:14:06 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068b918aeb441fd72d0100 2021-08-23 23:14:09 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068b918aeb441fd72d0100 2021-08-23 23:14:15 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068b918aeb441fd72d0100 2021-08-23 23:14:22 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e068c918aeb441fd70a100564ad0f2461 2021-08-23 23:14:22 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e068c918aeb441fd70a100564ad0f2461 2021-08-23 23:14:22 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e068c918aeb441fd70a100564ad0f2461 2021-08-23 23:14:23 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e068c918aeb441fd70a100564ad0f2461 2021-08-23 23:14:24 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068d918aeb441fd72d0100 2021-08-23 23:14:24 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068d918aeb441fd72d0100 2021-08-23 23:14:27 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068d918aeb441fd72d0100 2021-08-23 23:14:30 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068d918aeb441fd72d0100 2021-08-23 23:14:41 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068d918aeb441fd72d0100 2021-08-23 23:14:45 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068d918aeb441fd72d0100 2021-08-23 23:14:45 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068d918aeb441fd72d0100 2021-08-23 23:14:47 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068d918aeb441fd72d0100 2021-08-23 23:14:51 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -86, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068d918aeb441fd72d0100 2021-08-23 23:14:52 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e068e918aeb441fd70a100564cb0f2461 2021-08-23 23:14:52 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e068e918aeb441fd70a100564cb0f2461 2021-08-23 23:14:53 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e068e918aeb441fd70a100564cb0f2461 2021-08-23 23:14:57 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068f918aeb441fd72d0100 2021-08-23 23:15:00 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068f918aeb441fd72d0100 2021-08-23 23:15:12 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -91, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068f918aeb441fd72d0100 2021-08-23 23:15:18 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e068f918aeb441fd72d0100 2021-08-23 23:15:22 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -86, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e0690918aeb441fd70a100564e90f2461 2021-08-23 23:15:32 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0691918aeb441fd72d0100 2021-08-23 23:15:39 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -90, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0691918aeb441fd72d0100 2021-08-23 23:15:44 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0691918aeb441fd72d0100 2021-08-23 23:15:51 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0691918aeb441fd72d0100 2021-08-23 23:15:54 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0693918aeb441fd72d0100 2021-08-23 23:16:00 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0693918aeb441fd72d0100 2021-08-23 23:16:03 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0693918aeb441fd72d0100 2021-08-23 23:16:12 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -86, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0693918aeb441fd72d0100 2021-08-23 23:16:18 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0693918aeb441fd72d0100 2021-08-23 23:16:23 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e0694918aeb441fd70a10056425102461 2021-08-23 23:16:27 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0695918aeb441fd72d0100 2021-08-23 23:16:30 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -91, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0695918aeb441fd72d0100 2021-08-23 23:16:33 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0695918aeb441fd72d0100 2021-08-23 23:16:36 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0695918aeb441fd72d0100 2021-08-23 23:16:36 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0695918aeb441fd72d0100 2021-08-23 23:16:39 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0695918aeb441fd72d0100 2021-08-23 23:16:52 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -86, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e0696918aeb441fd70a10056443102461 2021-08-23 23:16:54 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0697918aeb441fd72d0100 2021-08-23 23:17:00 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -86, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0697918aeb441fd72d0100 2021-08-23 23:17:00 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -90, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0697918aeb441fd72d0100 2021-08-23 23:17:09 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -86, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0697918aeb441fd72d0100

@Ernst79
Copy link
Collaborator

Ernst79 commented Aug 29, 2021

I will have a look later this week.

@skaken
Copy link
Author

skaken commented Aug 29, 2021

Thanks, Ernst! Let me know if you need additional input or testing.

@Ernst79 Ernst79 added the new sensor Request for a new sensor label Sep 1, 2021
@Ernst79
Copy link
Collaborator

Ernst79 commented Sep 1, 2021

I had a look, the long advertisements that start with 16 contain the battery info, the short ones that start with 11 contain no data.

I think there will be more advertisements, when you use the lock. Could you create another log while using the lock?

@skaken
Copy link
Author

skaken commented Sep 1, 2021

I was guessing that it was the other way around since the 11-messages keep popping up.
I made a new log(a bit shorter this time). I locked the door from the inside, opened the door from the inside and unlocked it from the outside with fingerprint:

2021-09-01 11:14:26 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -88, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0638918aeb441fd72d0100
2021-09-01 11:14:34 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -91, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0638918aeb441fd72d0100
2021-09-01 11:14:56 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 1a1695fe50449e063e918aeb441fd70b0009a40000000070442f61
2021-09-01 11:14:57 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -86, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e063f918aeb441fd70700050171442f61
2021-09-01 11:14:57 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -86, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e063f918aeb441fd70700050171442f61
2021-09-01 11:14:57 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -85, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e063f918aeb441fd70700050171442f61
2021-09-01 11:14:58 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -85, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e063f918aeb441fd70700050171442f61
2021-09-01 11:14:58 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 1a1695fe50449e0640918aeb441fd70b0009a10000000073442f61
2021-09-01 11:15:00 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0641918aeb441fd72d0100
2021-09-01 11:15:02 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -86, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0641918aeb441fd72d0100
2021-09-01 11:15:03 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0641918aeb441fd72d0100
2021-09-01 11:15:04 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -86, MAC: D7:1F:44:EB:8A:91, ADV: 111695fe30449e0641918aeb441fd72d0100
2021-09-01 11:15:05 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -87, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e0642918aeb441fd7060005ffffffff00
2021-09-01 11:15:05 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -86, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e0642918aeb441fd7060005ffffffff00
2021-09-01 11:15:05 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -86, MAC: D7:1F:44:EB:8A:91, ADV: 161695fe50449e0642918aeb441fd7060005ffffffff00
2021-09-01 11:15:07 INFO (Thread-3) [custom_components.ble_monitor.ble_parser.xiaomi] BLE ADV from UNKNOWN Xiaomi device: RSSI: -89, MAC: D7:1F:44:EB:8A:91, ADV: 1a1695fe50449e0643918aeb441fd70b000920020001807c442f61

@Ernst79
Copy link
Collaborator

Ernst79 commented Sep 1, 2021

Thanks, the messages that start with 16 have useful info.

result {'rssi': -87, 'mac': 'D71F44EB8A91', 'type': 'N100', 'packet': 66, 'firmware': 'Xiaomi (MiBeacon V4)', 'data': True, 'key_id': 'unknown operator', 'match_result': 'match successfully'}

Based on this info, I converted ffffffff to "unknown operator" and 00 to "match successfully"

image

I will look into the messages starting with 1a later. These contain "lock" data.

@skaken
Copy link
Author

skaken commented Sep 1, 2021

Good to hear that the information is useful. Looking forward to see what you make out of it all, and just let me know if you need me for some testing.

@Ernst79
Copy link
Collaborator

Ernst79 commented Sep 1, 2021

The "lock" measurement will require some work 😄 Luckily they documented it

image
image

@skaken
Copy link
Author

skaken commented Sep 1, 2021

We love some decent documentation! 😁 Have a look at the Xiaomi gateway 3 bluetooth.py if you haven’t already. I can see the N100 is supported there, but I’m not a programmer so I can’t make much of it…

@Ernst79
Copy link
Collaborator

Ernst79 commented Sep 1, 2021

The parser has been done (thank to the Xiaomi gateway 3 integration) 😄

result {'rssi': -87, 'mac': 'D71F44EB8A91', 'type': 'N100', 'packet': 67, 'firmware': 'Xiaomi (MiBeacon V4)', 'data': True, 'action': 'Unlock outside the door', 'method': 'biological', 'error': None, 'key id': 2, 'time': '2021-09-01T11:14:36'}

Next step, adding the Home Assistant sensors.

@Ernst79
Copy link
Collaborator

Ernst79 commented Sep 1, 2021

So, we have three sensors. I propose the following sensors

Battery --> sensor showing battery %
Fingerprint --> binary sensor device type None), which it True if successful, False if not with an attribute with the reason of failure
Lock --> binary sensor (device type lock) with all relevant attributes like action, method, error, key_id, time.

Do you agree?

@skaken
Copy link
Author

skaken commented Sep 1, 2021

Great! It sounds like that would cover most of our needs. 👍🏻

@skaken
Copy link
Author

skaken commented Sep 1, 2021

I’m guessing this will work on the N200 lock as well. And maybe the rest of the locks that are supported in the Xiaomi app. (BT locks anyway…)

@Ernst79
Copy link
Collaborator

Ernst79 commented Sep 1, 2021

Yes, I already added the N200 as well. I'll look at the others later.

@skaken
Copy link
Author

skaken commented Sep 1, 2021

You’re smoking fast, Ernst! Looking forward to the results 👍🏻

@Ernst79
Copy link
Collaborator

Ernst79 commented Sep 1, 2021

image
image

@skaken
Copy link
Author

skaken commented Sep 1, 2021

That’s just awesome, Ernst! I’ve been looking for a good solution that gives me advertisements from this (otherwise very nice) lock for quite som time now, but have been finding myself staring down a dark hole. And you just pull the rabbit straight out of the hat! Something tells me that you like 🍺 and I will surely buy you one 👍🏻

PS! What kind of plant do you have guarding your door…? 😁

@Ernst79
Copy link
Collaborator

Ernst79 commented Sep 2, 2021

Its a very special plant 😄 it can change from thermometer to a lock and than back to a switch, or whatever I tell it to be.

Anyway, please give 5.1.3-beta a try, it should be added.

@skaken
Copy link
Author

skaken commented Sep 2, 2021

A kind of a hybrid between a fig, cactus and a violet, then 😁
I have installed the beta-version and I’ve now got the fingerprint, lock and battery entities! 👍🏻 Next I have to figure out how to use these to get the different advertisements correct in HA, when my life allows it. Do you by any chance have some examples for this?
Oh, I’ll have a look at those translations when testing to. “The safe is removed” doesn’t work 😆

@Ernst79
Copy link
Collaborator

Ernst79 commented Sep 2, 2021

haha, google translation of Chinese is sometimes hilarious. I copied it form here, already did some corrections.

https://iot.mi.com/new/doc/embedded-development/ble/object-definition

right click will show the translate option in Chrome.

You can access the state and the attributes in an automation, like this

image

So, if "The safe is removed", you can tell Home Assistant what to do.

@skaken
Copy link
Author

skaken commented Sep 2, 2021

Cheers, Ernst! I’ll report back when I have done some testing.

(IF “safe removed” THEN “light fuse” AND “release dogs”)

@Ernst79
Copy link
Collaborator

Ernst79 commented Sep 4, 2021

final release in 5.1.3

@Ernst79 Ernst79 closed this as completed Sep 4, 2021
@laurentiumagureanu
Copy link

@skaken @Ernst79
Can any of you help me set this up?

Is the ENCRYPTION KEY required for it?
If so, how do I get it?

The lock is paired with the Aqara Home app on my phone
The MI Home app does not have an option to pair this lock ( I use the europe server )

I looked at https://custom-components.github.io/ble_monitor/faq#my-sensors-ble-advertisements-are-encrypted-how-can-i-get-the-key
But nothing on how to get the key for the N100

@Ernst79
Copy link
Collaborator

Ernst79 commented Nov 13, 2021

You don’t need an encryption key. However, there are two types of N100 locks, only the BLE version works. The other one has BLE and Zigbee, this version is not supported in BLE monitor, as BLE is only Usero make the initial pairing (I think). See this page for the difference. https://www.aqara.com/en/smart_door_lock_n100.html

I guess you have the zigbee version

@skaken
Copy link
Author

skaken commented Nov 13, 2021

Sorry, but life has got the better of me lately which consequently has left no room for fun. I did think that the encryption key was needed to decode the advertisements? But @Ernst79 is the expert on this so please listen to him regarding this. I have the Chinese/BLE only version and I’m getting advertisements from my N100(more consequentially from later versions 🤔). Looking forward to play some more with this setup, and brilliant work as usual, @Ernst79! 👍🏻

@Ernst79
Copy link
Collaborator

Ernst79 commented Nov 13, 2021

I dubbel checked it, you don’t need an encryption key for the N100. But you do need the Chinese, BLE only, Mi Home version.

@skaken
Copy link
Author

skaken commented Nov 13, 2021

That raises some questions in my head, but I trust your research, Ernst. I wonder where I’ve left my old Thinkpad running Kali… 😁

@Ernst79
Copy link
Collaborator

Ernst79 commented Nov 13, 2021

I can also make mistakes, so if you thing I'm wrong, just let us know. I can deal with that 😉

@laurentiumagureanu
Copy link

I have the zigbee version. Which is impossible to pair with a non-aqara gateway. Thanks for your help!

Great work, by the way!

@skaken
Copy link
Author

skaken commented Nov 13, 2021

@Ernst79 I really don’t trust people that never make mistakes 😉 But it could be of interest knowing what kind of security Aqara has built into their locks(not to worried myself since I build security in layers)

@laurentiumagureanu It seems like you’re a bit out of luck with regards to BLE. Have a look at the Xiaomi gateways as well. They support Aqara/zigbee and are quite easy to customise if you need to go down that route.

@Ernst79
Copy link
Collaborator

Ernst79 commented Nov 13, 2021

The security is an issue yes, if it isn't encrypted. The BLE advertisements BLE monitor is using are the ones that are send by the lock and only contain "information". As far as I know, it won't be possible to send data to the lock without some kind of connection/encryption. But still, I could imagine that it isn't very safe to send data about the state of your lock into the air without any encryption..... You can check yourself by looking into your BLE monitor configuration and see if you entered an encryption key in the past.

@skaken
Copy link
Author

skaken commented Nov 13, 2021

Definitely, if that is the state of implementation. I haven’t tested this myself, but why should “unlock” be protected if the “information” isn’t encrypted? That doesn’t really make sense in a simple BLE communication context. I am using the encryption key in my .yaml. I’ll try to remove this when I’m back to see if it makes any difference.

@skaken
Copy link
Author

skaken commented Nov 14, 2021

You’re right, @Ernst79! I did a quick test just now, and the BLE encryption key isn’t needed for receiving announcements from the N100. Running version 5.9.1, I just deleted the encryption key-line in my yaml file and I’m still receiving “door open” and “fingerprint used” in HA. This puzzles me a bit, since Aqara has built an otherwise tough and well designed lock. The question must be if the encryption key is used on the receiving end of the lock? (I’m thinking “unlock”, FW-update etc) I’m suddenly in the need of some BT sniffing capabilities 🤔

@andreyneto
Copy link

andreyneto commented Sep 12, 2023

Hi @Ernst79! I must be missing something here. All entities are showing as unknown, except Fingerprint, which has been On since the first time I opened the lock after configuration. Do you have any suggestions or any ideas of what I might be doing wrong? Thank you very much in advance.
Captura de Tela 2023-09-12 às 09 19 51
Captura de Tela 2023-09-12 às 09 20 17

@Ernst79
Copy link
Collaborator

Ernst79 commented Sep 12, 2023

Not sure, but please double check the encryption key. It can have changed.

@andreyneto
Copy link

andreyneto commented Sep 19, 2023

Well, I guess that's my problem. All the ways that are in the documentation did not return a field for the key. The only way to get a BLE_KEY was through XiaomiGateway3, and the value is FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new sensor Request for a new sensor
Projects
None yet
Development

No branches or pull requests

4 participants