ikaruswill / lovelace-fan-xiaomi

Xiaomi Smartmi Fan Lovelace card with CSS fan animation
Apache License 2.0
74 stars 34 forks source link

dmaker.fan.p18 issue #89

Open sagitt opened 2 years ago

sagitt commented 2 years ago

Using my new: Mi Smart Standing Fan 2 | dmaker.fan.p18 | BPLDS02DM | AC, 15W, 30.2-55.8bBi... with xiaomi_miio_fan custom integration from hacs, i found these problems:

IMG_0BE880AEE22D-1

Schermata 2022-05-22 alle 21 07 46

thanks.

mattsches commented 2 years ago

Maybe I should better open a separate ticket, but since I have similar problems with the same model using the same integration (xiaomi_miio_fan), I add it here.

I cannot switch to natural mode, but I'm getting an error:

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/xiaomi_miio_fan/fan.py:950
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 10:17:51 (2 occurrences)
Last logged: 10:18:01

[140626650422720] 'Nature'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 189, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1627, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1664, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 677, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 964, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 714, in _handle_entity_call
    await result
  File "/config/custom_components/xiaomi_miio_fan/fan.py", line 950, in async_set_preset_mode
    FAN_PRESET_MODE_VALUES_P5[preset_mode],
KeyError: 'Nature'

I suspect that the wrong method is called here?

ikaruswill commented 2 years ago

@mattsches The nature mode should be fixed in 2.2.0. Problem was case sensitivity of the preset mode. @sagitt 140 angle support has been added for your fan in 2.2.0, speed logic has also been changed, could you check and let me know if you're still facing this issue?

mattsches commented 2 years ago

I am sorry to say that the error still occurs with the new version 2.2.0.

I wonder if the strings in this line should be all lowercase, too?

sagitt commented 2 years ago

@ikaruswill My system won't load the card after update (i already tried to remove, reinstall and check HA dashboard resources) For see something i need to change to "default". Probably upgrade changed something.

where is the problem?

  - type: custom:fan-xiaomi
    name: Ventilatore
    entity: fan.ventilatore_1
    disable_animation: false
    force_sleep_mode_support: false
    hide_led_button: true
    platform: xiaomi_miio_fan
ikaruswill commented 2 years ago

Won't load as in what error are you seeing?

The upgrade has some changes in the code structure due to deprecations in Home Assistant.

sagitt commented 2 years ago

Won't load as in what error are you seeing?

The upgrade has some changes in the code structure due to deprecations in Home Assistant.

i see nothing, but i see it if set to "default", but i can control only on\off.. have error on services call for other thing (it's ok, i'm not using default integration)

ikaruswill commented 2 years ago

Do you have a screenshot perhaps? And does the edit mode on the dashboard show any error?

sagitt commented 2 years ago

Do you have a screenshot perhaps? And does the edit mode on the dashboard show any error?

image image image

ikaruswill commented 2 years ago

Hmm I see. Okay let me figure this out tomorrow. Meanwhile maybe you can install 2.1.0 to keep it working.

sagitt commented 2 years ago

Hmm I see. Okay let me figure this out tomorrow. Meanwhile maybe you can install 2.1.0 to keep it working.

I'll wait :)

ikaruswill commented 2 years ago

Hi @sagitt there are some outstanding issues on mobile with 2.2.0 unfortunately, this might take some time to resolve.

Meanwhile, I'd like to know a few things:

  1. I noticed from the screenshots that you're on mobile. Does this work on desktop for you?
  2. 'default' Platform works to toggle on and off right? Which integration are you using to connect the dmaker.fan.p18? Is it syssi/xiaomi_fan?
  3. Can you provide some examples of the service call errors that you mentioned?
sagitt commented 2 years ago

Hi @sagitt there are some outstanding issues on mobile with 2.2.0 unfortunately, this might take some time to resolve.

Meanwhile, I'd like to know a few things:

  1. I noticed from the screenshots that you're on mobile. Does this work on desktop for you?

  2. 'default' Platform works to toggle on and off right? Which integration are you using to connect the dmaker.fan.p18? Is it syssi/xiaomi_fan?

  3. Can you provide some examples of the service call errors that you mentioned?

Same on dekstop I'm using xiomi mi smart pedestal fan integration Mi hacs now won't load something about this card I'll send you error of service call image

sagitt commented 2 years ago

Hmm I see. Okay let me figure this out tomorrow. Meanwhile maybe you can install 2.1.0 to keep it working.

Now afeter upgrade to 2.2.1 i can see it but unusable on mobile. Anyway setting it on xioami platform, not work too.

below mobile issue and service calls with default platform.

image

Schermata 2022-07-24 alle 20 13 59 Schermata 2022-07-24 alle 20 14 04 Schermata 2022-07-24 alle 20 14 10

sagitt commented 2 years ago

Will you release a new version for fix these problems?

For now i done a downgrade.

Subdarub commented 2 years ago

The nature mode problem still exists btw. It still calls for a Preset while it instead should call for "Mode".

On both 2.0 and 2.1

If you need any troublshooting assistance please let me know. @ikaruswill

linsvensson commented 2 years ago

I'm having a similar problem with the pro version of this fan (dmaker.fan.p33). Would love to see this fixed.

ikaruswill commented 2 years ago

Hi everyone, I understand this has been an issue for many, but unfortunately I have my hands full with a life event of mine and won't be able to dedicate time to this until late September.

Meanwhile, I'd be happy to approve PRs or give anyone who's willing to give this a go, developer access. Appreciate your patience on this. 🙏