Giter Club home page Giter Club logo

Comments (24)

aholstenson avatar aholstenson commented on August 14, 2024

I actually received one of those a few days ago. Haven't had the chance to do anything special with it though. But support for it is definitely coming. Hopefully it will be in the next few weeks.

from miio.

deennoo avatar deennoo commented on August 14, 2024

Ok great ! that just a sensor reader, maybe you can read sensor value and batterie, but nothing special to do with this.

Count on me to test it

from miio.

deennoo avatar deennoo commented on August 14, 2024

made some test:

he allow auto token :

Device ID: 47584928
Model info: Unknown
Address: 192.168.0.xxx
Token: 90a5db2xxxxfd56a13beed58611dc8bc via auto-token

But no way to get packet from bluestack and Wireshark on my side.

from miio.

deennoo avatar deennoo commented on August 14, 2024

FYI

pi@raspberrypi:~ $ miio --inspect 47584928
 INFO  Attempting to inspect 47584928

Device ID: 47584928
Model info: zhimi.airmonitor.v1 (generic)
Address: 192.168.0.xxx
Token: 90a5db2af60fd56a13bxxx58611dc8bc via auto-token
Support: At least basic

Firmware version: 1.2.9_8030
Hardware version: MW300

WiFi: myssid (14:0C:76:FB:xx:xx) RSSI: -66
WiFi firmware version: SD878x-14.76.36.p84-702.1.0-WM

Remote access (Mi Home App): UDP

from miio.

Bluebie avatar Bluebie commented on August 14, 2024

So your token is 90a5db2af60fd56a13beed58611dc8bc for device 47584928. you censored different sections each time.

from miio.

deennoo avatar deennoo commented on August 14, 2024

@Bluebie don't know if token is security sensible or not...

from miio.

hamwong avatar hamwong commented on August 14, 2024

Is there any progress yet?

from miio.

hamwong avatar hamwong commented on August 14, 2024

I figure out use below command will get some result,
miio --control 192.168.xxx.xxx --method get_prop --params '["aqi","power","battery","usb_state"]'

INFO Attempting to control 192.168.xxx.xxx

INFO Got result:
[
34,
"on",
0,
"on"
]

from miio.

Zlikster avatar Zlikster commented on August 14, 2024

@hamwong Thanks man, tried it and it works. Have you managed to find power on/off call? Since i would like to power it on and off via sw (domoticz). I have realized when you power it off via physical button, wifi is still on (pingable), and device sends last param result.

from miio.

hamwong avatar hamwong commented on August 14, 2024

no I didn't, in fact I leave it open 24 hours and track the result in grafana

from miio.

animalillo avatar animalillo commented on August 14, 2024

I have this device too and have been triying to configure it trough the commandline interface since it's not supported on my current region in the app.

The miiio --discover command won't show it on the list even if connected to the configuration access point the device has.

I have found it's network address and tried configuring it as follows: miio --configure 192.168.13.1 --ssid [removed] --passwd [removed]

192.168.13.1 is the device address within the wifi network.
192.168.13.2 is the ip the sensor assigns to you via dhcp.

i'm out of ideas on this subject, is it possible than this library is not capable of configuring uninitialized devices (resetted)? If so it's a shame you need to depend on the app to initialize the devices, specially since it has region restrictions and i would like to fully get rid of it.

I'm a programmer and i would like to help on anything i can, since this library seems pretty useful.

from miio.

Zlikster avatar Zlikster commented on August 14, 2024

