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

AirPurifier: set_favorite_level not working #103

Closed
holger8080 opened this issue Oct 25, 2017 · 8 comments
Closed

AirPurifier: set_favorite_level not working #103

holger8080 opened this issue Oct 25, 2017 · 8 comments
Assignees
Labels

Comments

@holger8080
Copy link

Hi there,

thanks a lot for the great code! My Air Purifier works very well, except for setting the favorite level.
I get:

>>> import miio as mi
>>> x=mi.AirPurifier()
[... setting token and ID ]
>>> x.set_mode(OperationMode.Auto)
['ok']
>>> x.raw_command('set_favorite_level', 5)
{'error': {'message': 'Method not found.', 'code': -10000}, 'id': 148}

Same for the raw command:

>>> x.raw_command('set_favorite_level', 10)
{'error': {'message': 'Method not found.', 'code': -10000}, 'id': 149}

I'm using version 0.3.0 on my raspberry pi.

Can someone help, please?

@syssi
Copy link
Collaborator

syssi commented Oct 26, 2017

Which version of the Air Purifier do you own? "set_favorite_level" is working fine for my Air Purifier 2.

@syssi
Copy link
Collaborator

syssi commented Oct 26, 2017

Furthermore the set_favorite_level expects the OperationMode.Favorite beforehand.

@holger8080
Copy link
Author

Strange, I have an Air Purifier 2 as well...
Running firmware version 1.2.4_56

I set the OperationMode accordingly beforehand, didn't help, though.

>>> x.set_mode(OperationMode.Favorite)
['ok']
>>> x.set_favorite_level(5)
{'error': {'message': 'Method not found.', 'code': -10000}, 'id': 157}

Reading the data works, though:

>>> x.status().data
defaultdict(<function AirPurifier.status.<locals>.<lambda> at 0x75460078>, {'favorite_level': 9, 'f1_hour_used': 3500, 'buzzer': 'on', 'filter1_life': 0, 'bright': None, 'mode': 'favorite', 'power': 'on', 'temp_dec': 196, 'use_time': 19738867, 'led': 'off', 'aqi': 22, 'motor1_speed': 1476, 'led_b': 2, 'humidity': 72, 'child_lock': 'off'})

Any idea?

@rytilahti
Copy link
Owner

In some cases the firmware version is important (I've noticed with wifispeaker), so maybe this has been removed in the more recent versions or you are running an old version where it is not yet supported?

@holger8080
Copy link
Author

The Xiaomi app said that it's the most recent firmware; version 1.2.4_56
I can change the speed through the app, so in principle the functionality is there.

Also setting led brightness, for example, works. Strange...

How did you find out (reverse engineer?) in the first place that the command is set_favorite_level ?

@marcelrv
Copy link

I suggest trying it with
set_level_favorite
For the app I developed that seems to control it

@holger8080
Copy link
Author

Thanks!
set_level_favorite did the job!

@syssi
Copy link
Collaborator

syssi commented Oct 27, 2017

It's a bug. My device doesn't accept set_favorite_leve, too. It will be fixed with the next release!

 'fw_ver': '1.2.4_59',
 'hw_ver': 'MC200',
 'model': 'zhimi.airpurifier.m1',

@syssi syssi added the bug label Oct 27, 2017
@syssi syssi self-assigned this Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants