Xiaomi Humidifier support

Alex, actually i have same problem, but i can’t reinstall repository as well:



and can’t manually remove xiaomi_airpurifier from custom_components (supposedly the folder is not empty, but in fact I deleted all files from there)

Strange, but after i manually uploaded files to folder i was able to add it to HA, but it’s status is unavailable
Any thoughts?

Great. Does the humidifier have an own token? Because i also have a vacuum and extract the token from the app. As far as i remember it was not just for the the vacuum.

1 Like

Every device has an individual token. If you reset a device to change the wifi f.e. a new token is generated. If you use the same token for two devices something is wrong.

have a good deal for Mijia Intelligent Sterilization Humidifier EU version

It have model number ZNJSQ01DEM

See support in https://github.com/syssi/xiaomi_airpurifier
In feature list in repository see only Air Humidifier MJJSQ and JSQ1 (deerma.humidifier.mjjsq, deerma.humidifier.jsq1)

My model is deerma.humidifier.jsq

So i not completely sure what it can be integrated without problems

Can anyone help me in this?

1 Like

I own the same model. Just install the custom compnent via HACS and use model: deerma.humidifier.jsq at your configuration. It should work OOTB.

Hello I own a zhimi.humidifier.cb1 EU model, I’m wondering what is the buzzer for? And how do I use it on my model?, and can I get a example of What I can do with it?

If you press a button the humidifier beeps. If you turn the buzzer off the device is silent on button presses.

I have something like this
“Platform error fan.xiaomi_airhumidifier - Integration ‘xiaomi_airhumidifier’ not found.”
What have to do?

The platform xiaomi_airhumidifier is outdated. Please install this custom component (via HACS): https://github.com/syssi/xiaomi_airpurifier/

Hi,

currently I’m not using HACS (had some problems with later Versions, which didn’t update).

Is the “old” way possible too?
I have this humidifier:

   --------- read with token extractor
   NAME:  Befeuchter Dachgeschoss
   ID:    31******08
   IP:    192.168.***.***
   TOKEN: 27***********************7d
   MODEL: zhimi.humidifier.cb1
   ---------

Copying the folder \xiaomi_airpurifier-develop
into \custom_components
&
Adding this into configuration.yaml

fan:
  - platform: xiaomi_miio
    name: BefeuchterDG
    host: 192.168.***.***
    token: !secret mihumi_dg_token
    model: zhimi.humidifier.cb1

should still work?

Greetings
Max

@rmkew377 The custom component is called xiaomi_miio_airpurifier. Therefore the configuration looks like this:

fan:
  - platform: xiaomi_miio_airpurifier
    name: Xiaomi Air Purifier 2
    host: 192.168.130.71
    token: b7c4a758c251955d2c24b1d9e41ce47d
    model: zhimi.airpurifier.m1

The official component is called xiaomi_miio and is still available under this configuration/name/platform if the custom component is installed.

@syssi: Thanks for your help and your great component, it works like a charm!

In the meantime I bought a second Xiaomi Smartmi Humidifier:
The “Evaporator 2” (same housing and mechanics, but with a display at the front)

configuration.yaml:

fan:
  - platform: xiaomi_miio_airpurifier
    name: BefeuchterDG
    host: !secret mihumi_dg_ip
    token: !secret mihumi_dg_token
    model: zhimi.humidifier.cb1
  - platform: xiaomi_miio_airpurifier
    name: Befeuchter2DG
    host: !secret mihumi_2dg_ip
    token: !secret mihumi_2dg_token
    model: zhimi.humidifier.ca4  # with display

I had a bit of trouble getting the app to work with the Evaporator 2.

Device 1 (type: CJXJSQ02ZM, zhimi.humidifier.cb1, firmware 1.6.7.1005) worked with the Xiaomi Home App with region and time zone = Germany)

