Pittini / iobroker-nodemihome

Steuerung von bisher nicht unterstützten Xiaomi Geräten in Iobroker via node-mihome
MIT License
27 stars 15 forks source link

Please add Support for Xiaomi Air Purifier S2 #28

Closed onkelalex closed 3 years ago

onkelalex commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

yes I did :)

Pittini commented 3 years ago

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 commented 3 years ago

No Problem 😁 And here we go:

image

Powerswitch is working like a charm!

Pittini commented 3 years ago

Looks good, can you switch power via datapoint??

onkelalex commented 3 years ago

yes, without any issues.

Pittini commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

Pittini commented 3 years ago

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 commented 3 years ago

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