home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.98k stars 31.02k forks source link

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

Open Bascht74 opened 2 years ago

Bascht74 commented 2 years ago

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

probot-home-assistant[bot] commented 2 years ago

Hey there @rytilahti, @syssi, @starkillerog, @bieniu, mind taking a look at this issue as it has been labeled with an integration (xiaomi_miio) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)


xiaomi_miio documentation xiaomi_miio source (message by IssueLinks)

Bascht74 commented 2 years ago

see: https://github.com/rytilahti/python-miio/pull/1362/files same with p18:

MODEL_FAN_P15 = "dmaker.fan.p15"
MODEL_FAN_P18 = "dmaker.fan.p18"
MIOT_MAPPING[MODEL_FAN_P15] = MIOT_MAPPING[MODEL_FAN_P11]  # see #1354
MIOT_MAPPING[MODEL_FAN_P18] = MIOT_MAPPING[MODEL_FAN_P10]  # see #1341

https://github.com/rytilahti/python-miio/issues/920:

Seems to be the global version of dmaker.fan.p11 - I am able to control it with miiocli fanp11 [OPTIONS] command [ARGS]

bieniu commented 2 years ago

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

syssi commented 2 years ago

This is the roadmap to solve this issue:

  1. Prepare a python-miio release. @rytilahti I would prepare a release if you agree.
  2. Add P15 and P18 to this line: https://github.com/home-assistant/core/blob/dev/homeassistant/components/xiaomi_miio/fan.py#L813
  3. Setup a HA development environemt to test the change or copy the modified xiaomi_miio folder into the custom_components folder to test the change. @Bascht74 Could you help here?
bieniu commented 2 years ago

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

Bascht74 commented 2 years ago

Setup a HA development environemt to test the change or copy the modified xiaomi_miio folder into the custom_components folder to test the change. @Bascht74 Could you help here?

Yes, shure! I am able to do that or temporarily replace the original file(s) with the new one (I don't have a HA dev environment) Thx for adding those devices.

Maybe you could check this as well (maybe could save time if same steps): https://github.com/home-assistant/core/issues/73427

w-marco commented 2 years ago

Chiming in here, I own the dmaker.p18 variant of this fan. I am happy to help testing if it works as expected as soon as there's something to test.

snp88 commented 2 years ago

Chiming in here, I own the dmaker.p18 variant of this fan. I am happy to help testing if it works as expected as soon as there's something to test.

Me too :)

Bascht74 commented 2 years ago

@syssi Hi, I changed my local HA files from vom P11 to P15 and it works so far. So adding the P15 to the python-miio should work as expected. Anything else I can do before you prepare the python-miio release? Seb

Bascht74 commented 2 years ago

@MartinHjelmare Could you please reopen this issue? I installed the latest beta, but the P15 and P18 are still not recognized.

Screenshots: image image

@rytilahti Could it be that something needs to be changed/added in the HA core integration as well?

rytilahti commented 2 years ago

Yes, this is indeed something that needs to be changed also in the integration, sorry. I'm open for PRs doing exactly that, but I'd much prefer like if someone could help to move the necessary logic out from homeassistant to python-miio.

The most recent releases allows querying the list of supported models from the implementation class in python-miio (supported_models property), so there should be no need to hard code model information inside home assistant. If some logic or constants depend on the given model its handling should be moved to python-miio.

Bascht74 commented 2 years ago

Hi, @bieniu maybe you could assist @rytilahti here?

I am asking you, because of:

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

Sorry, if you already got connected about that.

bieniu commented 2 years ago

@Bascht74 I have too much work right now, maybe I can take a look at it next week.

iMicknl commented 2 years ago

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'
Bascht74 commented 2 years ago

@iMicknl Yes, your help would be nice. Look at @rytilahti 's entry:

Yes, this is indeed something that needs to be changed also in the integration, sorry. I'm open for PRs doing exactly that, but I'd much prefer like if someone could help to move the necessary logic out from homeassistant to python-miio.

The most recent releases allows querying the list of supported models from the implementation class in python-miio (supported_models property), so there should be no need to hard code model information inside home assistant. If some logic or constants depend on the given model its handling should be moved to python-miio.

starkillerOG commented 2 years ago

@iMicknl see the latest few PRs of @rytilahti here: https://github.com/rytilahti/python-miio/pull/1488 That is the new way to which the vacuum component schould also be migrated.

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Bascht74 commented 2 years ago

bump

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

snp88 commented 1 year ago

bump

jonas-holm commented 1 year ago

Any news on this issue? Running HA 2023.4.3 and have the same issue with a Smart Standing Fan 2 (dmaker.fan.p18)

jonas-holm commented 1 year ago

Any news on this issue? Running HA 2023.4.3 and have the same issue with a Smart Standing Fan 2 (dmaker.fan.p18)

Just got it to work choosing dmaker.fan.p10 manually when configuring.

mchouque commented 1 year ago

It seems new effort on getting this fixed is being made by @golles in rytilahti/python-miio#1782

golles commented 1 year ago

It seems new effort on getting this fixed is being made by @golles in rytilahti/python-miio#1782

There is not much we can do until a new version of the lib is released, the work in HA has already been done in the past but canceled #78085

DaNii78 commented 1 year ago

I hope it will release soon.

smarthomefamilyverrips commented 1 year ago

Same problem having dmaker.fan.p18, all except setting the oscillation angle works when configuring as dmaker.fan.p10... hope gets solved

smarthomefamilyverrips commented 1 year ago

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 🙏

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

smarthomefamilyverrips commented 1 year ago

Still same problem, we are waiting for lib release but it seems nobody wanna help out

issue-triage-workflows[bot] commented 10 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

smarthomefamilyverrips commented 10 months ago

Still a issue not get picked up by code owners

rytilahti commented 8 months ago

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 :-)

smarthomefamilyverrips commented 5 months ago

Hello @rytilahti, @syssi, @starkillerOG, @bieniu any news on this?

cmgestevao commented 4 months ago

Same problem here, cannot change the angle on a Standing fan 2. Any news?

skynet137P commented 4 months ago

Same problem here, cannot change the angle on a p15 and p18

issue-triage-workflows[bot] commented 1 month ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

smarthomefamilyverrips commented 1 month ago

Not solved yet

cmgestevao commented 1 month ago

Not solved after 2 years!

I'm using this https://github.com/al-one/hass-xiaomi-miot just for the fan, it works very well!

manobg commented 1 week ago

Vacuum cleaner Model: dreame.vacuum.mc1808 not supported Please help

cmgestevao commented 1 week ago

That vacuum model is on the supported devices list on https://github.com/al-one/hass-xiaomi-miot