Device 2 (type: CJXJSQ04ZM, zhimi.humidifier.ca4, firmware 2.1.3.0017) was recognized in the german app, but could not be configured: Error device is not supported in this country.
After trying for hours, I got it paired with a Xiaomi Home App on another smartphone with country settings China (both region AND timezone!).
I now have 2 devices, one registered on the German server and one registered on the Chinese server.
Thanks to Piotr Machowski’s Token Extractor, I was able to determine the TOKENS for both devices … and they work with the component! (Now f**k these apps ;))

Maybe it’s interesting / important for “Water Level” sensor templates :
The value for the measured water level is (in my case) different even
though the housings of the devices are physically identical:

Device 1 (.cb1, attribute for water level = ‘depth’)
depth < 10 (fan stops when ‘dry’ set to ‘false’)
depth = 125, if filling is at MAX,
depth = 127 when the top is removed.

Device 2 (.ca4, attribute = water_level)
water_level < 10 (fan stops when ‘dry’ set to ‘false’)
water_level = 104, if filling is at MAX,
water_level = 105 when the top is removed.

You don’t have to understand all of the “improvements” made by software developers …:wink:

Greetings
Max

1 Like

Can You share your automation about łów level od Water/depth?

@rmkew377 How did you get the the token for the umidifier with display CJXJSQ04ZM?

@milutm Yes, here it is:

 sensor:
   - platform: template
    sensors:
##  CJXJSQ02ZM, zhimi.humidifier.cb1 reports depth=125 when Level is at MAX!          
      miio_waterlevel_dg:     
        value_template: >
          {% if state_attr('fan.befeuchterdg', 'depth') %}
            {{ ((state_attr('fan.befeuchterdg', 'depth') | float ) * 100.0 / 125.0) | round(0)  }}
          {% else %}
            0
          {% endif %}
        unit_of_measurement: '%'
        device_class: humidity
        friendly_name: 'Miio Wz2OG Waterlevel'

##  CJXJSQ04ZM, zhimi.humidifier.ca4 reports "water_level"=104 when Level is at MAX!          
      miio_waterlevel_2dg:
        value_template: >
          {% if state_attr('fan.befeuchter2dg', 'water_level') %}
            {{ ((state_attr('fan.befeuchter2dg', 'water_level') | float ) * 100.0 / 104.0) | round(0)  }}
          {% else %}
            0
          {% endif %}
        unit_of_measurement: '%'
        device_class: humidity
        friendly_name: 'Miio Lufti Waterlevel'

Automation:


## Check water_level  hourly
## notify if water_level(%) is below 17
- alias: 'a_check_miio_water_level'
  trigger:
    - platform: time_pattern
      hours: "/01"
      minutes: 00
      seconds: 30
  condition:
    - condition: numeric_state
      entity_id: sensor.miio_waterlevel_2dg
      below: 17
  action:
    - service: script.push_notify2phone
      data_template:
        pushtext: "Miio Waterlevel is low!"
1 Like

@Joao-Sousa-71

I used the token_extractor.exe from here:
https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor

In my case it worked after the registration of Yiaomi Home App at the China server (Chinese as Language AND with China as time zone!), although the device was purchased in Germany as an EU device.

I wish you success…

1 Like

@rmkew377 thanks for your answer. I will try with that one and follow your recommendation. I bought mine on Aliexpress supposedly as an EU version but I’m not even sure what version is it since the power adapter has a US plug with a converter. All the labels on the device are in chinese and english, and the manual in in chinese. Let you know the result. Thank you.

I have tried to add my humidifier (Mijia Intelligent Sterilization Humidifier) but HA does not recognise.
When using FAN: - platform: xiaomi_miio it doesnt accept the model, if I add platform with _airpurifier it will not also accept the platform.

Does anyone has this model working in HA?

I have the Humidifier 2 (ca4 version) and use the mini-humidifier card from HACS. However, as you can see below, the water level states 0, because water_level as an attribute is missing. I know this has been discussed before. I also found this thread on GitHub. However, I don’t understand what I can do to add water_level to the attributes. Can anyone help me?

2 Likes