From 8a14a42753a890f87c10e86f3f6d7b5878624a73 Mon Sep 17 00:00:00 2001 From: niceboy Date: Mon, 26 Jul 2021 12:25:28 +0000 Subject: [PATCH] Add support for Aqara Lock N100 zigbee edition --- .../aqara_gateway/core/lock_data.py | 42 ++++++++++++++++--- custom_components/aqara_gateway/core/utils.py | 34 +++++++++++++++ 2 files changed, 71 insertions(+), 5 deletions(-) diff --git a/custom_components/aqara_gateway/core/lock_data.py b/custom_components/aqara_gateway/core/lock_data.py index 3e10e42..0f1e197 100755 --- a/custom_components/aqara_gateway/core/lock_data.py +++ b/custom_components/aqara_gateway/core/lock_data.py @@ -12,7 +12,9 @@ "lumi.lock.acn03": SUPPORT_ALARM | SUPPORT_DOORBELL, "aqara.lock.wbzac1": ( WITH_LI_BATTERY | SUPPORT_ALARM | - SUPPORT_DOORBELL | SUPPORT_WIFI | SUPPORT_CAMERA) + SUPPORT_DOORBELL | SUPPORT_WIFI | SUPPORT_CAMERA), + "aqara.lock.bzacn4": ( + SUPPORT_ALARM | SUPPORT_DOORBELL) } LOCK_NOTIFICATIOIN = { @@ -25,13 +27,28 @@ "0": "Door is open", "1": "Door is closed", "2": "Door is not close", - "3": "Doorbell is ringing"}, + "3": "Doorbell is ringing", + "4": "Lock is damaged", + "5": "Door is conceal", + "6": "Other 1", + "7": "Other 2"}, + "door": { + "default": "door state changed", + "0": "Door is open", + "1": "Open Door", + "2": "Door is not close"}, "unlock from inside": {"default": "Unlock from Inside"}, "someone detected": {"default": "Someone is lingering at the door"}, "li battery notify": {"default": "Li Battery notify", "0": "Li Battery is abnormal", "1": "Li Battery is normal"}, + "battery notify": + {"default": "Battery notify", + "0": "Battery is die", + "1": "Battery level is low", + "2": "Battery level is middle", + "3": "Battery level is full"}, "camera connected": {"default": "Camera is connected"}, "open in away mode": { "default": @@ -47,7 +64,22 @@ "0": "Away-from-home mode is removed", "1": "Away-from-home mode is enabled"}, "nfc added": {"default": "Added NFC card or Tag"}, - "verification failed": {"default": "door lock verifications failed"}, - "user_1": {"default": "Unlocked with Keypad by user 1"}, - "user_2": {"default": "Unlocked with Keypad by user 2"}, + "nfc removed": {"default": "Removed NFC card or Tag"}, + "verification failed": { + "default": "door lock verifications failed", + "3235774464": "Frequent door opening failures due to incorrect passwords", + "3235774465": "Frequent door opening failures due to incorrect fingerprints", + "3235774469": "Frequent door openings with abnormal keys", + "3235774470": "Foreign objects in the keyhole", + "3235774471": "Keys not removed", + "3235774472": "Frequent door opening failures with incorrect NFC", + "3235774473": "Door unlocked after timeout", + "3235774474": "Multiple verification failures (advanced protection)", + "3235778564": "Automatic lock body abnormal"}, + "user added": { + "default": "Add User"}, + "user removed": { + "default": "Remove User"}, + "all user removed": { + "default": "Remove All User"}, } diff --git a/custom_components/aqara_gateway/core/utils.py b/custom_components/aqara_gateway/core/utils.py index 228c558..5d17501 100755 --- a/custom_components/aqara_gateway/core/utils.py +++ b/custom_components/aqara_gateway/core/utils.py @@ -460,6 +460,38 @@ ['14.83.85', None, 'bluetooth', None], [None, None, 'lock_event', 'sensor'], ] +}, { + 'aqara.lock.bzacn3': ["Aqara", "Door Lock N100", "ZNMS16LM"], + 'aqara.lock.bzacn4': ["Aqara", "Door Lock N100", "ZNMS16LM"], + 'params': [ + ['8.0.2148', None, 'timestamp', None], + ['13.17.85', 'lock_state', 'lock', 'sensor'], + ['13.18.85', None, 'key_type', None], + ['13.32.85', None, 'verification failed', None], + ['13.33.85', None, 'latch_state', None], + ['13.41.85', None, 'unlock from inside', None], + ['13.42.85', None, 'unlock by fringprint', None], + ['13.43.85', None, 'unlock by password', None], + ['13.44.85', None, 'unlock by nfc', None], + ['13.45.85', None, 'unlock by homekit', None], + ['13.49.85', None, 'open in away mode', None], + ['13.54.85', None, 'away mode', None], + [None, None, 'key_id', 'sensor'], + ['13.55.85', 'voltage', 'voltage', None], + ['13.56.85', 'battery', 'battery', 'sensor'], + ['13.57.85', None, 'battery notify', None], + ['13.60.85', None, 'verification failed', None], + ['13.62.85', None, 'timestamp', None], + ['13.63.85', None, 'user added', None], + ['13.64.85', None, 'user removed', None], + ['13.65.85', None, 'all user removed', None], + ['13.66.85', None, 'nfc added', None], + ['13.67.85', None, 'nfc removed', None], + ['13.68.85', None, 'homekit reset', None], + ['13.88.85', None, 'door', None], + ['14.83.85', None, 'bluetooth', None], + [None, None, 'lock_event', 'sensor'], + ] }, { # https://github.com/AlexxIT/XiaomiGateway3/issues/101 'lumi.airrtc.tcpecn02': ["Aqara", "Thermostat S2", "KTWKQ03ES"], @@ -935,6 +967,7 @@ '8.0.2021': 'report', '8.0.2022': 'fw_ver', '8.0.2023': 'hw_ver', + '8.0.2026': 'wifi_rssi', '8.0.2030': 'poweroff_memory', '8.0.2031': 'charge_protect', '8.0.2032': 'en_night_tip_light', @@ -954,6 +987,7 @@ '8.0.2084': 'added_device', '8.1.2087': '8.1.2087', '8.1.2088': '8.1.2088', + '8.0.2090': '8.0.2090', '8.0.2089': 'dfu', '8.0.2091': 'dfu_status', '8.0.2101': 'nl_invert', # ctrl_86plug