core: dmaker.fan.{p15,p18} not available, but supported by the upstream library

The problem

Hi there, I bought the following model: Xiaomi Mi Smart Standing Fan Pro

I thought that this model is supported in the HA documentation:

Standing Fan Pro | dmaker.fan.p11

But it shows as dmaker.fan.p15 for class FanMiot maybe a newer revision?

According to this, that model should be supported: https://github.com/syssi/xiaomi_fan/blob/develop/README.md

Pedestal Fan Fan P15 | dmaker.fan.p15 in version:

  "name": "Xiaomi Mi Smart Pedestal Fan",
  "version": "2022.4.0.0",

But in HA that is not supported:

2022-06-14 19:15:27 WARNING (SyncWorker_7) [miio.device] Found an unsupported model 'dmaker.fan.p15' for class 'FanMiot'. If this is working for you, please open an issue at https://github.com/rytilahti/python-miio/
2022-06-14 19:15:27 WARNING (SyncWorker_7) [miio.miot_device] Unable to find mapping for dmaker.fan.p15, falling back to dmaker.fan.1c

In the code of fan.py the P15 seems to work in the same way as the P11 does:

    elif model in [MODEL_FAN_P11, MODEL_FAN_P15]:
        fan = FanMiot(host, token, model=MODEL_FAN_P11)
        device = XiaomiFanMiot(
            name, fan, model, unique_id, retries, preset_modes_override
        )

Could the P15 be enabled in the HA integration?

Sebastian

What version of Home Assistant Core has the issue?

Home Assistant Core 2022.6.5

What was the last working version of Home Assistant Core?

none

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Xiaomi_Miio

Link to integration documentation on our website

https://www.home-assistant.io/integrations/xiaomi_miio/

Diagnostics information

config_entry-xiaomi_miio-0caca181497a40008b372a614aab2503.json.txt

Example YAML snippet

./.

Anything in the logs that might be useful for us?

2022-06-14 19:15:27 WARNING (SyncWorker_7) [miio.device] Found an unsupported model 'dmaker.fan.p15' for class 'FanMiot'. If this is working for you, please open an issue at https://github.com/rytilahti/python-miio/
2022-06-14 19:15:27 WARNING (SyncWorker_7) [miio.miot_device] Unable to find mapping for dmaker.fan.p15, falling back to dmaker.fan.1c

Additional information

I tried to set it up as P11 (asked for mapping during setup of the integration) and it is shown on the device page: image

But the log above tells a different story --> another bug, that this is not working in the way intended? 2022-06-14 19:15:27 WARNING (SyncWorker_7) [miio.miot_device] Unable to find mapping for dmaker.fan.p15, falling back to dmaker.fan.1c

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 1
  • Comments: 32 (9 by maintainers)

Most upvoted comments

@syssi When a new version of the library is available I’ll implement those models in HA code.

Still a issue not get picked up by code owners

Hello @rytilahti, @syssi, @starkillerOG, @bieniu

Will this issue be solved any time soon? It is opened for over a year ago now. Any help will be most appreciated 🙏

Those models are supported only in master branch of python-miio. New release of the library is needed.

I released python-miio 0.6.0.dev0 a couple of days ago which should unblock this. If someone wants to help port current integration to use the new release, any help is welcome! I released a pre-release as there are some breaking changes, so at least some imports need to be renamed etc.

The plan is to eventually get rid of any hardcoding inside homeassistant and simply use the information provided by the library as I wrote here https://github.com/rytilahti/python-miio/issues/1808#issuecomment-1996273325 – any help to make that happen is welcome as it has always been 😃

bump

I have a dmaker.fan.p15 (Europe) and experience with Home Assistant component development, happy to help testing and or developing. Anything in particular where you can use some help?

For now, I configured my p15 as a dmaker.fan.p11, and it seems to be working. Just the Oscillation angle does not work since the component is looking in a dictionary with the actual model, instead of the configured model in python-miio. (and p15 is not present). Fix proposed in https://github.com/rytilahti/python-miio/pull/1496.

  File "/usr/local/lib/python3.10/site-packages/miio/integrations/fan/dmaker/fan_miot.py", line 321, in set_angle
    if angle not in SUPPORTED_ANGLES[self.model]:
KeyError: 'dmaker.fan.p15'