Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
peca89 opened this issue Mar 13, 2023 · 15 comments
Open

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

peca89 opened this issue Mar 13, 2023 · 15 comments

Comments

@peca89
Copy link
Contributor

peca89 commented Mar 13, 2023

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在同一子网。

  • Air Purifier 4C(zhimi.airp.cpa4): 192.168.2.206

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
Copy link
Owner

al-one commented Mar 16, 2023

  • ping 192.168.2.206 from HA host
  • miiocli -d device --ip 192.168.1.66 --token **** info
  • Try unplugging the device.

@peca89
Copy link
Contributor Author

peca89 commented Mar 16, 2023

  • Device replies to pings
  • Redacted output below:
C:\Users\User>miiocli -d device --ip 192.168.2.206 --token 861********cb6 info
INFO:miio.cli:Debug mode active
DEBUG:miio.click_common:Unknown model, trying autodetection. None None
DEBUG:miio.miioprotocol:Got a response: Container:
    data = Container:
        data = b'' (total 0)
        value = b'' (total 0)
        offset1 = 32
        offset2 = 32
        length = 0
    header = Container:
        data = b'!1\x00 \x00\x00\x00\x00!\x1d\xc4\xcc\x00\x01\xc8\x06' (total 16)
        value = Container:
            length = 32
            unknown = 0
            device_id = unhexlify('211dc4cc')
            ts = 1970-01-02 08:25:42
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
DEBUG:miio.miioprotocol:Discovered 211dc4cc with ts: 1970-01-02 08:25:42, token: b'ffffffffffffffffffffffffffffffff'
DEBUG:miio.miioprotocol:192.168.2.206:54321 >>: {'id': 1, 'method': 'miIO.info', 'params': []}
DEBUG:miio.miioprotocol:192.168.2.206:54321 (ts: 1970-01-02 08:25:43, id: 1) << {'id': 1, 'result': {'life': 116743, 'uid': 1731596329, 'model': 'zhimi.airp.cpa4', 'token': '861*******cb6', 'ipflag': 1, 'fw_ver': '2.2.1', 'mcu_fw_ver': '0014', 'miio_ver': '0.0.9', 'hw_ver': 'esp32', 'mmfree': 72212, 'mac': '68:AB*****:DE', 'wifi_fw_ver': '', 'ap': {'ssid': 'M******3', 'bssid': 'EE:9F******F4', 'rssi': -41, 'primary': 1}, 'netif': {'localIp': '192.168.2.206', 'mask': '255.255.255.0', 'gw': '192.168.2.1'}}, 'exe_time': 50}
DEBUG:miio.device:Detected model zhimi.airp.cpa4
Model: zhimi.airp.cpa4
Hardware version: esp32
Firmware version: 2.2.1
  • Tried to unplug device several times, no change

@pyrodex
Copy link

pyrodex commented Mar 18, 2023

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

@iPoiizz
Copy link

iPoiizz commented Mar 20, 2023

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
Copy link
Contributor Author

peca89 commented Mar 23, 2023

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

@pyrodex
Copy link

pyrodex commented Mar 23, 2023

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
Copy link
Owner

al-one commented Mar 24, 2023

Try master branch.

@peca89
Copy link
Contributor Author

peca89 commented Mar 24, 2023

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
Copy link
Owner

al-one commented Mar 24, 2023

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

xiaomi-mito-customize.mp4

@peca89
Copy link
Contributor Author

peca89 commented Mar 24, 2023

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
Copy link

pyrodex commented Mar 24, 2023

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 added a commit that referenced this issue Mar 24, 2023
@al-one
Copy link
Owner

al-one commented Apr 28, 2023

Try master branch again.

@marcoleder
Copy link

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 😃

Best and greetings from Switzerland
Marco

@madmalkav
Copy link

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

@KSchmeeds
Copy link

KSchmeeds commented Jan 21, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants