XiaomiGateway3 icon indicating copy to clipboard operation
XiaomiGateway3 copied to clipboard

ble XMZNMST02YD unavailable

Open hn315 opened this issue 3 years ago • 8 comments

In Xiaomi Gateway 3 version 1.6.5, my Xiaomi door lock (ble XMZNMST02YD) is normal. Now after upgrading to the new version 2.0.4, the door lock will display unavailable after an interval of time. If the door lock is opened and closed at this time, it will display available again

hn315 avatar Feb 17 '22 06:02 hn315

I have the same problem with MiFlora (...) 2022-02-17 12:03:49 DEBUG base 192.168.1.8 [BLEF] c47c8d6c56d0 (152) recv {'temperature': 21.4} 2022-02-17 12:03:49 DEBUG base 192.168.1.8 [BLEF] c47c8d6af89c (152) recv {'illuminance': 79} 2022-02-17 12:03:51 DEBUG base 192.168.1.8 [BLEF] c47c8d6c599a (152) recv {'illuminance': 248} 2022-02-17 12:04:05 DEBUG base 192.168.1.8 [BASE] Run zigbee parent scan process 2022-02-17 12:04:13 DEBUG mini_mqtt Can't disconnect from gateway 2022-02-17 12:04:13 DEBUG mini_mqtt Can't close connection 2022-02-17 12:04:13 DEBUG base 192.168.1.8 [BASE] MQTT disconnected

SmTo81 avatar Feb 17 '22 15:02 SmTo81

@hn315 You need get logs and check how often does your lock send messages without any action. I think the component makes the lock unavailable after 3 hours of silence

AlexxIT avatar Feb 17 '22 17:02 AlexxIT

@hn315 You need get logs and check how often does your lock send messages without any action. I think the component makes the lock unavailable after 3 hours of silence

1、 Logger: homeassistant.helpers.frame Source: helpers/frame.py:74 First occurred: 2022年2月20日 20:25:12 (12 occurrences) Last logged: 2022年2月20日 20:25:12

Detected code that uses str for device registry entry_type. This is deprecated and will stop working in Home Assistant 2022.3, it should be updated to use DeviceEntryType instead. Please report this issue.

2、Xiaomi Gateway 3 Integration has no error logs,I don't know if the above one is related

3、The time of door lock unavailability is irregular, sometimes up to 7 hours. If the door is not opened and closed, the unavailability may last longer

截图-2022年2月22日 12时42分49秒

thanks

hn315 avatar Feb 22 '22 01:02 hn315

截图-2022年2月22日 12时44分9秒 截图-2022年2月22日 12时45分10秒

hn315 avatar Feb 22 '22 04:02 hn315

You need to enable debug logs or stats sensors

AlexxIT avatar Feb 22 '22 08:02 AlexxIT

same problem

morlz avatar Feb 28 '22 05:02 morlz

What logs should be sent?

morlz avatar Feb 28 '22 05:02 morlz

https://github.com/AlexxIT/XiaomiGateway3#debug-mode

AlexxIT avatar Mar 11 '22 14:03 AlexxIT

I have the same problem and try to get some logs related to the door lock.

