- 积分
- 810
- 金钱
- 580
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
高级会员
- 积分
- 810
- 金钱
- 580
- HASS币
- 0
|
本帖最后由 misLia 于 2024-4-18 13:54 编辑
更新了gateway3到4.0.3,结果一个易来的人体存在传感器用不了了。人体存在状态变成Switch了,光照数据,距离都没了。这个易来的人体存在传感器和领普的那个一模一样。3.3.6以前的gateway3,我把devices.py里领普的人体存在的那段代码找出来,改成易来的名字写在xiaomi_gateway3.py,放在config文件下,就能正常工作了。更新4.0.3后,用同样的方法却不行了。有大大神能指点指点吗?目前多模网关2固件号还是1.0.3。难道是固件的问题?该死的小米多模网关,固件升级还失败。小米客服让我恢复出厂设置,这恢复出厂设置,我HASS里那些自动化,岂不是得全部重写?这TMD得多大个坑啊?
from custom_components.xiaomi_gateway3.core.converters.devices import *
DEVICES = [{
17160: ["yeelight", "occupancy-sensor", "0000A0BF", "yeelink.sensor_occupy.a"],
"spec": [
# main sensors
BoolConv("occupancy", "binary_sensor", mi="2.p.1"),
MathConv("distance", "sensor", mi="3.p.3"),
BaseConv("illuminance", "sensor", mi="2.p.5"),
MapConv("action", "sensor", mi="3.e.1.p.1", map={0: "stop", 1: "approach", 2: "away"}),
# other sensors
MathConv("occupancy_duration", "sensor", mi="2.p.3", entity={"category": "diagnostic", "enabled": False, "units": UNIT_MINUTES}),
MathConv("not_occupancy_duration", "sensor", mi="2.p.4", entity={"category": "diagnostic", "enabled": False, "units": UNIT_MINUTES}),
# occupancy settings
MathConv("occupancy_timeout", "number", mi="2.p.2", min=3, max=10000, entity={"category": "config", "enabled": False, "units": UNIT_SECONDS}),
InductionRange("induction_range", "text", mi="3.p.2", entity=ENTITY_CONFIG),
MathConv("approach_distance", "number", mi="3.p.4", min=1, max=5, entity={"category": "config", "units": UNIT_METERS}),
BaseConv("led", "switch", mi="4.p.1"), # bool, config
],
}] + DEVICES
昨晚折腾了一晚上,都不行。我尝试着把下面这段代码直接写在devices.py中领普人体存在设备信息的代码前。这会产品信息,人在状态对了,但是光照和action依旧没有。
17160: ["yeelight", "occupancy-sensor", "0000A0BF, yeelink.sensor_occupy.a"],
另外再问下这个代码里类似mi=“2.p.1”是什么意思?
|
|