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

The xiaomi_miio fan platform does not work with Xiaomi Air Purifier 3 #36920

Closed
ehn opened this issue Jun 18, 2020 · 10 comments · Fixed by #37422
Closed

The xiaomi_miio fan platform does not work with Xiaomi Air Purifier 3 #36920

ehn opened this issue Jun 18, 2020 · 10 comments · Fixed by #37422

Comments

@ehn
Copy link

ehn commented Jun 18, 2020

The problem

I have three air purifiers from Xiaomi: one Air Purifier 2 (mini) (zhimi.airpurifier.m1) and two Air Purifier 3 (2019) (zhimi.airpurifier.ma4). All are connected to my home Wi-Fi and accessible in the Mi Home mobile app through the mainland China cloud.

I'm trying to bring them into Home Assistant using the xiaomi_miio fan platform. I have extracted tokens for all three devices from the iOS app following this guide:

https://www.home-assistant.io/integrations/vacuum.xiaomi_miio/#retrieving-the-access-token

The Air Purifier 2 (mini) (zhimi.airpurifier.m1) works, but the Air Purifier 3 (2019) (zhimi.airpurifier.ma4) don't.

From my config.yaml:

  - platform: xiaomi_miio
    host: 192.168.2.200 # Living room
    token: a743...
    model: zhimi.airpurifier.ma4

I have tried setting the model to zhimi.airpurifier.mb3 as well as removing the line entirely. Neither helps.

Attached a debug-lecel log filtered by "miio".

Environment

  • Home Assistant Core release with the issue: 0.111.4
  • Last working Home Assistant Core release (if known):
  • Operating environment (Home Assistant/Supervised/Docker/venv): Home Assistant
  • Integration causing this issue: Home Assistant
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/fan.xiaomi_miio/

Problem-relevant configuration.yaml

  - platform: xiaomi_miio
    host: 192.168.2.200 # Living room
    token: a743...
    model: zhimi.airpurifier.ma4

Traceback/Error logs

2020-06-19 01:40:24 INFO (MainThread) [homeassistant.setup] Setup of domain fan took 0.3 seconds.
2020-06-19 01:40:24 INFO (MainThread) [homeassistant.setup] Setup of domain xiaomi_miio took 0.1 seconds.
2020-06-19 01:40:25 INFO (MainThread) [homeassistant.components.fan] Setting up fan.xiaomi_miio
2020-06-19 01:40:25 INFO (MainThread) [homeassistant.components.xiaomi_miio.fan] Initializing with host 192.168.2.200 (token a743c...)
2020-06-19 01:40:25 DEBUG (SyncWorker_7) [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\x07\x8a\x05y\x00\x15\xfa\x00' (total 16)
        value = Container: 
            length = 32
            unknown = 0
            device_id = b'\x07\x8a\x05y' (total 4)
            ts = 1970-01-17 16:04:16
        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)
2020-06-19 01:40:25 DEBUG (SyncWorker_7) [miio.miioprotocol] Discovered 078a0579 with ts: 1970-01-17 16:04:16, token: b'ffffffffffffffffffffffffffffffff'
2020-06-19 01:40:25 DEBUG (MainThread) [homeassistant.components.xiaomi_miio.config_flow] Not yet supported Xiaomi Miio device 'zhimi-airpurifier-m1_miio54420516._miio._udp.local.' discovered with host 192.168.2.9
2020-06-19 01:40:25 DEBUG (SyncWorker_7) [miio.miioprotocol] 192.168.2.200:54321 >>: {'id': 1, 'method': 'get_properties', 'params': [{'did': 'power', 'siid': 2, 'piid': 2}, {'did': 'fan_level', 'siid': 2, 'piid': 4}, {'did': 'mode', 'siid': 2, 'piid': 5}, {'did': 'humidity', 'siid': 3, 'piid': 7}, {'did': 'temperature', 'siid': 3, 'piid': 8}, {'did': 'aqi', 'siid': 3, 'piid': 6}, {'did': 'filter_life_remaining', 'siid': 4, 'piid': 3}, {'did': 'filter_hours_used', 'siid': 4, 'piid': 5}, {'did': 'buzzer', 'siid': 5, 'piid': 1}, {'did': 'buzzer_volume', 'siid': 5, 'piid': 2}, {'did': 'led_brightness', 'siid': 6, 'piid': 1}, {'did': 'led', 'siid': 6, 'piid': 6}, {'did': 'child_lock', 'siid': 7, 'piid': 1}, {'did': 'favorite_level', 'siid': 10, 'piid': 10}, {'did': 'favorite_rpm', 'siid': 10, 'piid': 7}]}
2020-06-19 01:40:30 DEBUG (SyncWorker_7) [miio.miioprotocol] Retrying with incremented id, retries left: 3
2020-06-19 01:40:30 DEBUG (SyncWorker_7) [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\x07\x8a\x05y\x00\x15\xfa\x05' (total 16)
        value = Container: 
            length = 32
            unknown = 0
            device_id = b'\x07\x8a\x05y' (total 4)
            ts = 1970-01-17 16:04:21
        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)

More complete log file attached.

Additional information

@ehn
Copy link
Author

ehn commented Jun 18, 2020

ha.log

@probot-home-assistant
Copy link

xiaomi_miio documentation
xiaomi_miio source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @rytilahti, @syssi, mind taking a look at this issue as its been labeled with a integration (xiaomi_miio) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@denysdovhan
Copy link
Contributor

Might be related to #36972 and #36993 as well.

@ehn
Copy link
Author

ehn commented Jun 22, 2020

This seems to be caused by this issue: rytilahti/python-miio#730

@rytilahti
Copy link
Member

This looks more like an invalid token than other of those linked issues as the device is responding to the handshake but is not responding anything to the queries. So the linked upstream issue is also not relevant.

@ehn
Copy link
Author

ehn commented Jul 2, 2020

@rytilahti The tokens were extracted from the iOS app following this guide:

https://www.home-assistant.io/integrations/vacuum.xiaomi_miio/#retrieving-the-access-token

It works for the Air Purifier 2 (mini) (zhimi.airpurifier.m1) but not for the Air Purifier 3 (2019) (zhimi.airpurifier.ma4).

@ehn
Copy link
Author

ehn commented Jul 3, 2020

rytilahti/python-miio#745 fixes this issue.

@hoangmnsd
Copy link

@ehn How did you solve this issue?
I'm facing the same problem with my Mi Air Purifier 3H:
ERROR message:

The xiaomi_miio platform for the fan integration does not support platform setup. Please remove it from your config.

My HASS Container version is: core-2022.4.7

@ehn
Copy link
Author

ehn commented May 2, 2022

IIRC, it worked after the above-mentioned PR was merged.

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

Successfully merging a pull request may close this issue.

6 participants