2022-10-08 22:33:27,142 SysInfo: {'installation_type': 'Home Assistant Container', 'version': '2022.10.1', 'dev': False, 'hassio': False, 'virtualenv': False, 'python_version': '3.10.5', 'docker': True, 'arch': 'aarch64', 'timezone': 'Asia/Shanghai', 'os_name': 'Linux', 'os_version': '5.15.0-1013-raspi', 'user': 'root'}
2022-10-08 22:33:28,748 10.202.1.87 [BASE] Start main loop
2022-10-08 22:33:30,715 10.202.1.87 [BASE] Prepare gateway gw3 with fw 1.5.0_0102
2022-10-08 22:33:31,223 10.202.1.87 [BASE] 54ef44369e6f (lumi.gateway.mgl03) setup gateway ZNDMWG03LM ZNDMWG02LM: alarm, command, data, cloud_link, led, gateway
2022-10-08 22:33:31,253 10.202.1.87 [MIOT] 54ef44369e6f (lumi.gateway.mgl03) read {'mi_spec': [{'siid': 3, 'piid': 1}, {'siid': 3, 'piid': 22}]}
2022-10-08 22:33:31,629 10.202.1.87 [BASE] e5765c4fc4e5 (2444) setup ble XMZNMST02YD: action, battery, lock, opening
2022-10-08 22:59:39,023 10.202.1.87 [MQTT] log/ble b'{"did":"1022885750","eid":11,"edata":"20010001805c904163","pdid":2444,"seq":33}'
2022-10-08 22:59:39,025 10.202.1.87 [BLEF] e5765c4fc4e5 (2444) recv {'action': 'lock', 'action_id': 0, 'method_id': 2, 'message': 'Unlock outside the door', 'method': 'biological', 'key_id': 1, 'error': None, 'timestamp': '2022-10-08T22:59:40'}
2022-10-08 22:59:39,446 10.202.1.87 [MQTT] log/miio b'\x1b[0;32m2022:10:08:22:59:39.004 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"_async.ble_event","params":{"dev":{"did":"1022885750","mac":"E5:76:5C:4F:C4:E5","pdid":2444},"evt":[{"eid":11,"edata":"20010001805c904163"}],"frmCnt":33,"gwts":1665241179},"id":1490} length:193 bytes\x1b[0m'
2022-10-08 22:59:44,805 10.202.1.87 [MQTT] log/ble b'{"did":"1022885750","eid":7,"edata":"0162904163","pdid":2444,"seq":34}'
2022-10-08 22:59:44,808 10.202.1.87 [BLEF] e5765c4fc4e5 (2444) recv {'action': 'door', 'action_id': 1, 'message': 'Door is closed'}
2022-10-08 22:59:45,055 10.202.1.87 [MQTT] log/miio b'\x1b[0;32m2022:10:08:22:59:45.614 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"_async.ble_event","params":{"dev":{"did":"1022885750","mac":"E5:76:5C:4F:C4:E5","pdid":2444},"evt":[{"eid":7,"edata":"0162904163"}],"frmCnt":34,"gwts":1665241185},"id":1492} length:184 bytes\x1b[0m'
2022-10-08 23:00:14,804 10.202.1.87 [MQTT] log/ble b'{"did":"1022885750","eid":4111,"edata":"01","pdid":2444,"seq":35}'
2022-10-08 23:00:14,806 10.202.1.87 [BLEF] e5765c4fc4e5 (2444) recv {'opening': False}
2022-10-08 23:00:15,145 10.202.1.87 [MQTT] log/miio b'\x1b[0;32m2022:10:08:23:00:15.704 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"_async.ble_event","params":{"dev":{"did":"1022885750","mac":"E5:76:5C:4F:C4:E5","pdid":2444},"evt":[{"eid":4111,"edata":"01"}],"frmCnt":35,"gwts":1665241215},"id":1508} length:179 bytes\x1b[0m'
2022-10-08 23:01:14,752 10.202.1.87 [MQTT] log/ble b'{"did":"1022885750","eid":4106,"edata":"3a","pdid":2444,"seq":36}'
2022-10-08 23:01:14,754 10.202.1.87 [BLEF] e5765c4fc4e5 (2444) recv {'battery': 58}
2022-10-08 23:01:14,815 10.202.1.87 [MQTT] log/miio b'\x1b[0;32m2022:10:08:23:01:15.374 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"_async.ble_event","params":{"dev":{"did":"1022885750","mac":"E5:76:5C:4F:C4:E5","pdid":2444},"evt":[{"eid":4106,"edata":"3a"}],"frmCnt":36,"gwts":1665241275},"id":1523} length:179 bytes\x1b[0m'
2022-10-08 23:02:14,780 10.202.1.87 [MQTT] log/ble b'{"did":"1022885750","eid":4110,"edata":"00","pdid":2444,"seq":37}'
2022-10-08 23:02:14,782 10.202.1.87 [BLEF] e5765c4fc4e5 (2444) recv {'lock': True}
2022-10-08 23:02:14,995 10.202.1.87 [MQTT] log/miio b'\x1b[0;32m2022:10:08:23:02:15.554 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"_async.ble_event","params":{"dev":{"did":"1022885750","mac":"E5:76:5C:4F:C4:E5","pdid":2444},"evt":[{"eid":4110,"edata":"00"}],"frmCnt":37,"gwts":1665241335},"id":1556} length:179 bytes\x1b[0m'


