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

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

Open
Bascht74 opened this issue Jun 14, 2022 · 40 comments · Fixed by #75415
Open

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

Bascht74 opened this issue Jun 14, 2022 · 40 comments · Fixed by #75415
Assignees
Labels
integration: xiaomi_miio waiting-for-upstream We're waiting for a change upstream

Comments

@Bascht74
Copy link

Bascht74 commented Jun 14, 2022

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

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

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

rytilahti/python-miio#920:

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

@Bascht74 Bascht74 changed the title dmaker.fan.p15 not available, but supported by https://github.com/syssi/xiaomi_fan dmaker.fan.p15 not available, but supported by https://github.com/rytilahti/python-miio Jun 14, 2022
@bieniu
Copy link
Member

bieniu commented Jun 14, 2022

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

@syssi
Copy link
Member

syssi commented Jun 14, 2022

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

bieniu commented Jun 14, 2022

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

@Bascht74
Copy link
Author

Bascht74 commented Jun 14, 2022

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

@w-marco
Copy link

w-marco commented Jun 15, 2022

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

snp88 commented Jun 15, 2022

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

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

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

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.

@rytilahti rytilahti reopened this Jul 28, 2022
@rytilahti rytilahti changed the title dmaker.fan.p15 not available, but supported by https://github.com/rytilahti/python-miio dmaker.fan.p15 not available, but supported by the upstream library Jul 28, 2022
@Bascht74
Copy link
Author

Bascht74 commented Aug 8, 2022

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.

@rytilahti rytilahti changed the title dmaker.fan.p15 not available, but supported by the upstream library dmaker.fan.{p15,p18} not available, but supported by the upstream library Aug 8, 2022
@bieniu
Copy link
Member

bieniu commented Aug 10, 2022

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

@iMicknl
Copy link
Contributor

iMicknl commented Aug 13, 2022

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 rytilahti/python-miio#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
Copy link
Author

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

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

@snp88
Copy link

snp88 commented Feb 22, 2023

bump

@github-actions github-actions bot removed the stale label Feb 22, 2023
@jonas-holm
Copy link

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

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

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

@golles
Copy link
Contributor

golles commented Jun 17, 2023

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

DaNii78 commented Jul 10, 2023

I hope it will release soon.

@smarthomefamilyverrips
Copy link

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

@smarthomefamilyverrips
Copy link

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

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

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

@issue-triage-workflows
Copy link

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

Still a issue not get picked up by code owners

@bieniu bieniu removed their assignment Mar 1, 2024
@rytilahti
Copy link
Member

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 rytilahti/python-miio#1808 (comment) – any help to make that happen is welcome as it has always been :-)

@smarthomefamilyverrips
Copy link

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

@cmgestevao
Copy link

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

@skynet137P
Copy link

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

@issue-triage-workflows
Copy link

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

Not solved yet

@cmgestevao
Copy link

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

manobg commented Nov 13, 2024

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

@cmgestevao
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration: xiaomi_miio waiting-for-upstream We're waiting for a change upstream
Projects
None yet