Refrigerator HFW7819EWMP compatibility #93

Closed
opened 2023-07-15 16:33:55 +02:00 by gabrielgo-ctf · 1 comment
gabrielgo-ctf commented 2023-07-15 16:33:55 +02:00 (Migrated from github.com)

Hello, I have a Haier refrigerator (model HFW7819EWMP) and I have connected it to my Home assistant with your component. I have found some problems during the procces but I have fixed it modifying your code (but not maintaining the compatibility with old models). I write you to help to add compatibility with this kind of refrigerators, for sure it will be usefull to more people, and being selfish, for me is great if you add compatibility and I can update without patching my changes every time :)

I have prepared an image to help to understand the changes: imagen

Now i will explain you all the changes that I had to do:

  1. This model doesn’t have quickModeZ1 so I had an error in the core “pyhon”. I fixed it commenting in ref.py the “elif” where it checks this property. This is the log of the error in HA: imagen It was needed to be able to show the device info and to create the data archive

  2. In files binary_sensor.py and switch.py quickModeZ1 is “Super Freeze” mode and “quickModeZ2” is “Super Cool” Mode. For sure it is an error and they are swaped in these files (in ref.py they are correct). So I have fixed it in both files:

HonBinarySensorEntityDescription(
     key="quickModeZ1",
     name="Super Cool",
     icon="mdi:snowflake",
     device_class=BinarySensorDeviceClass.RUNNING,
     on_value=1,
     translation_key="super_cool",
 ),
HonBinarySensorEntityDescription(
     key="quickModeZ2",
     name="Super Freeze",
     icon="mdi:snowflake-variant",
     device_class=BinarySensorDeviceClass.RUNNING,
     on_value=1,
     translation_key="super_freeze",
 )
HonSwitchEntityDescription(
    key="quickModeZ2",
    name="Super Freeze",
    icon="mdi:snowflake-variant",
    translation_key="super_freeze",
),
HonSwitchEntityDescription(
    key="**quickModeZ1**",
    name="Super Cool",
    icon="mdi:snowflake",
    translation_key="super_cool",
),
  1. This model has more doors and with diferent meaning that you had in the component. In your code you had this imagen In this model it is: imagen So I adapted the binary_sensor.py file:
HonBinarySensorEntityDescription(
    key="doorStatusZ1",
    name="Door1 Status Fridge",
    device_class=BinarySensorDeviceClass.DOOR,
    icon="mdi:fridge-top",
    on_value=1,
    translation_key="fridge_door",
),
HonBinarySensorEntityDescription(
    key="door2StatusZ1",
    name="Door2 Status Fridge",
    icon="mdi:fridge-top",
    device_class=BinarySensorDeviceClass.DOOR,
    on_value=1,
    translation_key="fridge_door",
),
HonBinarySensorEntityDescription(
    key="doorStatusZ2",
    name="Door1 Status Freezer",
    icon="mdi:fridge-bottom",
    device_class=BinarySensorDeviceClass.DOOR,
    on_value=1,
    translation_key="freezer_door",
),
HonBinarySensorEntityDescription(
    key="door2StatusZ2",
    name="Door2 Status Freezer",
    icon="mdi:fridge-bottom",
    device_class=BinarySensorDeviceClass.DOOR,
    on_value=1,
    translation_key="freezer_door",
),
  1. This model has a new sensor with the Humidity of one box of the fridge. I added it… sensor.py
HonSensorEntityDescription(
    key="humidityLevel",
    name="Humidity Level",
    icon="mdi:water-outline",
    device_class=SensorDeviceClass.ENUM,
    translation_key="humidity_level",
    option_list=const.REF_HUMIDITY_LEVELS,
),

const.py

REF_HUMIDITY_LEVELS = {
    1: "Low",
    2: "Mid",
    3: "High"
}

en.json

"humidity_level": {
       "name": "Humidity Level"
},

es.json

 “humidity_level": {
       "name": "Nivel de Humedad"
  },

I attach the files modified by my (only the “hon” component files, not the ref.py of pyhon) and the ref_581.zip with the data extracted by the plugin. files_patched.zip ref_571.zip