2022-10-09 02:02:43,272 10.202.1.87 [BASE] e5765c4fc4e5 (2444) set device offline
2022-10-09 04:36:21,385 10.202.1.87 [MQTT] log/ble b'{"did":"1022885750","eid":6,"edata":"0000ff200001","pdid":2444,"seq":38}'


2022-10-09 04:36:21,388 10.202.1.87 [BLEF] e5765c4fc4e5 (2444) recv
2022-10-09 04:36:21,749 10.202.1.87 [MQTT] log/miio b'\x1b[0;32m2022:10:09:04:36:20.114 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"_async.ble_event","params":{"dev":{"did":"1022885750","mac":"E5:76:5C:4F:C4:E5","pdid":2444},"evt":[{"eid":6,"edata":"0000ff200001"}],"frmCnt":38,"gwts":1665261380},"id":6537} length:186 bytes\x1b[0m'
2022-10-09 04:36:22,373 10.202.1.87 [MQTT] log/ble b'{"did":"1022885750","eid":6,"edata":"0000ff200100","pdid":2444,"seq":39}'
2022-10-09 04:36:22,374 10.202.1.87 [BLEF] e5765c4fc4e5 (2444) recv
2022-10-09 04:36:22,769 10.202.1.87 [MQTT] log/miio b'\x1b[0;32m2022:10:09:04:36:21.134 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"_async.ble_event","params":{"dev":{"did":"1022885750","mac":"E5:76:5C:4F:C4:E5","pdid":2444},"evt":[{"eid":6,"edata":"0000ff200100"}],"frmCnt":39,"gwts":1665261381},"id":6538} length:186 bytes\x1b[0m'
2022-10-09 04:36:24,366 10.202.1.87 [MQTT] log/ble b'{"did":"1022885750","eid":6,"edata":"0100ff200001","pdid":2444,"seq":40}'
2022-10-09 04:36:24,367 10.202.1.87 [BLEF] e5765c4fc4e5 (2444) recv
2022-10-09 04:36:24,809 10.202.1.87 [MQTT] log/miio b'\x1b[0;32m2022:10:09:04:36:24.174 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"_async.ble_event","params":{"dev":{"did":"1022885750","mac":"E5:76:5C:4F:C4:E5","pdid":2444},"evt":[{"eid":6,"edata":"0100ff200001"}],"frmCnt":40,"gwts":1665261383},"id":6539} length:186 bytes\x1b[0m'
2022-10-09 04:36:25,330 10.202.1.87 [MQTT] log/ble b'{"did":"1022885750","eid":6,"edata":"0100ff200100","pdid":2444,"seq":41}'
2022-10-09 04:36:25,331 10.202.1.87 [BLEF] e5765c4fc4e5 (2444) recv
2022-10-09 04:36:25,829 10.202.1.87 [MQTT] log/miio b'\x1b[0;32m2022:10:09:04:36:25.194 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"_async.ble_event","params":{"dev":{"did":"1022885750","mac":"E5:76:5C:4F:C4:E5","pdid":2444},"evt":[{"eid":6,"edata":"0100ff200100"}],"frmCnt":41,"gwts":1665261384},"id":6541} length:186 bytes\x1b[0m'
2022-10-09 05:27:03,447 10.202.1.87 [MQTT] log/ble b'{"did":"1022885750","eid":4111,"edata":"01","pdid":2444,"seq":1}'
2022-10-09 05:27:03,449 10.202.1.87 [BLEF] e5765c4fc4e5 (2444) recv {'opening': False}
2022-10-09 05:27:03,803 10.202.1.87 [MQTT] log/miio b'\x1b[0;32m2022:10:09:05:27:02.144 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"_async.ble_event","params":{"dev":{"did":"1022885750","mac":"E5:76:5C:4F:C4:E5","pdid":2444},"evt":[{"eid":4111,"edata":"01"}],"frmCnt":1,"gwts":1665264422},"id":7277} length:178 bytes\x1b[0m'

jhchenchong avatar Oct 09 '22 12:10 jhchenchong

You can check master version. I have updated "offline time" for you lock up to 6 hours.

AlexxIT avatar Oct 09 '22 15:10 AlexxIT

