- 积分
- 12169
- 金钱
- 9155
- 威望
- 0
- 贡献
- 0
- HASS币
- 460
超级版主
智能家居&单板滑雪痴迷爱好者
- 积分
- 12169
- 金钱
- 9155
- HASS币
- 460
 
|
楼主 |
发表于 2021-6-5 16:31:21
|
显示全部楼层
本帖最后由 XCray 于 2021-6-5 21:27 编辑
我把esphome的 xiaomi_lywsd03mmc 和 xiaomi_ble 代码改了改,实现了锁属性、锁事件、门事件和电量报告的接入。看来这是一个比较省事儿的办法,问题就是必须根据具体型号具体调整,另外就是要直接修改esphome代码,方式上不够正规。
这是一条锁属性和一条锁事件(开门记录)对应的ESPHome日志:
[20:36:39][D][xiaomi_ble:205]: decrypt_xiaomi_payload(): authenticated decryption passed.
[20:36:39][D][xiaomi_ble:207]: Plaintext : 0E.10.01.01 (4), Packet : 81
[20:36:39][D][xiaomi_ble:070]: value_length:1;payload_length:4
[20:36:39][D][xiaomi_ble:219]: Got Xiaomi ZELKOVA (xx:xx:xx:xx:xx:xx):
[20:36:39][D][xiaomi_ble:225]: LockAttr:1
[20:36:39][D][sensor:099]: 'LockAttr': Sending state 1.00000 with 0 decimals of accuracy
[20:36:41][D][xiaomi_ble:205]: decrypt_xiaomi_payload(): authenticated decryption passed.
[20:36:41][D][xiaomi_ble:207]: Plaintext : 05.00.0A.00.02.01.00.01.00.D5.6F.BB.60 (13), Packet : 82
[20:36:41][D][xiaomi_ble:070]: value_length:10;payload_length:13
[20:36:41][D][xiaomi_ble:219]: Got Xiaomi ZELKOVA (xx:xx:x:xx:xx:xx):
[20:36:41][D][xiaomi_ble:222]: OpMethod:2
[20:36:41][D][sensor:099]: 'OpMethod': Sending state 2.00000 with 0 decimals of accuracy
|
|