miio icon indicating copy to clipboard operation
miio copied to clipboard

New SmartMi Humidifier WATER LEVEL sensor

Open leoneleone opened this issue 6 years ago • 15 comments

e089da30-dd73-46e4-8535-b988880e6ca5 @aholstenson

The newly released SmartMi Humidifier has a Water Level sensor. Can you please add the Water Level as a capability/sensor to your code?

leoneleone avatar Mar 21 '18 17:03 leoneleone

From looking at the api information I believe the water level is defined by the “depth” capability on the humidifier. Is there any chance you can “depth” to the code?

leoneleone avatar Mar 22 '18 03:03 leoneleone

What is the model name like zhimi.humidifier.v1?

What do I have to add string in model.js if humidifier2 is supported?

fison67 avatar Mar 24 '18 03:03 fison67

I’m not sure about the model name of the new Smart Mi Humidifier as I haven’t received mine yet, but it seems the Canadian version of the original Humidifier also supports “depth” (water level?).

The model number for the Canadian version is:

zhimi.humidifier.ca1

I imagine the newest model will have the name: zhimi.humidifier.v2 But I can’t confirm that just yet.

leoneleone avatar Mar 24 '18 11:03 leoneleone

This product is in use. My WiFi is recognized as below. zhimi-humidifier-ca1_mibt56689940

stkang avatar Mar 24 '18 15:03 stkang

@stkang Which product are you referring to exactly? The model pictured above in my original post?

@aholstenson I’m still trying to find documentation on the “depth” property associated with the .ca1 model but there are no official details regarding it. It makes logical sense that “depth” refers to the Water Level of the Humidifier, I’d like to be able to use that Depth/Water Level in a homebridge plugin, but your current code doesn’t support the Depth property for Himidifiers. Any thoughts on this?

leoneleone avatar Mar 24 '18 18:03 leoneleone

I referenced temperature.js file and made depth file. I have tested on zhimi.humidifier.ca1.

This is a result. depth

fison67 avatar Mar 27 '18 08:03 fison67

@fison67 Thanks. So I assume depth=32 means the water tank is 32% full. Have you been able to confirm that depth property is indeed the water level percentage?

If so, please submit a pull request with the new depth.js file and references.

leoneleone avatar Mar 27 '18 11:03 leoneleone

@fison67

Can you please send a link to the files you modified. Your forked version of miio doesn’t show the depth capability.

Thanks

leoneleone avatar Mar 28 '18 09:03 leoneleone

@leoneleone yes

stkang avatar Mar 28 '18 11:03 stkang

@leoneleone

Max depth is 120. That's why value -> value / 1.2. I just modified files a moments ago.

I don't know this way is right but It's same value on the mi home app & miio.

https://github.com/fison67/miio/blob/master/lib/devices/humidifier.js https://github.com/fison67/abstract-things/blob/master/sensors/depth.js https://github.com/fison67/abstract-things/blob/master/sensors/index.js

fison67 avatar Mar 28 '18 13:03 fison67

@fison67 That’s great. Thank you so much.

What I’m still confused about is whether the “depth” capability is an actual indicator of Water Level. I don’t have the humidifier unit yet, waiting for it to be delivered.

The way you can confirm that “depth”=Water Level is:

  1. Fill the water tank/reservoir then check the “depth” readout.
  2. Empty the tank half way then check “depth” readout.
  3. Fully empty the tank then check “depth” readout.

If “depth” reading make a logical relationship with actual Water Level then it is indeed the correct capability for the Humidifier Water Sensor

leoneleone avatar Mar 28 '18 15:03 leoneleone

@leoneleone

Sorry actually I don't have a zhimi.humidifier.ca1. My friend test it.

This picture below is the MiHome app screen. 2018-03-29 1 24 15

fison67 avatar Mar 28 '18 16:03 fison67

@fison67

Thanks man. I feel confident "depth" refers to Water Level. Strange that full is 120 instead of 100 but I'm Xiaomi have their reasons.

Your code in the links above looks good to me. I'll add the Water Level sensor to https://github.com/acc-ua/homebridge-xiaomi-humidifier my original purpose for this was to add the WaterLevel Characteristic to the Humidifier in my HomeKit setup. Users of the plugin who want the WaterLevel in HomeKit will have to download your fork of miio to get it working, until you can submit your revisions to @aholstenson in a pull request. I'll have time to get this done tomorrow or over this weekend.

Thanks again man. Your work has been very useful 👍

leoneleone avatar Mar 29 '18 20:03 leoneleone

Anyone stepped into stuck depth level in zhimi.humidifier.ca1? I'm retrieving it in a loop with x = await device.depth(); like any other parameter (mode, temperature, etc.). But after 20~30 minutes it stops changing (other parameters are fine). If I restart my script it works again for some time.

manwe-pl avatar Nov 11 '19 15:11 manwe-pl

For zhimi.humidifier.cb1 depth seems to be almost the same, like water level shown on Xiaomi Home app.

galubap avatar Nov 29 '20 23:11 galubap