aholstenson / miio

Control Mi Home devices, such as Mi Robot Vacuums, Mi Air Purifiers, Mi Smart Home Gateway (Aqara) and more
MIT License
1.86k stars 355 forks source link

Add new type device humidifier #192

Open mafof opened 5 years ago

mafof commented 5 years ago

I'am have humidifier with unical code zhimi.humidifier.ca1. I writes this device in local package to file models.js and it's worked

netRunner0 commented 5 years ago

Thanks!

DavyJohnes commented 5 years ago

@mafof how did you make it work with zhimi.humidifier.ca1? I have the same device, and every time I'm trying to connect to is using miio.device({address: '192.168.1.230', token: 'xxxxxxxxxxxx'}) I get the following error { Error: Could not connect to device, token might be wrong at enrichPromise.promise.then.then.catch.err (/Users/izuev/Projects/humidi/node_modules/miio/lib/network.js:324:16) code: 'connection-failure', device: null }. Am I doing something wrong?

DavyJohnes commented 5 years ago

In addition, miio@0.15.6 doesn't show it in miio discover, but miio@0.14.2 does.

CooperCGN commented 5 years ago

@DavyJohnes Where did you get the token from? Mine didn't work at first because I tried to use the token I got when the humidifier was still in discovery mode for setting it up. You have to connect it to your wifi and then use the method described here to obtain the correct token: https://github.com/jghaanstra/com.xiaomi-miio/blob/master/docs/obtain_token.md#ios-users