『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 3210|回复: 12

[求助] gateway3插件对不支持的设备是如何处理的?

[复制链接]

1

主题

15

帖子

101

积分

注册会员

Rank: 2

积分
101
金钱
86
HASS币
0
发表于 2023-10-18 17:15:34 来自手机 | 显示全部楼层 |阅读模式
家里的鹿客门锁是蓝牙和wifi双模的,接入米家然后用xiaomi miot auto接入ha,始终获取不到门锁状态,看后台日志似乎门锁一直没更新状态。

wifi不行准备尝试蓝牙接入,买了多模网关2,用gateway3插件接入,其他的蓝牙灯具都表现正常,但门锁这个设备始终没有被发现,开门关门反复操作了都不行,想问下各位大神gateway3对不支持的设备是直接不显示,还是像下图一样显示设备但功能是灰色?
我在gateway3的devices.py里确实没找到我家这个型号,通过自定义converter是否可以支持呢?
Screenshot_2023-10-18-17-06-35-439_alook.browser.png
回复

使用道具 举报

2

主题

188

帖子

1638

积分

金牌会员

Rank: 6Rank: 6

积分
1638
金钱
1450
HASS币
0
发表于 2023-10-18 22:12:54 | 显示全部楼层
不支持的肯定是完全不显示。不过日志里能看得到。

门锁类不太了解,其他的都是这样。

你如果能翻得到门锁的日志,一般就能写converter来支持
回复

使用道具 举报

1

主题

15

帖子

101

积分

注册会员

Rank: 2

积分
101
金钱
86
HASS币
0
 楼主| 发表于 2023-10-19 19:52:08 | 显示全部楼层
Necroneco 发表于 2023-10-18 22:12
不支持的肯定是完全不显示。不过日志里能看得到。

门锁类不太了解,其他的都是这样。

微信截图_20231019194850.png 我找了devices.py里一个鹿客门锁的代码照抄了一下 微信截图_20231019194713.png

微信截图_20231019194700.png
在gateway3的日志里是识别出这个设备了,但是集成下面还是没有显示设备,有点蒙了



回复

使用道具 举报

2

主题

188

帖子

1638

积分

金牌会员

Rank: 6Rank: 6

积分
1638
金钱
1450
HASS币
0
发表于 2023-10-19 21:26:39 | 显示全部楼层
日志里还有别的 9878 吗
回复

使用道具 举报

1

主题

15

帖子

101

积分

注册会员

Rank: 2

积分
101
金钱
86
HASS币
0
 楼主| 发表于 2023-10-20 13:16:19 | 显示全部楼层
Necroneco 发表于 2023-10-19 21:26
日志里还有别的 9878 吗

搜了下9878,有不少日志,是我的converter写的不对吗?
日志如下:
新建 文本文档.zip (4.75 KB, 下载次数: 9)
回复

使用道具 举报

2

主题

188

帖子

1638

积分

金牌会员

Rank: 6Rank: 6

积分
1638
金钱
1450
HASS币
0
发表于 2023-10-20 13:45:14 | 显示全部楼层
hsy557165 发表于 2023-10-20 13:16
搜了下9878,有不少日志,是我的converter写的不对吗?
日志如下:

再搜搜 1055898906
回复

使用道具 举报

1

主题

15

帖子

101

积分

注册会员

Rank: 2

积分
101
金钱
86
HASS币
0
 楼主| 发表于 2023-10-20 13:59:20 | 显示全部楼层

新建 文本文档.zip (848 Bytes, 下载次数: 4)

搜这个也有一些日志,但是不多
回复

使用道具 举报

2

主题

188

帖子

1638

积分

金牌会员

Rank: 6Rank: 6

积分
1638
金钱
1450
HASS币
0
发表于 2023-10-20 15:59:21 | 显示全部楼层
    9878: ["Loock", "Lockin Smart Lock V5 Pro", "loock.lock.fvl202"],
    "spec": [
        MapConv("door", "sensor", mi="3.p.1021", map={
            16: "locked", 20: "locked", 24: "locked", 28: "locked",
            32: "unlocked", 36: "unlocked", 40: "unlocked", 44: "unlocked",
            48: "timeout", 52: "timeout", 56: "timeout", 60: "timeout",
            64: "ajar", 68: "ajar", 72: "ajar", 76: "ajar",
        }),

        EventConv("action", "sensor", mi="2.e.1020"),
        Converter("key_id", mi="2.p.4"),
        Converter("method_id", mi="2.p.2"),
        MapConv("method", 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"
        }),
        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"
        }),
        MapConv("position", mi="2.p.1", map={
            1: "indoor", 2: "outdoor", 3: "not tell indoor or outdoor"
        }),

        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

        Converter("battery", "sensor", mi="4.p.1003"),
    ],
    "ttl": "25h"



