home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.11k stars 29.79k forks source link

Xiaomi Miio Air Humidifier CA1 missing 'depth' and 'water_level' sensors since HA upgrade to 2021.8.2 #54153

Closed Ton1965 closed 3 years ago

Ton1965 commented 3 years ago

The problem

Before the latest update Xiaomi Miio Air Humidifier CA1 had such attributes as: 'depth' and 'target_humidity'.

Both disappeared after the upgrade, they have even been removed from the documentation.

'depth' attribute is still available as sensor water_level but only for Air Humidifier CA4, not for CA1. This attribute (or sensor) was very important since it allowed to send notifications when water level was too small.

'target_humidity' attribute allowed to keep in sync the corresponding HA setting, like when it was possible to update HA user interface entry if this parameter was changed on humidifier itself.

Is it possible to bring both attributes back in any form?

What is version of Home Assistant Core has the issue?

2021.8.2 (probably 2021.8.0 as well)

What was the last working version of Home Assistant Core?

2021.7

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Xiaomi Miio

Link to integration documentation on our website

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

jbouwh commented 3 years ago

@bieniu Could you have a look at this issue?

jbouwh commented 3 years ago

The water level and other attributes like humidity have been replace by sensors. The use of attributes is deprecated now. The new sensors should be added to your entities.

bieniu commented 3 years ago

@Ton1965 The depth property for MIIO humidifiers has been marked as deprecated in the backend library. New properties water_level and water_tank_detached have been added but no one is able to release new version of the library (vacation time). When the new version of the library is available we will add these sensors to MIIO humidifiers. Thank you for your patience.

Enzokot commented 3 years ago

@bieniu and zhimi.humidifier.cb1? and sensor entity actual_speed?

bieniu commented 3 years ago

What exactly are you asking about?

Enzokot commented 3 years ago

@bieniu The water_level and actual_speed sensors for zhimi.humidifier.cb1 are also missing

bieniu commented 3 years ago

It's MIIO humidifier so for water_level you have to wait.

I think we missed that zhimi.humidifier.cb1 and zhimi.humidifier.ca1 support actual_speed. Tomorrow I will fix that.

to4ko commented 3 years ago

It's MIIO humidifier so for water_level you have to wait.

I think we missed that zhimi.humidifier.cb1 and zhimi.humidifier.ca1 support actual_speed. Tomorrow I will fix that.

Same humidifier were reportint depth/water level. Was it some different miio in the past?

bieniu commented 3 years ago

Same humidifier were reportint depth/water level. Was it some different miio in the past?

It's reporting depth, not water_level. The depth property is deprecated, we have to wait for python-miio release to add water_level sensor.

Enzokot commented 3 years ago

The model attribute for zhimi.humidifier.cb1, zhimi.humidifier.ca4 and zhimi.humidifier.ca1 are also missing

bieniu commented 3 years ago

Static data like model shouldn't be stored as an attribute.

Enzokot commented 3 years ago

Is it possible to get the model info?

bieniu commented 3 years ago

Of course

image

Enzokot commented 3 years ago

Same names of modes also need wait for python-miio release? image

bieniu commented 3 years ago

Integration uses the mode names from the device. I don't know why Xiaomi uses different mode names in different devices.

Enzokot commented 3 years ago

May be any standard for naming in Home Assistant integration layer?

jbouwh commented 3 years ago

Same names of modes also need wait for python-miio release? image

ca4 is a MIOT device and uses different code in the backend. I am surprised to see a humidity attribute for cb1, since there is a sensor now.

bieniu commented 3 years ago

@jbouwh The humidity attribute of the humidifier entity is a target humidity.

Enzokot commented 3 years ago

For cb4 target humidity are missing

bieniu commented 3 years ago

Please report non-water level problems in a separate issue.

probot-home-assistant[bot] commented 3 years ago

Hey there @rytilahti, @syssi, @starkillerog, mind taking a look at this issue as it has been labeled with an integration (xiaomi_miio) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)


xiaomi_miio documentation xiaomi_miio source (message by IssueLinks)

Ton1965 commented 3 years ago

@Ton1965 The depth property for MIIO humidifiers has been marked as deprecated in the backend library.

Thanks a lot for your prompt answer. I believe we cannot do anything but wait :-)

bieniu commented 3 years ago

I believe we cannot do anything but wait :-)

Exactly 😀

barskaka commented 3 years ago

@bieniu Hello! Sorry for my English. I have humidifier CA1 and i need parameter depth for my automations. I take sensor.py file in Xiaomi_miio component and add some lines. Now i have a depth parametr and it works fine, but this is not convenient because I have to put this in custom_component. Please add this parameter, very much needed.

    ATTR_DEPTH: XiaomiMiioSensorDescription(
        key=ATTR_DEPTH,
        name="Depth",
        unit_of_measurement=PERCENTAGE,
        icon="mdi:water-check",
        state_class=STATE_CLASS_MEASUREMENT,
        valid_min_value=0.0,
        valid_max_value=125.0,
    ),
artem-sedykh commented 3 years ago

For zhimi.humidifier.cb1 depth to water_level converter example:

key: "_getPercentWaterDepth",
value: function _getPercentWaterDepth(value) {
if (value > 120) {
  if (value === 127) return "--";
  value = 120;
} else if (value === -1) value = 0;

var x = value / 120 * 100;
return parseInt(x);
}

this is the humidifier plugin code from the app mi home

value 127 means that the cover of the humidifier is removed

OleksandrBerchenko commented 3 years ago

Is the fix going to be included in a patch? 2021.8.7 doesn't include it yet.

Thanks!

MartinHjelmare commented 3 years ago

It'll go out in core-2021.9.0.