@animalillo I am not sure you can use miio lib to setup device. In the mi home app you should change region to mainland china so you can add device (later you can change it back). Then use miio lib to control device. I am trying to add PM 2.5 detector to Domoticz for better logs and further automation. Trying to find a way to turn it on/off (well it's more like standby on off) via miio.

from miio.

animalillo avatar animalillo commented on August 14, 2024

So far with the tests i've been able to perform i have not been able to setup the device to connect to the wifi network and work.

I have tried to set the device to model: 'zhimi.airpurifier.m1' and i can turn it on and off, also with device.on('propertyChanged', e => console.log(e.property, e.oldValue, e.value)); i get the useTime value, nothing more from it so far, setting it up from the app is really annoying as i have to set up the air purifier i have on the app all over again by resetting it and the app does not allow to add the device on my region only the purifier .

Also i've noticed this thing displays some date and time, i guess that from mainland china, would be nice to change that to my current datetime.

Any ideas on how to help to add this features and get the sensor value?

from miio.

animalillo avatar animalillo commented on August 14, 2024

Oh i have noticed that the value of aqi changes, I'm too tired at this time and didn't notice it hadn't changed from the sensor. Sorry for that.

So you can get the aqi value just as if from the air purifier.

Only thing left would be to be able to set the date and time i think? Does this thing has more capabilities? Maybe synchronize it with the air purifier as the app allows but idk about how that part would work.

from miio.

Zlikster avatar Zlikster commented on August 14, 2024

@animalillo thats why i am saying change region in mi home app temporary just to add device to your wifi network. As for time/clock, yeah i noticed it's in chinese time zone, but i do not intend to use it as a clock anyways, so i ain't bothered to find a way to fix it.

aqi value as hamwong discovered via miio is miio --control 192.168.xxx.xxx --method get_prop --params '["aqi"]'

you can also pull additional parameter values from it "power", "battery" and "usb_state"

from miio.

Zlikster avatar Zlikster commented on August 14, 2024

Weird, i have upgraded firmware on it (via mi home app), now when i turn it off via physical button, it's not alive anymore (no ping reply) as it was before. Damn, now there is no option to turn it on again remotely. I guess i now have to find a way to downgrade firmware or leave it as always on device.

from miio.

animalillo avatar animalillo commented on August 14, 2024

I have upgraded firmware too and it allows control via software if you turn it off and then on again trough software (hadn't tried hardware key)

from miio.

Zlikster avatar Zlikster commented on August 14, 2024

really? I can't turn it off via sw. Eg. if device is on, i can turn it off with cmd:

miio --control 192.168.0.xxx --method set_power --params '["off"]'

what cmd you use to turn it on? How can you turn it on when it's not connected to wifi?

miio --control 192.168.0.xxx --method set_power --params '["on"]' doesn't works

to what fw version you have upgraded? I am on 1.2.9_8038

from miio.

Zlikster avatar Zlikster commented on August 14, 2024

My bad, i have unplugged by accident usb power cable. If the usb power is on, device is till active even when turned off on physical button, when it's off while on battey you can't turn it on via sw.

Do you use it in domoticz or some other sw?

from miio.

gharland avatar gharland commented on August 14, 2024

Can someone help. I use miio --control 192.168.1.10 --method get_prop --params '["aqi"]'

Returns: (node:3268) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection Id: 1): SyntaxError: Unexpected token ' in JSON at position 0

from miio.

Zlikster avatar Zlikster commented on August 14, 2024

@gharland you use PM 2.5 detector standalone or Xiaomi Purifier 2 pro? Purifier uses tokens, while standalone detector doesn't (as i know).

from miio.

gharland avatar gharland commented on August 14, 2024

It is the standalone. I have written a script instead which works (sorry, first attempt at node.js). This will give a reading every ~30 seconds, anyone know how to give more frequent readings?

const miio = require('miio');
const moment = require('moment');
const fs = require('fs');
const logger = fs.createWriteStream('log.txt', { flags: 'a' });
const devices = miio.devices({ cacheTime: 30 });
devices.on('available', reg => {
    const device = reg.device;
    if (!device) {
        console.log(reg.id, 'could not connect');
        return;
    }
    if (device.model == 'zhimi.airmonitor.v1') {
        console.log('Connected to pm2.5 monitor device at', device.address);
        device.defineProperty('aqi');
        device.on('propertyChanged', e => {
            var output = moment().format('YYYYMMDD hh:mm:ss,') + e.value + ',';
            console.log(output);
            logger.write(output + "\r\n");
        });
        device.monitor();
    }
});

from miio.

gharland avatar gharland commented on August 14, 2024

Nevermind, for anyone else who would like to know it's device.monitor([polling interval in milliseconds]);. The listener will trigger if oldValue != newValue.

from miio.

aholstenson avatar aholstenson commented on August 14, 2024

Proper support for the air monitor is available since 0.15.0. Please note that 0.15.0 has a lot of API changes so code written for 0.14.0 will not work without rewrites.

from miio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.