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

Please add Support for Xiaomi Air Purifier S2 #28

Closed
onkelalex opened this issue May 19, 2021 · 14 comments
Closed

Please add Support for Xiaomi Air Purifier S2 #28

onkelalex opened this issue May 19, 2021 · 14 comments
Assignees
Labels
enhancement New feature or request

Comments

@onkelalex
Copy link

I own a Air Purifier S2 (zhimi.airpurifier.mc1) but atm there is no chance to get this device working with iobroker. Last chance will be your script :)

Please add support for it.

@Pittini Pittini self-assigned this May 19, 2021
@Pittini Pittini added the enhancement New feature or request label May 19, 2021
@Pittini
Copy link
Owner

Pittini commented May 19, 2021

I'll make a testintegration in the next days, but all tests have to make by you. I dont own the device so i can't test.

@Pittini
Copy link
Owner

Pittini commented May 20, 2021

Ok, i've made a testversion. There are two possible protocols, so first, we have to find out which one is used. Ive just integrated power and mode function for testing, if it works i will complete with the otherr functions. If not, we try the other protocol.

Now your part, please copy the file zhimi-airpurifier.mc1.js from here: https://github.com/Pittini/iobroker-nodemihome/tree/main/DefinitionfilesForNode-Mihome to your node-mihome devices directory as described in the readme.
Restart the js controller. Copy and install the new scriptversion 0.2.16. Start it. If it works, you got two new Datapoints power and mode, they also should automaticly filled with the actual state. If yes, try to switch power. If it works, report. If it dont works, report also.

@onkelalex
Copy link
Author

Hi Pittini,

first: thanks for your fast answer!

after copying the new 0.2.16 script into the JS Engine and added the zhimi-airpurifier.mc1.js to the directory, the js engine says
No Supported devices found. After checking the script (header says that it is still the version 0.2.15?) it turns out that there is no device for the zhimi-airpirifier.mc1. Is this the right behavior?

image

The device will be added to objects, bit there is no reading on it.
image

@Pittini
Copy link
Owner

Pittini commented May 20, 2021

You've restartet the js adapter after copying the .js file into the directory? Thats important! But, if yes, then we try the second protocol.

@onkelalex
Copy link
Author

yes I did :)

@Pittini
Copy link
Owner

Pittini commented May 20, 2021

Uhh, i see, a mistake at my side, it was really the 0.2.15 and not the new one. Now i've uploaded the right one, sorry. Please try again with the actual 0.2.16

@onkelalex
Copy link
Author

No Problem 😁
And here we go:

image

Powerswitch is working like a charm!

@Pittini
Copy link
Owner

Pittini commented May 20, 2021

Looks good, can you switch power via datapoint??

@onkelalex
Copy link
Author

yes, without any issues.

@Pittini
Copy link
Owner

Pittini commented May 20, 2021

Ok, so we have the right protocol. I'll set the other functions now, and after that you have to copy the .js again and restart the js controller. Give me an hour or so.

@Pittini
Copy link
Owner

Pittini commented May 20, 2021

Ok, lets try it. Please first delete the created datapoint tree (the script will renew it) of the device in iob. Then copy the new .js file and the new script (no new version number) as you did before. Start script, if working, test all datapoints and report.

@onkelalex
Copy link
Author

onkelalex commented May 20, 2021

Just tuned in and it works perfectly! Thanks for your quick solution! Great Work!

image

just a small improvement idea: is it possible to make the value at favorite_level only changeable between 1 and 10?
because these are the maximum and minimum values of the device

@onkelalex onkelalex reopened this May 20, 2021
@Pittini
Copy link
Owner

Pittini commented May 20, 2021

just a small improvement idea: is it possible to make the value at favorite_level only changeable between 1 and 10?
because these are the maximum and minimum values of the device

Sure. Done. Get the 0.2.16 again. You have to delete the datapoints first again, or the changed setting has no effect.

@onkelalex
Copy link
Author

Works perfectly! Thank you, Pittini!
issue can be closed 👍

@Pittini Pittini closed this as completed May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants