Xiaomi Humidifier support

Now everything should work? Thank you so much!!!

How to make the Nome Assistant earn now a humidifier?

Thanks. I now have the token.

Or how to check if the humidifier is working after you have corrected the code through the miiocli

Hi

Was your fix released?

I am still getting:
ā€œError: {ā€˜codeā€™: -9999, ā€˜messageā€™: ā€˜UART timeoutā€™}ā€

No. Itā€™s outstandig. I will prepare a python-miio release soon.

1 Like

Cool. Thanks!

syssi, you can add Xiaomi Smartmi Air Purifier support https://youpin.mi.com/detail?gid=101435 to Home Assistant ???
In miiocli info, it is displayed as zhimi.airfresh.va2

image

@alxnovo The Air Fresh v2 will be supported with HA 0.82.

Hi, Iā€™m also getting
Got exception while fetching the state: {ā€˜codeā€™: -9999, ā€˜messageā€™: ā€˜UART timeoutā€™}
from zhimi.humidifier.ca1 component in my logs on the latest 0.82.1 Home Assistant. Humidifier itself seem to work fine but I noticed that its state turns into ā€˜unknownā€™ around the time when the error appears but then it recovers back to normal.

I think we have more issues present. When I was trying to change the Humidifier speed I got:

TypeError: not all arguments converted during string formatting
Call stack:
  File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/src/app/homeassistant/__main__.py", line 397, in <module>
    sys.exit(main())
  File "/usr/src/app/homeassistant/__main__.py", line 389, in main
    exit_code = asyncio_run(setup_and_run_hass(config_dir, args))
  File "/usr/src/app/homeassistant/util/async_.py", line 29, in asyncio_run
    return loop.run_until_complete(main)
  File "/usr/src/app/homeassistant/components/fan/xiaomi_miio.py", line 505, in _try_command
    _LOGGER.error(mask_error, exc)
Message: 'Setting operation mode of the miio device failed.'
Arguments: (DeviceError({'code': -5001, 'message': 'invalid arg'},),)
2018-11-30 12:06:09 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/components/fan/xiaomi_miio.py", line 499, in _try_command
    partial(func, *args, **kwargs))
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/miio/airhumidifier.py", line 329, in set_mode
    return self.send("set_mode", [mode.value])
  File "/usr/local/lib/python3.6/site-packages/miio/device.py", line 270, in send
    raise DeviceError(m.data.value["error"])
miio.exceptions.DeviceError: {'code': -5001, 'message': 'invalid arg'}

Which HA version do you use? Which Operation modes are available? Which operation mode did you choose? Which version of the Air Humidifier do you own?

Hi

  1. 0.84.1
  2. CA1 (2018 Smartmi Pure Evaporative Air Humidifier)
  3. Modes available:
    -Silent
    -Medium
    -Auto
    -Strong --> this one is causing an error.

@Oliviakrk Could you verify the ā€œstrong modeā€ is available at the MiHome app? I assume your hardware doesnā€™t support the strong mode.

In the app modes are completely different:

-Automaric
-Level 1
-Level 2
-Level 3

Alright. So the mapping should be:

  • Automatic: Auto
  • Level 1: Silent
  • Level 2: Medium
  • Level 3: High

Does it apply? If you select the silent mode in Home Assistant does the MiHome App report ā€œLevel 1ā€?

It maps like that :

-Auto - Automatic
-Silent - Level 1
-Medium - Level 2
-High - Level 3

Which means that strong should be removed for ca1 :slight_smile:

I will remove the strong mode for your model (CA1)! Thanks for your feedback!

Thank you!

https://github.com/home-assistant/home-assistant/pull/18926

1 Like

Is there any possibilities to have information about the level of water ? The purpose is to send push notification when the level is low (kind of default ā€œDevice misbehavior alertā€ but customizable).

Thanks !

1 Like