ha0y / xiaomi_miot_raw

All-in-one & Easy-to-use. Integrate all your Xiaomi Smart Home - with a single integration and NO YAML files - into Home Assistant.
Apache License 2.0
2.19k stars 232 forks source link

XIAOMI MIJIA NEW WIDETECH WDH318 不能加HomeKit #137

Closed lichunghk closed 3 years ago

lichunghk commented 3 years ago

Logger: homeassistant.components.homekit Source: components/homekit/type_humidifiers.py:114 Integration: HomeKit (documentation, issues) First occurred: 23:11:24 (1 occurrences) Last logged: 23:11:24

Failed to create a HomeKit accessory for humidifier.wdh318efw1_cloud_269549 Traceback (most recent call last): File "/opt/lib/python3.9/site-packages/homeassistant/components/homekit/init.py", line 551, in add_bridge_accessory acc = get_accessory(self.hass, self.driver, state, aid, conf) File "/opt/lib/python3.9/site-packages/homeassistant/components/homekit/accessories.py", line 199, in get_accessory return TYPES[a_type](hass, driver, name, state.entity_id, aid, config) File "/opt/lib/python3.9/site-packages/homeassistant/components/homekit/type_humidifiers.py", line 114, in init max_humidity = round(max_humidity) TypeError: type NoneType doesn't define round method

ha0y commented 3 years ago

此设备不支持设置湿度,不支持设置湿度的加湿器不能接入HomeKit。但是可以将其作为风扇接入,需要在添加设备时,修改设备类型。

ha0y commented 3 years ago

添加设备时,设备类型取消勾选humidifier,勾选fan。

mapping填写: {"fan": {"switch_status": {"siid": 2, "piid": 1}, "mode": {"siid": 2, "piid": 2}, "speed": {"siid": 2, "piid": 3}}, "environment": {"relative_humidity": {"siid": 3, "piid": 1}, "temperature": {"siid": 3, "piid": 2}}, "indicator_light": {"switch_status": {"siid": 5, "piid": 1}}, "physical_controls_locked": {"physical_controls_locked": {"siid": 6, "piid": 1}}}

配置参数填写: {"fan": {"switch_status": {"power_on": true, "power_off": false}, "speed": {"Low": 1, "Midium": 2, "High": 3}, "mode": {"Auto": 0, "On": 1, "Dry Clothes": 2}, "main": true}, "environment": {"relative_humidity": {"access": 5, "format": "uint8", "unit": "percentage", "value_range": [0, 100, 1]}, "temperature": {"access": 5, "format": "float", "unit": "celsius", "value_range": [-30, 100, 1]}}, "indicator_light": {"switch_status": {"power_on": true, "power_off": false}}, "physical_controls_locked": {"enabled": false}}

lichunghk commented 3 years ago

我用小米帐号自动添加设备, 请问如何修改成fan?

ha0y commented 3 years ago

集成页面右下角 添加集成-Xiaomi MIoT-选择你的设备

lichunghk commented 3 years ago

可以添加了 但在iphone home里面好像开了就关不了

而且出现了这些错误

Log Details (ERROR) Logger: custom_components.xiaomi_miot_raw Source: custom_components/xiaomi_miot_raw/init.py:468 Integration: Xiaomi MIoT (documentation, issues) First occurred: 23:35:27 (8 occurrences) Last logged: 23:37:23

Control NWT Internet Dehumidifier 18L by cloud failed: [{'did': '360269549', 'siid': 2, 'piid': 3, 'code': -704053100}] Control NWT Internet Dehumidifier 18L by cloud failed: [{'did': '360269549', 'siid': 2, 'piid': 2, 'code': -704053100}]

ha0y commented 3 years ago

错误代码说明:设备在当前状态下无法执行此操作。在关机状态下试图调节风速,会出现此错误。 在家庭里长按风扇卡片,选择“作为单独板块分开显示”,查看能否正常开关。

ha0y commented 3 years ago

问题是否已解决?如已解决可关闭 Issue。