试试这版,抄的 6017: ["Xiaomi", "Face Recognition Smart Door Lock", "XMZNMS09LM"], 和 10249: ["Xiaomi", "Door Lock E10", "XMZNMS01OD"],
配合 spec https://home.miot-spec.com/spec/loock.lock.fvl202 对照

关于门铃的部分,你需要再测测再看看日志,每个锁它发的消息的id都不一样
回复

使用道具 举报

1

主题

15

帖子

101

积分

注册会员

Rank: 2

积分
101
金钱
86
HASS币
0
 楼主| 发表于 2023-10-20 22:25:44 | 显示全部楼层
本帖最后由 hsy557165 于 2023-10-20 22:29 编辑
Necroneco 发表于 2023-10-20 15:59
9878: ["Loock", "Lockin Smart Lock V5 Pro", "loock.lock.fvl202"],
    "spec": [
        MapConv( ...

大佬,我把你写的这一版替换进去了,并且我也对照 https://home.miot-spec.com/spec/loock.lock.fvl202 检查了一下,应该没错

过了一段时间,包含9878的日志如下:

2023-10-20 21:05:41.529 DEBUG (MainThread) [custom_components.xiaomi_gateway3.core.gateway] 192.168.1.110 [BASE] 97102f447cd4 (9878) setup ble loock.lock.fvl202: door, action, battery
2023-10-20 21:30:41.032 DEBUG (MainThread) [custom_components.xiaomi_gateway3.core.gateway] 192.168.1.110 [MQTT] miio/report b'{"id":980915704,"method":"_sync.ble_spec_query_prod","params":{"pdid":9878,"offset":0}}'
2023-10-20 21:30:41.083 DEBUG (MainThread) [custom_components.xiaomi_gateway3.core.gateway] 192.168.1.110 [MQTT] miio/report_ack b'{"id":980915704,"result":{"operation":"ble_spec_query_prod","pdid":9878,"ttl":1800,"size":7,"pidrule":[{"siid":3,"piid":1021,"intvl":600,"delta":1,"type":"uint8"},{"siid":4,"piid":1003,"intvl":600,"delta":1,"type":"uint8"},{"siid":4,"piid":1034,"intvl":600,"delta":1,"type":"uint8"}],"eidrule":[{"siid":2,"eiid":1007,"intvl":0,"delta":0,"piids":[{"piid":5,"type":"uint32","name":"Current Time"},{"piid":6,"type":"uint8","name":"Abnormal Condition"}]},{"siid":2,"eiid":1020,"intvl":0,"delta":0,"piids":[{"piid":1,"type":"uint8","name":"Operation Position"},{"piid":2,"type":"uint8","name":"Operation Method"},{"piid":3,"type":"uint8","name":"Lock Action"},{"piid":4,"type":"uint16","name":"Operation ID"},{"piid":5,"type":"uint32","name":"Current Time"}]}]}}'
2023-10-20 21:30:41.543 DEBUG (MainThread) [custom_components.xiaomi_gateway3.core.gateway] 192.168.1.110 [MQTT] miio/report b'{"id":1884911705,"method":"_sync.ble_spec_query_prod","params":{"pdid":9878,"offset":5}}'
2023-10-20 21:30:41.650 DEBUG (MainThread) [custom_components.xiaomi_gateway3.core.gateway] 192.168.1.110 [MQTT] miio/report_ack b'{"id":1884911705,"result":{"operation":"ble_spec_query_prod","pdid":9878,"ttl":1800,"size":7,"pidrule":[],"eidrule":[{"siid":5,"eiid":1006,"intvl":0,"delta":0,"piids":[{"piid":1,"type":"uint32","name":"Current Time"}]},{"siid":12,"eiid":1023,"intvl":0,"delta":0,"piids":[{"piid":2,"type":"uint32","name":"Customized Argument-2"},{"piid":4,"type":"uint16","name":"Customized Argument 4"},{"piid":5,"type":"uint8","name":"Customized Argument 5"},{"piid":6,"type":"uint16","name":"Customized Argument 6"}]}]}}'
2023-10-20 21:31:10.562 DEBUG (MainThread) [custom_components.xiaomi_gateway3.core.gateway] 192.168.1.110 [MQTT] miio/report b'{"id":323015709,"method":"_sync.ble_query_dev_list","params":{"devices":[{"mac":"97:10:2F:44:7C:D4","pdid":9878}]}}'
2023-10-20 21:31:10.642 DEBUG (MainThread) [custom_components.xiaomi_gateway3.core.gateway] 192.168.1.110 [MQTT] miio/report_ack b'{"id":323015709,"result":{"authed_devs":[{"mac":"97:10:2F:44:7C:D4","ttl":1800,"pdid":9878,"did":"1055898906","beaconkey":"4c54785c6e30244241af46478d936907","token":"48e94253cd3125e1a7c18cc1","spec_supported":0}],"denied_devs":[]}}'
2023-10-20 21:59:57.630 DEBUG (MainThread) [custom_components.xiaomi_gateway3.core.gateway] 192.168.1.110 [MQTT] miio/report b'{"id":1455307902,"method":"_sync.ble_spec_query_prod","params":{"pdid":9878,"offset":0}}'
2023-10-20 21:59:57.700 DEBUG (MainThread) [custom_components.xiaomi_gateway3.core.gateway] 192.168.1.110 [MQTT] miio/report_ack b'{"id":1455307902,"result":{"operation":"ble_spec_query_prod","pdid":9878,"ttl":1800,"size":7,"pidrule":[{"siid":3,"piid":1021,"intvl":600,"delta":1,"type":"uint8"},{"siid":4,"piid":1003,"intvl":600,"delta":1,"type":"uint8"},{"siid":4,"piid":1034,"intvl":600,"delta":1,"type":"uint8"}],"eidrule":[{"siid":2,"eiid":1007,"intvl":0,"delta":0,"piids":[{"piid":5,"type":"uint32","name":"Current Time"},{"piid":6,"type":"uint8","name":"Abnormal Condition"}]},{"siid":2,"eiid":1020,"intvl":0,"delta":0,"piids":[{"piid":1,"type":"uint8","name":"Operation Position"},{"piid":2,"type":"uint8","name":"Operation Method"},{"piid":3,"type":"uint8","name":"Lock Action"},{"piid":4,"type":"uint16","name":"Operation ID"},{"piid":5,"type":"uint32","name":"Current Time"}]}]}}'
2023-10-20 21:59:58.649 DEBUG (MainThread) [custom_components.xiaomi_gateway3.core.gateway] 192.168.1.110 [MQTT] miio/report b'{"id":67380904,"method":"_sync.ble_spec_query_prod","params":{"pdid":9878,"offset":5}}'
2023-10-20 21:59:58.707 DEBUG (MainThread) [custom_components.xiaomi_gateway3.core.gateway] 192.168.1.110 [MQTT] miio/report_ack b'{"id":67380904,"result":{"operation":"ble_spec_query_prod","pdid":9878,"ttl":1800,"size":7,"pidrule":[],"eidrule":[{"siid":5,"eiid":1006,"intvl":0,"delta":0,"piids":[{"piid":1,"type":"uint32","name":"Current Time"}]},{"siid":12,"eiid":1023,"intvl":0,"delta":0,"piids":[{"piid":2,"type":"uint32","name":"Customized Argument-2"},{"piid":4,"type":"uint16","name":"Customized Argument 4"},{"piid":5,"type":"uint8","name":"Customized Argument 5"},{"piid":6,"type":"uint16","name":"Customized Argument 6"}]}]}}'
2023-10-20 22:00:35.869 DEBUG (MainThread) [custom_components.xiaomi_gateway3.core.gateway] 192.168.1.110 [MQTT] miio/report b'{"id":2049649909,"method":"_sync.ble_query_dev_list","params":{"devices":[{"mac":"97:10:2F:44:7C:D4","pdid":9878},{"mac":"C3:5F:C7:3A:9A:FE","pdid":2329}]}}'
2023-10-20 22:00:35.960 DEBUG (MainThread) [custom_components.xiaomi_gateway3.core.gateway] 192.168.1.110 [MQTT] miio/report_ack b'{"id":2049649909,"result":{"authed_devs":[{"mac":"97:10:2F:44:7C:D4","ttl":1800,"pdid":9878,"did":"1055898906","beaconkey":"4c54785c6e30244241af46478d936907","token":"48e94253cd3125e1a7c18cc1","spec_supported":0}],"denied_devs":[{"mac":"C3:5F:C7:3A:9A:FE","pdid":2329,"code":-7}]}}'


无标题.png

明明日志里有门锁反馈的信息,但设备里面的实体始终都是未知

回复

使用道具 举报

2

主题

188

帖子

1638

积分

金牌会员

Rank: 6Rank: 6

积分
1638
金钱
1450
HASS币
0
发表于 2023-10-21 09:46:49 | 显示全部楼层
hsy557165 发表于 2023-10-20 22:25
大佬,我把你写的这一版替换进去了,并且我也对照 https://home.miot-spec.com/spec/loock.lock.fvl202 检 ...

这边都是 ble_spec_query_prod

不用找9878,搜一下 1055898906 的日志
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-12-26 09:42 , Processed in 0.359480 second(s), 34 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表