Skip to content

Exception for Haier freezer H4F306WCH1 #36

@wischi-chr

Description

@wischi-chr

First, thank you for your awesome script/library.

A friend of mine has a H4F306WCH1 haier freezer and running pyhOn on the command line (given user/password with -u and -p) yields the exception blow. Would be great if anybody has a hint what the issue might be and how I could solve it.

The end-goal would be to use pyhOn directly as a library (without HomeAssistant or something) in a small python program to get the freezer temperature (if possible including the timestamp when that value was measured).

Traceback (most recent call last):
  File "/usr/local/bin/pyhOn", line 8, in <module>
    sys.exit(start())
  File "/usr/local/lib/python3.10/site-packages/pyhon/__main__.py", line 107, in start
    asyncio.run(main())
  File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.10/site-packages/pyhon/__main__.py", line 75, in main
    async with Hon(*get_login_data(args), test_data_path=test_data_path) as hon:
  File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 41, in __aenter__
    return await self.create()
  File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 77, in create
    await self.setup()
  File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 111, in setup
    await self._create_appliance(appliance, self.api)
  File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 95, in _create_appliance
    await appliance.load_commands()
  File "/usr/local/lib/python3.10/site-packages/pyhon/appliance.py", line 190, in load_commands
    await command_loader.load_commands()
  File "/usr/local/lib/python3.10/site-packages/pyhon/command_loader.py", line 60, in load_commands
    self._get_commands()
  File "/usr/local/lib/python3.10/site-packages/pyhon/command_loader.py", line 101, in _get_commands
    if command := self._parse_command(data, name):
  File "/usr/local/lib/python3.10/site-packages/pyhon/command_loader.py", line 124, in _parse_command
    if category := self._parse_categories(data, command_name):
  File "/usr/local/lib/python3.10/site-packages/pyhon/command_loader.py", line 134, in _parse_categories
    if command := self._parse_command(
  File "/usr/local/lib/python3.10/site-packages/pyhon/command_loader.py", line 117, in _parse_command
    return HonCommand(
  File "/usr/local/lib/python3.10/site-packages/pyhon/commands.py", line 40, in __init__
    self._load_parameters(attributes)
  File "/usr/local/lib/python3.10/site-packages/pyhon/commands.py", line 98, in _load_parameters
    self._create_parameters(data, name, key)
  File "/usr/local/lib/python3.10/site-packages/pyhon/commands.py", line 109, in _create_parameters
    self._rules.append(HonRuleSet(self, data["fixedValue"]))
  File "/usr/local/lib/python3.10/site-packages/pyhon/rules.py", line 26, in __init__
    self._parse_rule(rule)
  File "/usr/local/lib/python3.10/site-packages/pyhon/rules.py", line 36, in _parse_rule
    self._parse_conditions(param_key, trigger_key, trigger_data)
  File "/usr/local/lib/python3.10/site-packages/pyhon/rules.py", line 58, in _parse_conditions
    self._parse_conditions(param_key, extra_key, extra_data, extra)
  File "/usr/local/lib/python3.10/site-packages/pyhon/rules.py", line 47, in _parse_conditions
    for multi_trigger_value, param_data in trigger_data.items():
AttributeError: 'int' object has no attribute 'items'
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x75b86bf0d2a0>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x75b86bf0d1e0>
Unclosed connector
connections: ['deque([(<aiohttp.client_proto.ResponseHandler object at 0x75b86c6d2e60>, 26754.622256893), (<aiohttp.client_proto.ResponseHandler object at 0x75b86bf46740>, 26754.648662482), (<aiohttp.client_proto.ResponseHandler object at 0x75b86bf45ea0>, 26754.658235185)])', 'deque([(<aiohttp.client_proto.ResponseHandler object at 0x75b86bf47b80>, 26755.441866952), (<aiohttp.client_proto.ResponseHandler object at 0x75b86bf47940>, 26755.540900706), (<aiohttp.client_proto.ResponseHandler object at 0x75b86bf45a20>, 26755.712729395)])']
connector: <aiohttp.connector.TCPConnector object at 0x75b86bf0d450>

I changed a few things in the script in the command_loader.py script to print some details

{
    "applianceModel": {
        "id": 14477,
        "name": "H4F306WCH1",
        "code": "B30MA3E0000",
        "applianceTypeId": 16,
        "applianceTypeName": "FRE",
        "brand": "haier",
        "connectivity": "wifi|ble",
        "attributes": [
            {
                "id": 92197,
                "parName": "plmCode",
                "parValue": "37001644",
                "status": 1,
                "lastUpdate": "2024-02-12T17:07:09Z"
            },
            {
                "id": 92205,
                "parName": "option",
                "parValue": "ecoMode|superFreeze",
                "status": 1,
                "lastUpdate": "2024-02-12T17:07:09Z"
            },
            {
                "id": 92213,
                "parName": "doorNumber",
                "parValue": "1",
                "status": 1,
                "lastUpdate": "2024-02-12T17:07:09Z"
            },
            {
                "id": 92229,
                "parName": "fwLabel",
                "parValue": "iotfw_epp",
                "status": 1,
                "lastUpdate": "2024-02-12T17:07:09Z"
            },
            {
                "id": 92237,
                "parName": "installationType",
                "parValue": "fs",
                "status": 1,
                "lastUpdate": "2024-02-12T17:07:09Z"
            },
            {
                "id": 92245,
                "parName": "interfaceType",
                "parValue": "series|seriesVersion|installationType|doorNumber",
                "status": 1,
                "lastUpdate": "2024-02-12T17:07:09Z"
            },
            {
                "id": 92253,
                "parName": "lowerBarrierDate",
                "parValue": "2402",
                "status": 1,
                "lastUpdate": "2024-02-12T17:07:09Z"
            },
            {
                "id": 92261,
                "parName": "sensor",
                "parValue": "doorAlarmFreezer",
                "status": 1,
                "lastUpdate": "2024-02-12T17:07:09Z"
            },
            {
                "id": 92269,
                "parName": "series",
                "parValue": "instaswitch",
                "status": 1,
                "lastUpdate": "2024-02-12T17:07:09Z"
            },
            {
                "id": 92277,
                "parName": "seriesVersion",
                "parValue": "up595Series1",
                "status": 1,
                "lastUpdate": "2024-02-12T17:07:09Z"
            },
            {
                "id": 92285,
                "parName": "serviceability",
                "parValue": "none",
                "status": 1,
                "lastUpdate": "2024-02-12T17:07:09Z"
            },
            {
                "id": 92293,
                "parName": "technology",
                "parValue": "tnf",
                "status": 1,
                "lastUpdate": "2024-02-12T17:07:09Z"
            }
        ],
        "options": {}
    },
    "settings": {
        "setParameters": {
            "description": "The message allows to change parameters values to enable/disable specific features ",
            "protocolType": "MQTT",
            "parameters": {
                "operationModeFreezing": {
                    "category": "command",
                    "typology": "range",
                    "mandatory": 0,
                    "defaultValue": "0",
                    "minimumValue": "0",
                    "maximumValue": "1",
                    "incrementValue": "1"
                },
                "operationModeRefrigerating": {
                    "category": "command",
                    "typology": "range",
                    "mandatory": 0,
                    "defaultValue": "0",
                    "minimumValue": "0",
                    "maximumValue": "1",
                    "incrementValue": "1"
                },
                "tempSelZ3": {
                    "category": "command",
                    "typology": "enum",
                    "mandatory": 0,
                    "enumValues": [
                        -24,
                        -23,
                        -22,
                        -21,
                        -20,
                        -19,
                        -18,
                        -17,
                        -16,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8
                    ]
                }
            },
            "ancillaryParameters": {
                "programRules": {
                    "category": "rule",
                    "typology": "fixed",
                    "mandatory": 0,
                    "fixedValue": {
                        "tempSelZ3": {
                            "@operationModeRefrigerating": {
                                "1": {
                                    "typology": "enum",
                                    "enumValues": "[2|3|4|5|6|7|8]",
                                    "defaultValue": 4
                                },
                                "default": {
                                    "typology": "enum",
                                    "enumValues": "[-24|-23|-22|-21|-20|-19|-18|-17|-16]",
                                    "defaultValue": -16
                                }
                            },
                            "operationModeRefrigerating": {
                                "1": {
                                    "defaultValue": 4
                                },
                                "default": {
                                    "defaultValue": -16
                                }
                            }
                        }
                    }
                }
            }
        },
        "setConfig": {
            "description": "The message allows to set platform parameters",
            "protocolType": "MQTT",
            "parameters": {
                "httpEndpoint": {
                    "category": "command",
                    "typology": "fixed",
                    "mandatory": 0
                },
                "mqttEndpoint": {
                    "category": "command",
                    "typology": "fixed",
                    "mandatory": 0
                }
            }
        }
    },
    "stopProgram": {
        "description": "The message allows to stop the program",
        "protocolType": "MQTT",
        "parameters": {
            "quickModeZ2": {
                "category": "command",
                "typology": "fixed",
                "mandatory": 1,
                "fixedValue": "0"
            }
        }
    },
    "startProgram": {
        "PROGRAMS.FRE.ECO_MODE": {
            "description": "The command allows to start a program",
            "protocolType": "MQTT",
            "parameters": {
                "energySavingStatus": {
                    "category": "command",
                    "typology": "fixed",
                    "mandatory": 1,
                    "fixedValue": "1"
                }
            },
            "ancillaryParameters": {
                "programFamily": {
                    "category": "cluster",
                    "typology": "enum",
                    "mandatory": 1,
                    "enumValues": [
                        "dashboard"
                    ],
                    "defaultValue": "[dashboard]"
                },
                "programRules": {
                    "category": "rule",
                    "typology": "fixed",
                    "mandatory": 0,
                    "fixedValue": {
                        "tempSelZ3": {
                            "@operationModeRefrigerating": {
                                "1": {
                                    "typology": "fixed",
                                    "enumValues": 8
                                },
                                "default": {
                                    "typology": "fixed",
                                    "enumValues": -16
                                }
                            }
                        }
                    }
                },
                "remoteActionable": {
                    "category": "general",
                    "typology": "fixed",
                    "mandatory": 0,
                    "fixedValue": "1"
                },
                "remoteVisible": {
                    "category": "general",
                    "typology": "fixed",
                    "mandatory": 0,
                    "fixedValue": "1"
                },
                "tempSelZ3": {
                    "category": "general",
                    "typology": "enum",
                    "mandatory": 1,
                    "enumValues": [
                        8,
                        -16
                    ]
                },
                "zone": {
                    "category": "cluster",
                    "typology": "enum",
                    "mandatory": 1,
                    "enumValues": [
                        "fridge",
                        "freezer"
                    ],
                    "defaultValue": "[fridge|freezer]"
                }
            }
        },
        "PROGRAMS.FRE.SUPER_FREEZE": {
            "description": "The command allows to start a program",
            "protocolType": "MQTT",
            "parameters": {
                "quickModeZ2": {
                    "category": "command",
                    "typology": "fixed",
                    "mandatory": 1,
                    "fixedValue": "1"
                }
            },
            "ancillaryParameters": {
                "programFamily": {
                    "category": "cluster",
                    "typology": "enum",
                    "mandatory": 1,
                    "enumValues": [
                        "dashboard"
                    ],
                    "defaultValue": "[dashboard]"
                },
                "programRules": {
                    "category": "rule",
                    "typology": "fixed",
                    "mandatory": 0,
                    "fixedValue": {
                        "remoteVisible": {
                            "@operationModeRefrigerating": {
                                "1": {
                                    "typology": "fixed",
                                    "fixedValue": "0"
                                }
                            }
                        },
                        "remoteActionable": {
                            "@operationModeRefrigerating": {
                                "1": {
                                    "typology": "fixed",
                                    "fixedValue": "0"
                                }
                            }
                        }
                    }
                },
                "remoteActionable": {
                    "category": "general",
                    "typology": "fixed",
                    "mandatory": 0,
                    "fixedValue": "1"
                },
                "remoteVisible": {
                    "category": "general",
                    "typology": "fixed",
                    "mandatory": 0,
                    "fixedValue": "1"
                },
                "zone": {
                    "category": "cluster",
                    "typology": "enum",
                    "mandatory": 1,
                    "enumValues": [
                        "freezer"
                    ],
                    "defaultValue": "[freezer]"
                }
            }
        }
    },
    "options": {},
    "dictionaryId": 412
}
========== FRE - H4F306WCH1 ==========
data:
  additional_data:
  appliance:
    PK: <removed>
    SK: <removed>
    applianceId: <removed>
    applianceModelId: 14477
    applianceStatus: 1
    applianceTypeId: 16
    applianceTypeName: FRE
    attributes:
      acuVersion: 0.0.0
      chipset: 1
      dictionaryId: 412
      eppParserSet: 1
      fwLabel: iotfw_epp
      idfVersion: 4.4.5
      kernelVersion: 10.4.3
      lang: it-IT
      uiVersion: 23.06.10
    brand: haier
    code: B30MA3E0000
    connectivity: wifi|ble
    coords:
      lat: <removed>
      lng: <removed>
    defaultWarrantyYears: 2
    eepromId: 41
    eepromName: no_eeprom
    enrollmentDate: <removed>
    firstEnrollment: True
    firstEnrollmentTBC: True
    fwVersion: 5.30.0
    id: 14477
    lastUpdate: <removed>
    macAddress: <removed>
    modelName: H4F306WCH1
    purchaseDate: <removed>
    sections:
      chatbot: True
      double_pairing_hidden: True
      food_locator: False
      inside_view: True
      my_profile_temperature: True
      proactive_temperature: True
      smart_check_up: True
      visual_tricks: True
    serialNumber: <removed>
    series: instaswitch
    seriesVersion: up595Series1
    sfPersonAccountId: <removed>
    topics:
      publish:
      subscribe:
        - $aws/events/presence/disconnected/<removed>
        - $aws/events/presence/connected/<removed>
        - haier/things/<removed>/event/appliancestatus/update
        - haier/things/<removed>/event/discovery/update
  attributes:
    activity:
    commandHistory: None
    lastConnEvent:
      category: CONNECTED
      instantTime: <removed>
      macAddress: <removed>
      timestampEvent: <removed>
    parameters:
      debugEnabled: 0
      doorStatusZ2: 0
      energySavingStatus: 0
      errors: 00
      highTransRate: 1
      operationModeFreezing: 1
      operationModeRefrigerating: 0
      quickModeZ2: 0
      statusSyncRate: 1440
      stdTransRate: 3600
      tempEnv: 20
      tempSelZ3: -24
      tempZ2: -24
      transMode: 0
    resultCode: 0
  statistics:
    mostUsedPrograms:
    mostUsedRecipes:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions