美文网首页
鹿客V5Max通过xiaomigateway3接入homeass

鹿客V5Max通过xiaomigateway3接入homeass

作者: cwt0490 | 来源:发表于2024-05-26 19:08 被阅读0次

前提

你得有个xiaomjgateway3支持的小米多模网关

步骤

在config目录下新建xiaomi_gateway3.py 文件
添加以下内容

from custom_components.xiaomi_gateway3.core.devices import *

DEVICES = [{
    9877: ["Loock", "Loock Smart Lock V5 Max", "FCL201"],
    "spec": [
        BaseConv("action", "sensor"),
        BaseConv("key_id", mi="2.e.1020.p.4"),
        MapConv("method", "sensor", mi="2.e.1020.p.2", map={
            1: "mobile", 2: "fingerprint", 3: "password", 4: "nfc", 5: "face", 6: "Finger Vein", 
            7: "Palm Print", 8: "key", 9: "one_time_password", 10: "periodic_password", 
            11: "Homekit", 12: "coerce", 13: "Two Step Verification", 14: "Turntable", 
            15: "manual", 16: "auto"
        }),
        MapConv("lock_action", "sensor", mi="2.e.1020.p.3", map={
            1: "lock", 2: "unlock", 3: "lock_outside", 4: "lock_inside",
            5: "unlock_inside", 6: "enable_child_lock", 7: "disable_child_lock",
            8: "enable_away", 9: "disable_away"
        }),
        MapConv("door_state", "sensor", mi="3.p.1021", map={
            16: 'Locked',
            20: 'Locked',
            24: 'Locked',
            28: 'Locked',
            32: 'Unlocked',
            36: 'Unlocked',
            40: 'Unlocked',
            44: 'Unlocked',
            48: 'Leaving The Door Open Timed Out',
            52: 'Leaving The Door Open Timed Out',
            56: 'Leaving The Door Open Timed Out',
            60: 'Leaving The Door Open Timed Out',
            64: 'Door Was Ajar',
            68: 'Door Was Ajar',
            72: 'Door Was Ajar',
            76: 'Door Was Ajar'
        }),
        MapConv("abnormal_type", "sensor", mi="2.e.1020.p.6", map={
            1: "Frequent Unlocking Failed By Multiple Methods", 
            2: "Frequent Unlocking Failed By Password", 
            3: "Frequent Unlocking Failed By Fingerprint", 
            4: "Frequent Unlocking Failed By NFC", 
            5: "Frequent Unlocking Failed By Face", 
            6: "Frequent Unlocking Failed By Palmprint", 
            7: "Frequent Unlocking Failed By Finger Vein", 
            8: "Frequent Unlocking Failed By Key", 
            9: "Door Lock Was Damaged", 
            10: "Locked Unsuccessfully", 
            11: "Unlock From Inside After Leaving Home", 
            12: "Door Lock Was Reset", 
            13: "Foreign Object Detected In The Keyhole", 
            14: "Key Was Not Removed", 
            15: "Door Lock Fingerprint Sensor Error", 
            16: "Door Lock Mechanical Failure", 
            17: "Door Lock Main Part Failure", 
            18: "The Lithium Battery Temperature Is Too High", 
            19: "Large Batteries Are Low", 
            20: "Small Batteries Are Low", 
            21: "Large And Small Batteries Are Low", 
            22: "Large And Small Deplete", 
            23: "Leaving The Door Open Timed Out", 
            24: "Door Was Ajar", 
            25: "Door Was Opened Forcefully", 
            26: "Small Batteries Are Nearly Depleted", 
            27: "Small Batteries Are Nearly Depleted And Large Batteries Low", 
            28: "Large Batteries Are Nearly Depleted", 
            29: "Large Batteries Are Nearly Depleted And Small Batteries Low", 
            30: "Large Batteries Are Removed", 
            31: "Large Batteries Are Inserted", 
            32: "Small Batteries Are Removed", 
            33: "Small Batteries Are Inserted", 
            34: "Battery Low The Cat Eye Function And The Door Screen Are Suspended", 
            35: "Ultrasonic Sensitivity Decreased"
        }),
        MapConv("position", "sensor", mi="2.e.1020.p.1", map={
            1: "indoor", 2: "outdoor", 3: "not tell indoor or outdoor"
        }),
        BaseConv("lock_timestamp", "sensor", mi="2.e.1020.p.5"),  # lock timestamp
        
        # doorbell
        ConstConv("action", mi="5.e.1006", value="doorbell"),
        BaseConv("doorbell_timestamp", "sensor", mi="5.e.1006.p.1"),  # doorbell timestamp

        # battery sensor
        BaseConv("battery", "sensor", mi="4.p.1003"),
        BaseConv("changing", "sensor", mi="4.p.1034"),
    ],
}] + DEVICES

重启ha就行了

效果图

相关文章

  • Android 通过Java sdk的方式接入OpenCv

    Android 通过Java sdk的方式接入opencvAndroid 通过cmake的方式接入opencv 简...

  • Android 通过cmake的方式接入opencv

    Android 通过Java sdk的方式接入opencvAndroid 通过cmake的方式接入opencv 简...

  • 骨干网

    无线侧:手机或者集团客户通过基站接入到无线接入网,在接入网侧可以通过RTN或者IPRAN或者PTN解决方案来解决,...

  • 舌华录

    王元泽数岁时,客有以一麞一鹿同笼以献。客问元泽:“何者是麞?何者是鹿?”元泽实未识,良久对曰:“麞边者是鹿,鹿边者...

  • 简书播客#81 为承认不爱者鼓掌

    首播:2015年5月25日 主题:《 为承认不爱者鼓掌》 作者:鹿满川 主播:钟鑫 通过iTunes订阅简书播客 ...

  • 简书播客#55 以为自己撞见了爱情

    首播:2015年4月15日 主题:《以为自己撞见了爱情》 作者:鹿满川 主播:钟鑫 通过iTunes订阅简书播客 ...

  • how networks work forth note

    思维导图 通过接入网进入互联网内部 问答 看点 ADSL接入网和光纤接入网((FTTH)Fiber to the ...

  • 【舌华录译评】慧语第一•001

    【原文】 王元泽数岁时,客有一獐一鹿同笼以献。客问元泽:“何者是獐?何者是鹿?”元泽实未识,良久对曰:“獐边者是鹿...

  • 直播技术原理讲解

    现如今App中接入直播功能越来越普遍,接入直播可通过各大厂的云直播平台接入SDK来实现,但是,需要接入直播功能的朋...

  • iOS Share SDK 复制粘贴轻松接入

    本篇文章主要指导新手快速接入share sdk。教你使用复制粘贴神功实现app接入分享功能 一、接入准备:通过Co...

网友评论

      本文标题:鹿客V5Max通过xiaomigateway3接入homeass

      本文链接:https://www.haomeiwen.com/subject/qwaqqjtx.html