AlexxIT / XiaomiGateway3

Home Assistant custom component for control Xiaomi Multimode Gateway (aka Gateway 3), Xiaomi Multimode Gateway 2, Aqara Hub E1 on default firmwares over LAN

Home Page:https://github.com/AlexxIT/Blog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XiaoMi Smart Door Lock M20 Pro Configuration Not Effect

yjhroot opened this issue · comments

commented
{
    # XiaoMi Lock M20 Pro
    # https://home.miot-spec.com/spec/loock.lock.r2
    12183: ["Xiaomi", "Door Lock M20 Pro", "loock.lock.r2"],
    "spec": [
        MiBeacon,  # backward support old firmwares
        # sensor action
        EventConv("action", "sensor", mi="2.e.1020"),
        MapConv("position", mi="2.p.1", map={
            1: "indoor", 2: "outdoor", 3: "not tell indoor or outdoor"
        }),
        Converter("method_id", mi="2.p.2"),
        MapConv("method", mi="2.p.2", map={
            1: "mobile", 2: "fingerprint", 3: "password", 4: "nfc", 5: "face", 8: "key",
            9: "one_time_password", 10: "periodic_password", 12: "coerce", 15: "manual",
            16: "auto"
        }),
        Converter("action_id", mi="2.p.3"),
        MapConv("action", 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"
        }),
        Converter("key_id", mi="2.p.4"),
        Converter("timestamp", mi="2.p.5"),  # lock timestamp

        # doorbell
        EventConv("action", mi="5.e.1006", value="doorbell"),
        Converter("timestamp", mi="5.p.1"),  # doorbell timestamp

        # doorbell sensor
        Converter("doorbell", "sensor", mi="5.p.1"),
        # contact binary_sensor
        MapConv("contact", "binary_sensor", mi="2.p.3", map={1: False, 2: True}),
        # lock binary_sensor
        MapConv("lock", "binary_sensor", mi="2.p.3", map={1: False, 2: True}),
        # battery sensor
        Converter("battery", "sensor", mi="4.p.1003"),
    ],
    "ttl": "25h"
}

I tried to add the Xiaomi Smart Door Lock M20 Pro following the standards outlined in https://home.miot-spec.com/spec/loock.lock.r2. Why does it show that this entity is disabled? I enabled the entity, but it still shows as unavailable.

Furthermore, I added 11971 and 5741, they took effect, and I hope you can incorporate them into the new version.Thank you.

{
    # https://home.miot-spec.com/spec/shhf.light.slcwb3
    11971: ["shhf", "Mesh Light", "shhf.light.slcwb3"],
    "spec": [
        Converter("light", "light", mi="2.p.1"),
        BrightnessConv("brightness", mi="2.p.2", parent="light", max=100),
        ColorTempKelvin("color_temp", mi="2.p.3", parent="light", mink=3000, maxk=6400),
        MapConv("mode", "select", mi="2.p.4", map={
            0: "None", 1: "Day", 2: "Night", 3: "Warmth", 4: "Reading", 5: "Tv",
            6: "Computer"
        }),
        BoolConv("flex_switch", "switch", mi="2.p.5"),
        MapConv("power_on_state", "select", mi="2.p.6", map={0: "Default", 1: "On", 2: "Off"}),
        BoolConv("wake_up_mode", "switch", mi="2.p.7"),
        BoolConv("sleep_aid_mode", "switch", mi="2.p.8"),
        MapConv("flow", "select", mi="2.p.9", map={0: "Auto", 1: "Immediately"}),
    ]
},{
    # https://home.miot-spec.com/spec/yeelink.light.spot2
    5741: ["yeelink", "Mesh Light", "yeelink.light.spot2"],
    "spec": [
        Converter("light", "light", mi="2.p.1"),
        BrightnessConv("brightness", mi="2.p.2", parent="light", max=100),
        ColorTempKelvin("color_temp", mi="2.p.3", parent="light", mink=2700, maxk=6500),
        MapConv("power_on_state", "select", mi="2.p.4", map={0: "Off", 1: "On", 2: "Default"}),
        MapConv("mode", "select", mi="2.p.5", map={
            0: "Dummy", 1: "Lighting", 2: "Night Light", 3: "Tv", 4: "Reading", 5: "Hospitality",
            6: "Warmth"
        }),
        BoolConv("flex_switch", "switch", mi="2.p.6"),
        MathConv("light_off_gradient_time", "number", mi="2.p.7",multiply=0.5, min=0, max=10),
        MathConv("light_on_gradient_time", "number", mi="2.p.8",multiply=0.5, min=0, max=10),
    ]
}
commented

Snipaste_2024-03-23_13-45-57

Thanks! I don't know about lock. You should collect debug logs

commented

Thanks! I don't know about lock. You should collect debug logs

Thank you very much for your response. It seems like the M20 Pro has been successfully added. There are many logs, making it difficult for me to find useful information about this lock. This lock has many attributes, which I will share after completing the subsequent additions. If I encounter any difficulties later on, I will provide detailed logs.