Thanks for your reply. I have switched to the master version, and it will take some time to know whether the problem has been solved. Thanks!

jhchenchong avatar Oct 10 '22 01:10 jhchenchong

You can check master version. I have updated "offline time" for you lock up to 6 hours.

From switching to the master version to now, everything is fine. Thanks!

jhchenchong avatar Oct 11 '22 01:10 jhchenchong

You can check master version. I have updated "offline time" for you lock up to 6 hours.

From switching to the master version to now, everything is fine. Thanks!

兄弟,怎么切换到主版本?我现在插件[v2.1.2]最新版本,还是有出现不可用状态。

hn315 avatar Nov 25 '22 07:11 hn315

You can check master version. I have updated "offline time" for you lock up to 6 hours.

From switching to the master version to now, everything is fine. Thanks!

兄弟,怎么切换到主版本?我现在插件[v2.1.2]最新版本,还是有出现不可用状态。

你在你的插件中找到xiaomi_gateway3->core->converters->devices.py 然后搜索XMZNMST02YD 将ttl改成1d试试呢 到目前为止,家里的这个锁相关的自动化一直很正常。

jhchenchong avatar Nov 25 '22 07:11 jhchenchong

You can check master version. I have updated "offline time" for you lock up to 6 hours.

From switching to the master version to now, everything is fine. Thanks!

兄弟,怎么切换到主版本?我现在插件[v2.1.2]最新版本,还是有出现不可用状态。

你在你的插件中找到xiaomi_gateway3->core->converters->devices.py 然后搜索XMZNMST02YD 将ttl改成1d试试呢 到目前为止,家里的这个锁相关的自动化一直很正常。

谢谢兄弟,代码中找到这个参数了。 # https://github.com/AlexxIT/XiaomiGateway3/issues/657 2444: ["Xiaomi", "Door Lock", "XMZNMST02YD"], "spec": [ MiBeacon, Converter("action", "sensor"), Converter("battery", "sensor"), Converter("lock", "binary_sensor"), Converter("opening", "binary_sensor"), ], "ttl": "6h" 这个6小时改成1天,是什么意思 ?没怎么懂。我的出现不可用,也不影响自动化,只要一动门锁马上又可用。另外我接入了nodered 能识别开门模式,密码,指纹,NFC ,通过开门模式可以判断是谁用什么方式开的门。谢谢兄弟,中文好。

hn315 avatar Nov 26 '22 03:11 hn315

You can check master version. I have updated "offline time" for you lock up to 6 hours.

From switching to the master version to now, everything is fine. Thanks!

兄弟,怎么切换到主版本?我现在插件[v2.1.2]最新版本,还是有出现不可用状态。

你在你的插件中找到xiaomi_gateway3->core->converters->devices.py 然后搜索XMZNMST02YD 将ttl改成1d试试呢 到目前为止,家里的这个锁相关的自动化一直很正常。

谢谢兄弟,代码中找到这个参数了。 # https://github.com/AlexxIT/XiaomiGateway3/issues/657 2444: ["Xiaomi", "Door Lock", "XMZNMST02YD"], "spec": [ MiBeacon, Converter("action", "sensor"), Converter("battery", "sensor"), Converter("lock", "binary_sensor"), Converter("opening", "binary_sensor"), ], "ttl": "6h" 这个6小时改成1天,是什么意思 ?没怎么懂。我的出现不可用,也不影响自动化,只要一动门锁马上又可用。另外我接入了nodered 能识别开门模式,密码,指纹,NFC ,通过开门模式可以判断是谁用什么方式开的门。谢谢兄弟,中文好。

出现这个不可用实际上是xiaomi_gateway3如果在超过设定的 ttl 没有获取到设备上报的数据,就会把这个设备置为不可用,小米这个门锁如果一段时间没有任何操作,就不会再上报数据了,其实这个显示不可用也没什么影响,你把ttl参数设置长一点,比如说1天,xiaomi_gateway3就会在这个设备超过1天还没有上报数据就置为不可用。一般来说,每天总会开下门什么的吧,这样它就不会经常显示不可用了。

jhchenchong avatar Nov 26 '22 03:11 jhchenchong

Please reopen the issue if it is still relevant

AlexxIT avatar Apr 09 '23 05:04 AlexxIT