Hello, I have a Haier refrigerator (model **HFW7819EWMP**) and I have connected it to my Home assistant with your component. I have found some problems during the procces but I have fixed it modifying your code (but not maintaining the compatibility with old models). I write you to help to add compatibility with this kind of refrigerators, for sure it will be usefull to more people, and being selfish, for me is great if you add compatibility and I can update without patching my changes every time :) I have prepared an image to help to understand the changes: ![imagen](https://github.com/Andre0512/hon/assets/39603784/da1dae1c-0539-42e0-b353-613360f44027) Now i will explain you all the changes that I had to do: 0. **This model doesn’t have quickModeZ1** so I had an error in the core “pyhon”. I fixed it commenting in ref.py the “elif” where it checks this property. This is the log of the error in HA: ![imagen](https://github.com/Andre0512/hon/assets/39603784/38cf6071-1dad-41e8-bc95-34984d2d5aff) It was needed to be able to show the device info and to create the data archive 1. In files binary_sensor.py and switch.py quickModeZ1 is “Super Freeze” mode and “quickModeZ2” is “Super Cool” Mode. For sure it is an error and they are swaped in these files (in ref.py they are correct). So I have fixed it in both files: ``` HonBinarySensorEntityDescription( key="quickModeZ1", name="Super Cool", icon="mdi:snowflake", device_class=BinarySensorDeviceClass.RUNNING, on_value=1, translation_key="super_cool", ), HonBinarySensorEntityDescription( key="quickModeZ2", name="Super Freeze", icon="mdi:snowflake-variant", device_class=BinarySensorDeviceClass.RUNNING, on_value=1, translation_key="super_freeze", ) ``` ``` HonSwitchEntityDescription( key="quickModeZ2", name="Super Freeze", icon="mdi:snowflake-variant", translation_key="super_freeze", ), HonSwitchEntityDescription( key="**quickModeZ1**", name="Super Cool", icon="mdi:snowflake", translation_key="super_cool", ), ``` 2. This model has more doors and with diferent meaning that you had in the component. In your code you had this ![imagen](https://github.com/Andre0512/hon/assets/39603784/030fc9c6-115f-495b-a8eb-e637fad66745) In this model it is: ![imagen](https://github.com/Andre0512/hon/assets/39603784/620811cb-27a6-46e6-9084-159784061c78) So I adapted the binary_sensor.py file: ``` HonBinarySensorEntityDescription( key="doorStatusZ1", name="Door1 Status Fridge", device_class=BinarySensorDeviceClass.DOOR, icon="mdi:fridge-top", on_value=1, translation_key="fridge_door", ), HonBinarySensorEntityDescription( key="door2StatusZ1", name="Door2 Status Fridge", icon="mdi:fridge-top", device_class=BinarySensorDeviceClass.DOOR, on_value=1, translation_key="fridge_door", ), HonBinarySensorEntityDescription( key="doorStatusZ2", name="Door1 Status Freezer", icon="mdi:fridge-bottom", device_class=BinarySensorDeviceClass.DOOR, on_value=1, translation_key="freezer_door", ), HonBinarySensorEntityDescription( key="door2StatusZ2", name="Door2 Status Freezer", icon="mdi:fridge-bottom", device_class=BinarySensorDeviceClass.DOOR, on_value=1, translation_key="freezer_door", ), ``` 3. This model has a new sensor with the Humidity of one box of the fridge. I added it… sensor.py ``` HonSensorEntityDescription( key="humidityLevel", name="Humidity Level", icon="mdi:water-outline", device_class=SensorDeviceClass.ENUM, translation_key="humidity_level", option_list=const.REF_HUMIDITY_LEVELS, ), ``` const.py ``` REF_HUMIDITY_LEVELS = { 1: "Low", 2: "Mid", 3: "High" } ``` en.json ``` "humidity_level": { "name": "Humidity Level" }, ``` es.json ``` “humidity_level": { "name": "Nivel de Humedad" }, ``` I attach the files modified by my (only the "hon" component files, not the ref.py of pyhon) and the **ref_581.zip** with the data extracted by the plugin. [files_patched.zip](https://github.com/Andre0512/hon/files/12061839/files_patched.zip) [ref_571.zip](https://github.com/Andre0512/hon/files/12061823/ref_571.zip)
Andre0512 commented 2023-07-20 00:10:18 +02:00 (Migrated from github.com)

Hi, thanks for your work and your good descriptions! I have added it now 🙂

Hi, thanks for your work and your good descriptions! I have added it now :slightly_smiling_face:
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: GitHub/hon#93
No description provided.