syssi / xiaomi_airpurifier

Xiaomi Mi Air Purifier and Xiaomi Mi Air Humidifier integration for Home Assistant
Apache License 2.0
456 stars 113 forks source link

Unsupported device found: zhimi.airfresh.va2 (智米新风) #25

Closed Yonsm closed 6 years ago

Yonsm commented 6 years ago

Please help support the SmartMi Air Fresh System. The device model ID is zhimi.airfresh.va2

With the following configuration, it can almost work well (Turn On/Off, aqi, humidity, etc.) :

  - platform: xiaomi_miio
    name: Fresher
    host: 192.168.1.x
    model: zhimi.airpurifier.m1
    token: ****************

BTW, Could you please tell me how to sniffer/analyze miio traffic payload with the new device? I found https://github.com/OpenMiHome/mihome-binary-protocol, but it can't analysis the traffic between MiHome app and Xiaomi Cloud, and I couldn't find how to enforce/repeat the device and MiHome app to communication via local protocol. Your help will be highly appreciated:)

syssi commented 6 years ago

Could you provide a link to the product?

syssi commented 6 years ago

The device support (zhimi.airfresh.va2) is provided by the MiHome plugin 714/11950.apk:

# Available roperties
get_prop ["app_extra", "aqi", "average_aqi",  "buzzer", "child_lock",  "co2", "cola", "f_hour", "favorite_level", "f1_hour_used", "filter_life", "humidity", "led", "led_level",  "mode",  "motor1_speed", "ntcT", "power", "temp_dec", "use_time"]

# Used properties
get_prop ["power", "mode", "aqi", "co2", "led_level", "temp_dec", "humidity", "buzzer", "child_lock", "f1_hour_used", "motor1_speed"]

# buzzer on/off
set_buzzer ["on"]
set_buzzer ["off"]

# child lock on/off
set_child_lock ["on"]
set_child_lock ["off"]

# led level
set_led_level [0] # strong?
set_led_level [1] # normal?
set_led_level [2] # none?

# operation mode
set_mode ["auto"]
set_mode ["silent"]
set_mode ["favorite"] # unused?
set_mode ["low"]
set_mode ["middle"]
set_mode ["strong"]
# timer
set_mode ["interval"]

# motor speed 
set_motor1  [integer]

# power on/off
set_power ["on"]
set_power ["off"]
syssi commented 6 years ago

I will implement the new device soon. Could you provide the product link? I would like to know the specifications of the device.

Yonsm commented 6 years ago

Great! And thanks for your information.

There is no official product page at this time, but a store page without English support: https://youpin.mi.com/detail?gid=101944

News ref: https://beebom.com/xiaomi-smartmi-fresh-air-china/

Yonsm commented 6 years ago

I have a try base on your AirPurifier, it almost works well.

The used properties is correct:

# Used properties
get_prop ["power", "mode", "aqi", "co2", "led_level", "temp_dec", "humidity", "buzzer", "child_lock", "f1_hour_used", "motor1_speed"]

But the correct operation mode list is:

    Auto = 'auto'
    Silent = 'silent'
    Interval = 'interval'
    Low = 'low'
    Middle = 'middle'
    Strong = 'strong'

low/middle/strong maybe means motor speed is 1-3 (or 0-2). I think set_mode is enough and set_motor1 is not needed.

syssi commented 6 years ago

This help a lot! Thank you!

syssi commented 6 years ago

I assume the set_motor1 method is used for the operation mode "favorite". May be this feature isn't available right now.

Yonsm commented 6 years ago

I made a xiaomi_miio_airfresh custom_components based on your xiaomi_miio AirPurifier. It works well now (without set_motor1 support). Ref it here https://github.com/Yonsm/HAExtra/blob/master/custom_components/fan/xiaomi_miio_airfresh.py

Thank you for your help, looking forward to support Xiaomi Air Fresh in new version of python-miio xiaomi_airpurifier and HomeAssistant.

syssi commented 6 years ago

@Yonsm Could you provide the output of

./mirobo --ip IP --token TOKEN raw_command info
./mirobo --ip IP --token TOKEN raw_command get_prop "['power', 'temp_dec', 'aqi', 'average_aqi', 'co2', 'buzzer', 'child_lock', 'humidity', 'led_level',  'mode', 'motor1_speed', 'use_time', 'ntcT', 'app_extra', 'f1_hour_used', 'filter_life', 'f_hour', 'favorite_level', 'led']"

Thanks in advance!

syssi commented 6 years ago

@Yonsm ping! Could you provide the requested get_prop output?

DmitriusDan commented 3 years ago

Can you advise on how to get the device token? I cannot add my zhimi.airfresh.va2 to my Mi home app - a device connected to the network, but in Mi home I see a timeout error every time I try to add a device.

htcmemberus commented 3 years ago

Can you advise on how to get the device token? I cannot add my zhimi.airfresh.va2 to my Mi home app - a device connected to the network, but in Mi home I see a timeout error every time I try to add a device.

Xiaomi have a token tool to capture all xiaomi tokens on your network, u can google it, i forgot the exact name of the tool :)

zdjabbar commented 3 years ago

Can you advise on how to get the device token? I cannot add my zhimi.airfresh.va2 to my Mi home app - a device connected to the network, but in Mi home I see a timeout error every time I try to add a device.

I confirm this issue. I have same problem and looking for solution. miio command line tool didn't help; discovered in network but token line is: ???