al-one / hass-xiaomi-miot

Automatic integrate all Xiaomi devices to HomeAssistant via miot-spec, support Wi-Fi, BLE, ZigBee devices. 小米米家智能家居设备接入Hass集成
https://miot-spec.com
Apache License 2.0
4.7k stars 663 forks source link

Mi Air Purifier 4 Compact (zhimi.airp.cpa4) unavailable #1055

Open peca89 opened 1 year ago

peca89 commented 1 year ago

Device model / 设备型号

zhimi.airp.cpa4

Component version / 插件版本

0.7.7

HA core version / HA版本

2023.3.3

Integrated mode / 集成方式

Automatic (自动模式)

The problem / 问题详情

Fan entity unavailable. Device is accessible via Xiaomi Home Android app. Device is in the same subnet as HA. Also tried placing it in a different subnet and NATing HA to the router interface IP on that other subnet.

Entity attributes / 实体属性

[fan.zhimi_cpa4_21de_air_purifier] preset_modes: Auto, Sleep, Favorite friendly_name: Air Purifier 4C Air Purifier supported_features: 8

[persistent_notification.xiaomi_miot_devices_offline] message: Some devices cannot be connected in the LAN, please check their IP and make sure they are in the same subnet as the HA.

一些设备无法通过局域网连接,请检查它们的IP,并确保它们和HA在同一子网。

Known issues | 了解更多 title: Devices offline friendly_name: Devices offline

Home Assistant Logs / 系统日志

Air Purifier 4C(zhimi.airp.cpa4): Got MiioException while fetching the state: Unable to discover the device 192.168.2.206, mapping: {'air_purifier.on': {'siid': 2, 'piid': 1}, 'air_purifier.fault': {'siid': 2, 'piid': 2}, 'air_purifier.mode': {'siid': 2, 'piid': 4}, 'aqi.aqi_updata_heartbeat': {'siid': 11, 'piid': 4}, 'custom_service.moto_speed_rpm': {'siid': 9, 'piid': 1}, 'custom_service.country_code': {'siid': 9, 'piid': 10}, 'custom_service.favorite_level': {'siid': 9, 'piid': 11}, 'screen.brightness': {'siid': 13, 'piid': 2}, 'physical_controls_locked': {'siid': 8, 'piid': 1}, 'alarm': {'siid': 6, 'piid': 1}, 'filter.filter_life_level': {'siid': 4, 'piid': 1}, 'filter.filter_used_time': {'siid': 4, 'piid': 3}, 'filter.filter_left_time': {'siid': 4, 'piid': 4}, 'environment.pm2_5_density': {'siid': 3, 'piid': 4}}, max_properties: 7/14

al-one commented 1 year ago
peca89 commented 1 year ago
pyrodex commented 1 year ago

Same issue here with latest version of HA 2023.3.5 and newest compact unit.

iPoiizz commented 1 year ago

Same, when added the 4 compact to HA (2023.3.5), it disconnected to the network and try to reconnected, while remove from HA it works fine.

peca89 commented 1 year ago

Just found out that the connection is successful if you select Cloud during adding the integration instead of Automatic...

pyrodex commented 1 year ago

Just found out that the connection is successful if you select Cloud during adding the integration instead of Automatic...

Just did this and had the same experience. I thought the goal of this was to go local and not require cloud?

al-one commented 1 year ago

Try master branch.

peca89 commented 1 year ago

Adding via automatic option still does not work for me. Also, I don't see that newly added Reset filter life does anything.

al-one commented 1 year ago

Try add custom option chunk_properties: 1 for zhimi.airp.cpa4.

https://user-images.githubusercontent.com/4549099/211185592-79daa90d-c5cb-4c9e-829c-12a52fa3eaf0.mp4

peca89 commented 1 year ago

Adding via both Automatic and Local works fine with 'chunk_properties: 1'. Thanks.

Also works fine when adding that option to device_customizes.py

Reset filter life still does not reset Filter Used Time to 0 if that is what it is supposed to do

pyrodex commented 1 year ago

Try master branch.

I was able to pull MASTER down via HACS and then restarted. I removed the prior setup I had for my CPA4 and was able to add it in as Local without issues. Thanks!

al-one commented 1 year ago

Try master branch again.

marcoleder commented 1 year ago

Anyone who wants to control the cpa4 via the mushroom fan card check out what I did:

https://github.com/marcoleder/cpa4-mushroom/tree/main

Feel free to make PR and issues :smiley:

Best and greetings from Switzerland Marco

madmalkav commented 1 year ago

Just added the device, working great, only missing control on Home Assistant seems to be changing from Manual to Auto to Sleep mode?

KSchmeeds commented 10 months ago

I recently purchased the zhimi.airp.cpa4 and I've noticed using local or automatic the device entities keep going unavailable and then coming back.

If I use cloud option, I'm unable to change the modes from auto,sleep,favorite. The option to change it is there, but it doesn't take affect and keeps flipping back.