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

Hope to add lockin V5max and lockin v5pro model door locks #1368

Open
gx19970920 opened this issue May 23, 2024 · 12 comments
Open

Hope to add lockin V5max and lockin v5pro model door locks #1368

gx19970920 opened this issue May 23, 2024 · 12 comments
Labels
enhancement New feature or request

Comments

@gx19970920
Copy link

lockin V5max: loock.lock.fcl201 https://home.miot-spec.com/s/loock.lock.fcl201
lockin V5pro: loock.lock.fvl202 https://home.miot-spec.com/s/loock.lock.fvl202

Both of these door locks are connected to the Xiaomi multi-mode gateway through BLE

@AlexxIT AlexxIT added the enhancement New feature or request label May 23, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented May 23, 2024

You have to write converters to these devices yourself

@gx19970920
Copy link
Author

You have to write converters to these devices yourself

May I ask if any door lock that can be added to a multimode gateway can be connected to gateway3 through custom conversion files?

@AlexxIT
Copy link
Owner

AlexxIT commented May 23, 2024

Everything you can see in MiHome (as Gateway child device) can be supported by this integration as well.

@gx19970920
Copy link
Author

Everything you can see in MiHome (as Gateway child device) can be supported by this integration as well.

Okay, thank you very much. I will try to add this door lock device myself

@AlexxIT
Copy link
Owner

AlexxIT commented May 23, 2024

Don't forget to send in the successful result. So that other users can use it as well

@gx19970920
Copy link
Author

Don't forget to send in the successful result. So that other users can use it as well

Okay, but I was just about to buy this door lock haha. After the goods are installed, I will give it a try. If successful, I will Pull requests

@AlexxIT
Copy link
Owner

AlexxIT commented May 23, 2024

Remember that BLE is an informing protocol. You will not be able to control the locks via the gateway. Only receive statuses.

@gx19970920
Copy link
Author

Yes, I know gateway3 can only obtain the status of the door lock, but that's enough!thanks!

@cwt0490
Copy link

cwt0490 commented May 26, 2024

this is what i tried

from custom_components.xiaomi_gateway3.core.devices import *

DEVICES = [{
    9877: ["Loock", "Loock Smart Lock V5 Max", "XFCL201"],
    "spec": [
        BaseConv("action", "sensor", mi="2.e.1020"),
        BaseConv("key_id", mi="2.p.4"),
        MapConv("method", "sensor", mi="2.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.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.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.p.1", map={
            1: "indoor", 2: "outdoor", 3: "not tell indoor or outdoor"
        }),
        BaseConv("lock_timestamp", "sensor", mi="2.p.5"),  # lock timestamp
        
        # doorbell
        ConstConv("action", mi="5.e.1006", value="doorbell"),
        BaseConv("doorbell_timestamp", "sensor", mi="5.p.1"),  # doorbell timestamp

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

and this is what i got:
image

I don't know what is wrong.
It seemed only door state and battery worked. Action sensor can tell doorbell but not others.

@gx19970920
Copy link
Author

this is what i tried

from custom_components.xiaomi_gateway3.core.devices import *

DEVICES = [{
    9877: ["Loock", "Loock Smart Lock V5 Max", "XFCL201"],
    "spec": [
        BaseConv("action", "sensor", mi="2.e.1020"),
        BaseConv("key_id", mi="2.p.4"),
        MapConv("method", "sensor", mi="2.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.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.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.p.1", map={
            1: "indoor", 2: "outdoor", 3: "not tell indoor or outdoor"
        }),
        BaseConv("lock_timestamp", "sensor", mi="2.p.5"),  # lock timestamp
        
        # doorbell
        ConstConv("action", mi="5.e.1006", value="doorbell"),
        BaseConv("doorbell_timestamp", "sensor", mi="5.p.1"),  # doorbell timestamp

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

and this is what i got: image

I don't know what is wrong. It seemed only door state and battery worked. Action sensor can tell doorbell but not others.

Thanks, this is very helpful to me

@cwt0490
Copy link

cwt0490 commented May 27, 2024

Hey! I got it right! Here is the code and I have tested it. Just create xiaomi_gateway3.py under config folder.

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

This is the result:
IMG_7002

Hope this helps!

@gx19970920
Copy link
Author

Hey! I got it right! Here is the code and I have tested it. Just create xiaomi_gateway3.py under config folder.

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

This is the result: IMG_7002

Hope this helps!

Thank you very much for your reply. I saw your latest post on Hassbian forum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants