本帖最后由 flyibeat 于 2023-1-18 11:31 编辑
小米温湿度计3似乎更新了mibeacon中湿度的上报eid,直接加xiaomi_gateway3.py只能看到温度信息。
from custom_components.xiaomi_gateway3.core.converters.devices import *
DEVICES = [{
10290: ["Xiaomi", "TH Sensor 3", "MJWSDO5MMC"],
"spec": [
MiBeacon, BLETemperature, BLEHumidity,
Converter("battery", "sensor", enabled=None),
],
}] + DEVICES
开启debug找数据,找到一条
2023-01-10 16:18:02 [D] 192.168.31.129 [MQTT] miio/report b'{"id":1796897368,"method":"_async.ble_event","params":{"dev":{"did":"blt.3.1ck7gegese000","mac":"A4:C1:38:72:02:64","pdid":10290},"evt":[{"eid":19458,"edata":"0e"}],"frmCnt":89,"gwts":1673338681}}'
pdid:10290对应上了,eid变成了19458,edata是0e,拿到数据就好办了
然后找到/custom_components/xiaomi_gateway3/core/converters/mibeacon.py增加一条
elif eid == 0x4C02: # 19458
# xiaomi 3
payload['humidity'] = data[0]
重启ha,搞定。暂时还在测试中,没有推给作者
|