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

Add airdog.airpurifier.x5 support #72

Open
nemen89 opened this issue Oct 2, 2020 · 9 comments
Open

Add airdog.airpurifier.x5 support #72

nemen89 opened this issue Oct 2, 2020 · 9 comments

Comments

@nemen89
Copy link

nemen89 commented Oct 2, 2020

airdog.airpurifier.x3
airdog.airpurifier.x5

Please add this device.
Thank you!!!

@syssi syssi changed the title Unsupported device found! airdog.airpurifier.x5 Add airdog.airpurifier.x5 support Oct 18, 2020
@syssi
Copy link
Owner

syssi commented Oct 19, 2020

get_prop []
set_clean []

set_lock [1] # on
set_lock [0] # off

set_power [1] # on
set_power [0] # off

set_wind [modeValue, speedValue]
set_wind [0, 1] # auto mode
set_wind [1, 1...5] # manual mode, speed 1...4 # on 'airdog.airpurifier.x5 (X3(M))
set_wind [1, 1...5] # manual mode, speed 1...5 # on airdog.airpurifier.x7 (X7(M)), airdog.airpurifier.x7sm (X7S(M))
set_wind [2, 1] # sleep mode


# Properties
# get_prop [] response:

[power, mode, speed, lock, clean, pm, hcho]

# power: 'on', 'off'
# mode: 'auto', 'manual', 'sleep'
# speed: [1...5] / [1...4] (int!)
# lock: 'unlock', 'lock'
# clean: y, n
# pm: 0...300? (int!)
# hcho: (airdog.airpurifier.x7sm only)

@syssi
Copy link
Owner

syssi commented Oct 19, 2020

Could somebody provide the response of a get_prop [] request?

@nemen89
Copy link
Author

nemen89 commented Oct 19, 2020

All right.
Where can I see the answer to the request? According to the description, all indications are correct.

@alexeypetrenko
Copy link
Contributor

Hi,
I have two of airdog.airpurifier.x5 air cleaners at hand and I would like to help if I can.

At this point I managed to get a token. All commands from your comment work as a charm!

Could somebody provide the response of a get_prop [] request?

You mean like this:?

$ miiocli device --ip  172.16.15.169 --token xxx raw_command get_prop '[]'
Running command raw_command
['on', 'sleep', 1, 'unlock', 'n', 11, 0]


Also, pardon my ignorance, but I'm a bit confused and would like to ask some noob questions. It would be awesome if someone can answer them or point me in the right direction.

  1. Home assistant has a xiaomi_miio integration. It also seems to use the same underlying library (python-miio). What is the reason that you made a separate component and not tried to submit to the home assistan integration? Sorry, if I'm being rude. I'm just trying to figure out how things are with home assistant and miio
  2. I've noticed that python-miio has a list of supported devices and airdog cleaner is not listed there. However, you gave a list of commands which work amazingly via miiocli raw_command. Do I understand correctly that this raw_command is pure miio protocol and has nothing to do with python-miio itself?
  3. Are you going to submit this information to python-miio, so that it can support Airdog natively?
  4. How do you find out these commands?

@syssi
Copy link
Owner

syssi commented Nov 20, 2020

  1. Protocol logic isn't allowed at the Home Assistant core. Every component requires a underlying library implementing the protocol.
  2. No. python-miio is the implementation of the protocol plus an interface class per supported device. You can control every miio device by raw_commands via python-miio but this requires knowledge about the supported methods & properties. If a device class at python-miio is present (the device is listed as supported) the device can by controlled via well documented & speaking methods (on, off, status,...).
  3. If we want airdog support at this custom component the python-miio device class implementation is required first / is the first step.
  4. The commands are extracted from the Mi Home App (plugin).

Another question(s):

  1. Could you explain the meaning of the "clean" property? What does "y(es)" and "n(o)" mean?
  2. Could you provide a screenshot of the Mi Home app?
  3. Could you provide a product name, model no. and some specs? This information is needed to updated the list of supported devices in future: https://github.com/syssi/xiaomi_airpurifier#supported-devices

@alexeypetrenko
Copy link
Contributor

Awesome. Thanks for your answers. Is there a guide how one can inspect these plugins? I'm thinking about trying to figure out how to control some other devices.


Regarding Airdog:

  1. After some time (weeks / months) device shows -C- on a screen. It indicates that it is time to wash filters. Device itself does not detect that you did it. You have to hold down a power button to reset it to normal state.
  • I assume that clean is a flag indicating whether or not you have to clean your device.
  • Most likely set_clean is used to reset it to normal state.

I'll validate it the next time when I get -C- message
IMG_20201121_123751_2
IMG_20201121_123737

  1. Sure,
    Screenshot_20201121-124659

  2. This is an air cleaner brought from China. Local store advertised it as Xiaomi KJ300F-X3 (M).

When you add it in the APP, it is called Airdog X3(M) air purifier. But on the next screen it is called Airdog X5. Also, miio detects it as airdog.airpurifier.x5.

Presumably it is the same as Airdog X5 sold in USA (For exmaple here).

Here is a picture from instructions if anyone reads chineese
IMG_20201121_130604_1

This is a sticker at the bottom. So, I assume the model is KJ300F-X3(M)
IMG_20201121_131018

Spec wise:
It has four fan power levels.
It has following modes:

  • Night mode: Screen is off, led is off, fan speed is at 1
  • Auto mode: Screen and led are on, fan speed is at 1 and supposedly it will ramp up when air quality decreases. Never happened to me. Probably air quality is good enough
  • 1: Screen and led are on, fan speed is at 1
  • 2: Screen and led are on, fan speed is at 2
  • 3: Screen and led are on, fan speed is at 3
  • 4: Screen and led are on, fan speed is at 4

Also it has child lock. Enabling it turns off a button on a device. So that you can not control it by pressing it.

@syssi
Copy link
Owner

syssi commented Nov 22, 2020

The first step to support airdog devices: rytilahti/python-miio#865

@alexeypetrenko
Copy link
Contributor

As promised, getting back to you with -C-

It came on again and I did get_prop and set_clean testing.

It seems that clean in get_prop response is always 'n'.
It was saying 'n' when device showed -C-.
Then I tried set_clean. It worked. -C- is gone.
However, get_prop clean still says n.

Also, I checked how app behaves when device shows -C-. Mi Home says nothing about a need to clean the device.
Also, it has 'Reset' option in menu, which does the same thing as set_clean.

So, I guess they decided not to bother and do not send this information from the device.

@xorbital
Copy link

Recently got one of those devices as well, my model number is KJ300F-X5 and it seems like this isn't supported at all :/
Looking in the Play Store you can find two apps when searching for "AirDog", the older one has a blue, while the newer app has a green logo.
They put stickers on the device which contain a QR code linking to a sketchy site which directly downloads the .apk
Long story short; you can neither add the -X5 device (although it's physically identical) to the old AirDog nor to the Xiaomi Home app. I switched region to Mainland China, however since the purifier doesn't open up an AP even when resetting the WiFi config, it seems like this model will only work with their own, new app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants