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 354 forks source link

Support for zhimi.airpurifier.v7 #182

Open areekz opened 6 years ago

areekz commented 6 years ago

lib doesn't work for air purifier with version 7. I can connect to device but can not get any data from device

C:> miio discover INFO Discovering devices. Press Ctrl+C to stop.

Device ID: "My device id" Model info: zhimi.airpurifier.v7 Address: "my internal ip assigned to air purifier" Token: ??? Support: At least generic

When execute C:>miio protocol call "ip address of air purifier" get_prop '["temperature"]' Console output: INFO Attempting to call get_prop on "ip address of air purifier" INFO Device found, making call

Nothing is returned here. Waited 5 min with making call but nothing was returned

Checked also in node.js

const miio = require('miio');

miio.device({ address: '"ip of my purifier"', token: '"my token which was displayed after direct connection to purifier wifi network and execute miio discover"' }) .then(device => { console.log('connected');

      if(device.matches('type:air-purifier')) {
    console.log('air-purifier');
            }
  })

.catch(err => console.log(err));

MY OUTPUT:

D:\node.js\homeMonitor>node build/test.js connected

So it seems that connection is established but purifier is not detected. No output for console.log('air-purifier');

rootsnet commented 5 years ago

Is there any plan or update for 'zhimi.airpurifier.v7'?

rootsnet commented 5 years ago

I had same issue from homebridge-mi-air-purifier. I solved this issue myself temporarily from model information adding as below.

1) Stop to upgrade miio docker exec -it marcoraddatz-homebridge1 /bin/bash vi /root/.homebridge/install.sh

npm install -g miio

2) Add model info vi /usr/local/lib/node_modules/miio/lib/models.js 'zhimi.airpurifier.v7': AirPurifier,