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

Fan Speed issue with zhimi.fan.za5 #61

Closed
Spegeli opened this issue Jun 17, 2021 · 13 comments
Closed

Fan Speed issue with zhimi.fan.za5 #61

Spegeli opened this issue Jun 17, 2021 · 13 comments

Comments

@Spegeli
Copy link

Spegeli commented Jun 17, 2021

I own the Pedelstan Fan 3 and got a issue with the Fan Speed:

model: zhimi.fan.za5
integration: xiaomi_miio_fan

The Error:
"Fehler beim Aufrufen des Diensts fan/set_speed. The speed Level 4 is not a valid speed."

So Speed 3 is the Limit and because of this Error i can not switch back to Speed 1.

Thats the Attributes:

speed_list:

  • 'off'
  • low
  • medium
  • high
  • 'off'
  • Level 1
  • Level 2
  • Level 3
    preset_modes:
  • 'off'
  • Level 1
  • Level 2
  • Level 3
    oscillating: false
    speed: Level 3
    percentage: 100
    percentage_step: 33.333333333333336
    preset_mode: Level 3
    model: zhimi.fan.za5
@ikaruswill
Copy link
Owner

ikaruswill commented Jun 17, 2021

I just upgraded my fan to the za5, and I'm seeing the same issue. The issue originates from xiaomi_miio_fan integration, where the za5 is only recently added and do not yet have stable features.

In the entity attributes, Level 4 is also missing from the speed list

speed_list:
  - 'off'
  - low
  - medium
  - high
  - 'off'
  - Level 1
  - Level 2
  - Level 3

Unfortunately it seems the issue doesn't lie with our code but rather upstream. We'll have to raise an MR with them.

@insajd
Copy link
Collaborator

insajd commented Jun 17, 2021

We can quickly allow iteration through 3 speeds instead of 4. Or option "use_standard_speeds: true" can be used, then it will iterate through low/medium/high options.
I have made a 3 speed fix in branch https://github.com/ikaruswill/lovelace-fan-xiaomi/tree/insajd-za5_fan
@ikaruswill should we release 3 speed fix as 1.5.7-beta for za5 or wait for upstream fix?

@ikaruswill
Copy link
Owner

ikaruswill commented Jun 17, 2021

Oh wow you're fast. @insajd thanks for your quick work as always. Let's release a beta, while I'll look into how I can solve that with a PR upstream.

To confirm it's a toggle-able option right?

@insajd
Copy link
Collaborator

insajd commented Jun 17, 2021

Oh wow you're fast. @insajd thanks for your quick work as always. Let's release a beta, while I'll look into how I can solve that with a PR upstream.

To confirm it's a toggle-able option right?

  • use_standard_speeds is togge-able option, it's present in 1.5.6 already and we don't need to release beta to use low/mid/high speeds. I suppose thiw will have something like 33,66,100% speeds.
  • Speed 3 fix in branch is not togge-able. It's internal setup for za5 only, that makes za5 to support only 3 speeds. It will iterate back to 1 after speed 3. This will probably have 1,33,66% speeds.

First option can be used already, for second option we can release beta, which will influence only za5 fan. I'll go with it

@ikaruswill
Copy link
Owner

ikaruswill commented Jun 17, 2021

Roger that. Let's roll with that fix for za5 temporarily until support is added.

I just poked upstream's upstream. Looks like the issue has been open for a while. ZA5 is using the new miotspec which is a whole new bag of worms and needs significant work. Likely we won't expect the fix to be here within the next month or so.

rytilahti/python-miio#788

@ikaruswill
Copy link
Owner

ikaruswill commented Jun 17, 2021

@Spegeli Just so you know, there are some ongoing issues with upstream:

  • Unable to set fan speed above 3 (You reported that, we have a workaround)
  • Unable to send a turn left/turn right command to the fan
  • Oscillation angle does not report nor set correctly
  • Timer does not set correctly

@ikaruswill
Copy link
Owner

@insajd It's working as expected, just tested with the ZA5. I'm able to cycle through all 3 speeds.

There are some weirdness that I observed however, due to the fan being not fully supported by xiaomi_miio yet.

  • Speeds cycle through 1%, 35%, 74% instead of 1%, 33%, 66%
  • use_standard_speeds will not work as raw_speed reports incorrect values.

For example, when speed is at high, or 74% (Read through Mi Home app):

raw_speed: 3

It appears that the raw_speed as of the current implementation, is reporting the speed level instead, and there's no attribute that reports the percentage speed correctly.

Nonetheless, I don't think we can or should implement any further hacks for ZA5. Thanks again!

@ikaruswill
Copy link
Owner

@Spegeli Do update to 1.5.7-beta2 should work as expected after a full, uncached refresh.

@Spegeli
Copy link
Author

Spegeli commented Jun 17, 2021

Works thx ;-)

Now its time to wait until the Miio Fan Adapter Dev adds the rest of the fan futures ^^

@insajd
Copy link
Collaborator

insajd commented Jul 20, 2021

@ikaruswill you can try getting this version, which ought to add support for the fan. rytilahti/python-miio#1087 and get ready the support of the fan card.

@ikaruswill
Copy link
Owner

Nice spot. Will check that out.

@tieppm
Copy link

tieppm commented Jan 22, 2022

@ikaruswill @insajd
please fit for zhimi.fan.za5
no change in speed and natural mode
thank you

@ikaruswill
Copy link
Owner

Closing as za5 is now supported with native integration on 2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants