ha0y / xiaomi_miot_raw

All-in-one & Easy-to-use. Integrate all your Xiaomi Smart Home - with a single integration and NO YAML files - into Home Assistant.
Apache License 2.0
2.18k stars 231 forks source link

Support viomi.waterheater.e1 #157

Open slydiman opened 3 years ago

slydiman commented 3 years ago

The water heater viomi.waterheater.e1 has the following mapping

{
  "water_heater": {
    "target_temperature": {
      "siid": 2,
      "piid": 1
    },
    "temperature": {
      "siid": 2,
      "piid": 2
    },
    "status": {
      "siid": 2,
      "piid": 3
    },
    "switch_status": {
      "siid": 2,
      "piid": 4
    },
    "water_level": {
      "siid": 2,
      "piid": 5
    },
    "mode": {
      "siid": 2,
      "piid": 6
    }
  }
}

and the following params

{
  "water_heater": {
    "switch_status": {
      "power_on": true,
      "power_off": false
    },
    "mode": {
      "Normal": 0,
      "Heat": 1,
      "Delay": 2
    },
    "target_temperature": { "value_range": [ 30, 75, 1 ] },
    "status": {
      "Off": 0,
      "Heating": 1,
      "Keep Warm": 2
    },
    "temperature": {
      "access": 4,
      "format": "uint8",
      "unit": "celsius",
      "value_range": [ 0, 255, 1 ]
    },
    "water_level": {
      "access": 4,
      "format": "uint8",
      "unit": "percentage",
      "value_range": [ 0, 100, 1 ]
    },
    "main": true
  }
}

But the resulting object is only water_heater with combined operation_list:

I tried to select additionally switch and sensor, but I got only 1 water_heater object. It would be great to have few objects:

It seems the access permission to the current temperature is notify, not read. Hope it is possible to handle it somehow.

Thanks

ha0y commented 3 years ago

The on/off is combined with operation_list because the is no switch in water_heater entity. But it is a good idea to generate a switch for it programmatically.

Currently we can not handle notify because it is send directly to Xiaomi cloud.