ikaruswill / lovelace-fan-xiaomi

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

Natural mode button not working (Smart Mi 2s) #88

Closed Lyr3x closed 2 years ago

Lyr3x commented 2 years ago

I just updated to 2.1.0 and it seems that the natural mode is broken. If the natural mode is off i can turn it on via the card, but the status is not reflected (always off). Turning the natural mode off is not working at all. Calling the service directly is working fine. There is no error visible in the logs

garv3 commented 2 years ago

Works with my Smartmi Standing Fan 3.

yeyeoke commented 2 years ago

Yeah I'm having the exact same issue with my fan.

Only configuration that might impact this may be:

platform: xiaomi_miio_fan

jesryn commented 2 years ago

SAme problem for me with a P15

djsnho commented 2 years ago

Exactly the same problem with model: "dmaker.fan.p18" (Xiaomi standing fan 2)

edit: made a pull request with the solution

change line 1051 to if (preset_mode === 'Nature' || preset_mode = 'nature') {

ian-craig commented 2 years ago

I believe this is now fixed on master. Hopefully we'll have a new build pushed soon but we have made major changes recently for a separate issue so may move a little more carefully for that.

It sounds like from this discussion the issue was only with status reporting, not actually toggling the fan mode, but I noticed that when we set the preset mode we're using "Nature" or "Natural" as well. I tested "nature" on my device (which reports "Nature" as status) and it did not work, so I'm wondering whether any devices which report "nature" would still fail on the set.

jesryn commented 2 years ago

For me, the Smart Standing Fan Pro/P15 show the same status for Direct/Natural all the time. Natural is deselected, which means direct breeze. And it is not possible to toggle by clicking it. Nothing changes, no matter if the fan is set to direct or natural mode.

ian-craig commented 2 years ago

Interesting. @jesryn would you mind sharing the full state and attributes for your fan from the Developer Tools > State page? Both with nature mode on and off would be helpful so we can see what attribues and values are available to watch.

And just to confirm you're using the Xiaomi Mi Smart Pedestal Fan integration not the default?

Also as a side note: It looks like P15 support through the native/default integration is coming soon so will hopefully also resolve this for you https://github.com/home-assistant/core/issues/73496

jesryn commented 2 years ago

@ian-craig Sorry for my late answer. Yes I use Xiaomi Mi Smart Pedestal Fan and use it in config with I use it with "platform: xiaomi_miio_fan". It looks like this under developers tools:

preset_modes: off, Level 1, Level 2, Level 3, Level 4 direction: null oscillating: true percentage: 100 percentage_step: 1 preset_mode: Level 4 model: dmaker.fan.p15 angle: 60 raw_speed: 100 delay_off_countdown: 0 ac_power: null oscillate: true direct_speed: null natural_speed: null child_lock: false buzzer: false led_brightness: null use_time: null temperature: null humidity: null battery: null battery_charge: null button_pressed: null led: false battery_state: null mode: nature friendly_name: Fläkt TV-rummet supported_features: 15

ikaruswill commented 2 years ago

Fixed in 2.2.0, thanks for waiting, please do reopen this if you still face this issue.

Lyr3x commented 2 years ago

@ikaruswill still not working for me. The button is not reactive at all and also does not create a error message. I reinstalled the component. Anything else?

preset_modes:
  - 'off'
  - Level 1
  - Level 2
  - Level 3
  - Level 4
direction: null
oscillating: true
percentage: 25
percentage_step: 1
preset_mode: Level 1
model: zhimi.fan.za4
angle: 30
raw_speed: 310
delay_off_countdown: 0
ac_power: true
oscillate: true
direct_speed: 25
natural_speed: 25
child_lock: false
buzzer: false
led_brightness: 1
use_time: 72635
temperature: null
humidity: null
battery: null
battery_charge: null
button_pressed: null
led: null
battery_state: null
friendly_name: Xiaomi Smart Fan
supported_features: 15