Andre0512 / hon

Home Assistant integration for Haier hOn: support for Haier/Candy/Hoover home appliances like washing machines and air conditioners in 28 languages.
MIT License
1.29k stars 2.47k forks source link

Fails to setup new device #31

Closed folieamatt closed 1 year ago

folieamatt commented 1 year ago

Error below:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/hon/__init__.py", line 31, in async_setup_entry
    hon = await Hon(
  File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 41, in create
    await self.setup()
  File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 67, in setup
    await self._create_appliance(appliance)
  File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 52, in _create_appliance
    await asyncio.gather(
  File "/usr/local/lib/python3.10/site-packages/pyhon/appliance.py", line 139, in load_commands
    raw = await self._api.load_commands(self)
  File "/usr/local/lib/python3.10/site-packages/pyhon/connection/api.py", line 77, in load_commands
    "firmwareId": appliance.info["eepromId"],
KeyError: 'eepromId'

Device is a Hoover HLE C10DCE-80 Tumble Dryer and I'm using version 0.6.1.

Londonlad95 commented 1 year ago

I have the same issue, using a candy ROE H10A2TCE-80

Andre0512 commented 1 year ago

Hi, thanks for reporting. I made the firmware id optional in version v0.7.0-beta.2, maybe this solves it already, otherwise we have to test a bit more. Can you try the new beta?

Londonlad95 commented 1 year ago

No change for me. Same issue. 😔

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/hon/init.py", line 31, in async_setup_entry hon = await Hon( File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 41, in create await self.setup() File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 67, in setup await self._create_appliance(appliance) File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 52, in _create_appliance await asyncio.gather( File "/usr/local/lib/python3.10/site-packages/pyhon/appliance.py", line 139, in load_commands raw = await self._api.load_commands(self) File "/usr/local/lib/python3.10/site-packages/pyhon/connection/api.py", line 78, in load_commands "fwVersion": appliance.info["fwVersion"], KeyError: 'fwVersion'

Andre0512 commented 1 year ago

Okay interesting, can you provide me a log of your appliance data? see Read out device data

folieamatt commented 1 year ago

I get the same:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/hon/__init__.py", line 31, in async_setup_entry
    hon = await Hon(
  File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 41, in create
    await self.setup()
  File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 67, in setup
    await self._create_appliance(appliance)
  File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 52, in _create_appliance
    await asyncio.gather(
  File "/usr/local/lib/python3.10/site-packages/pyhon/appliance.py", line 139, in load_commands
    raw = await self._api.load_commands(self)
  File "/usr/local/lib/python3.10/site-packages/pyhon/connection/api.py", line 78, in load_commands
    "fwVersion": appliance.info["fwVersion"],
KeyError: 'fwVersion'

Looks to me like you'll also need to make fwVersion optional.

I am not need my PC at the moment to get the appliance data.

Andre0512 commented 1 year ago

Oh right, this couldn't work :facepalm: Okay I made fwVersion optional in the latest beta, let's if that's all :slightly_smiling_face:

folieamatt commented 1 year ago

OK, so this has now progressed a little further. New traceback below:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/hon/__init__.py", line 31, in async_setup_entry
    hon = await Hon(
  File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 41, in create
    await self.setup()
  File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 67, in setup
    await self._create_appliance(appliance)
  File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 52, in _create_appliance
    await asyncio.gather(
  File "/usr/local/lib/python3.10/site-packages/pyhon/appliance.py", line 186, in load_attributes
    for name, values in self._attributes.pop("shadow").get("parameters").items():
KeyError: 'shadow'
Andre0512 commented 1 year ago

New beta :smiley: I added a warning log to see the returned attributes and made the shadow data optional, I think it couldn't really work without these data, but let's see.

folieamatt commented 1 year ago

So the dict it spits out in the log is below (note that I redacted the Mac address):

Logger: pyhon.appliance
Source: runner.py:179
First occurred: 19:25:50 (4 occurrences)
Last logged: 19:27:25

{'resultCode': '0', 'shadow': {'parameters': {'drySynthMax': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'dryLevel': {'parNewVal': '3', 'lastUpdate': '2023-04-22T13:51:44Z'}, 'program21t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program5t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program1t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'dryCotton120': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'tumblingStatus': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'drySynthStore': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'machMode': {'parNewVal': '0', 'lastUpdate': '2023-04-22T16:44:03Z'}, 'checkUpStatus': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'errors': {'parNewVal': '00', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'remoteCtrValid': {'parNewVal': '0', 'lastUpdate': '2023-04-22T16:44:03Z'}, 'program13t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'dryCottonHang': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'anticrease': {'parNewVal': '0', 'lastUpdate': '2023-04-22T13:51:44Z'}, 'doorStatus': {'parNewVal': '1', 'lastUpdate': '2023-04-22T16:44:07Z'}, 'program17t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'hybrid': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'remainingTimeMM': {'parNewVal': '0', 'lastUpdate': '2023-04-22T16:40:44Z'}, 'opt5': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'dryingManager': {'parNewVal': '0', 'lastUpdate': '2023-04-22T13:51:44Z'}, 'bestIroning': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'opt8': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'opt6': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program10t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'opt7': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program4': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program3': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program6t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program6': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'drySynthHang': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program5': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program8': {'parNewVal': '5', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program7': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program2t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program9': {'parNewVal': '3', 'lastUpdate': '2023-04-22T16:40:44Z'}, 'dryCottonStore': {'parNewVal': '3', 'lastUpdate': '2023-04-22T16:40:44Z'}, 'dryCotton60': {'parNewVal': '5', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'drySynth120': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program2': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program1': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'dryCottonMax': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'prCode': {'parNewVal': '0', 'lastUpdate': '2023-04-22T16:40:44Z'}, 'program14t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program18t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program19': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'dryCottonBone': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'dryCotton180': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program18': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program17': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'prPhase': {'parNewVal': '0', 'lastUpdate': '2023-04-22T16:40:44Z'}, 'program16': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program11t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'dryCottonIron': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program11': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program10': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program7t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program15': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program14': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program13': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'waterTankStatus': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program12': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program3t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'dryFilterStatus': {'parNewVal': '0', 'lastUpdate': '2023-04-22T16:44:03Z'}, 'program8t': {'parNewVal': '33', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'dryLevelMgmt': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program15t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program19t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'delayTime': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'dryTime': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'prPosition': {'parNewVal': '1', 'lastUpdate': '2023-04-22T16:40:44Z'}, 'program12t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program20t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program4t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program21': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program20': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'drySynth60': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program9t': {'parNewVal': '169', 'lastUpdate': '2023-04-22T16:40:44Z'}, 'drySynthIron': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'drySynth180': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'program16t': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}, 'drySynthBone': {'parNewVal': '0', 'lastUpdate': '2022-10-23T17:26:20Z'}}}, 'activity': {}, 'commandHistory': {'command': {'macAddress': 'de-ad-be-ef-12-34', 'commandName': 'startProgram', 'applianceOptions': {'opt1': 'anticrease', 'opt2': 'dryingManager', 'opt3': 'bestIroning', 'opt4': 'hybrid'}, 'programName': 'PROGRAMS.TD.ALL_IN_ONE', 'ancillaryParameters': {'remoteActionable': '1', 'functionalId': '25', 'remoteVisible': '1', 'suggestedLoadD': '6', 'energyLabel': '0', 'programFamily': '[dashboard|auto]', 'programRules': {'opt3': {'dryLevel': {'2|3|4': {'fixedValue': '0', 'typology': 'fixed'}}}, 'dryTime': {'dryTimeMM': {'30': {'fixedValue': '1', 'typology': 'fixed'}, '45': {'fixedValue': '2', 'typology': 'fixed'}, '59': {'fixedValue': '3', 'typology': 'fixed'}, '70': {'fixedValue': '4', 'typology': 'fixed'}, '80': {'fixedValue': '5', 'typology': 'fixed'}, '90': {'fixedValue': '6', 'typology': 'fixed'}, '100': {'fixedValue': '7', 'typology': 'fixed'}, '110': {'fixedValue': '8', 'typology': 'fixed'}, '120': {'fixedValue': '9', 'typology': 'fixed'}, '130': {'fixedValue': '10', 'typology': 'fixed'}, '140': {'fixedValue': '11', 'typology': 'fixed'}, '150': {'fixedValue': '12', 'typology': 'fixed'}, '160': {'fixedValue': '13', 'typology': 'fixed'}, '170': {'fixedValue': '14', 'typology': 'fixed'}, '180': {'fixedValue': '15', 'typology': 'fixed'}, '190': {'fixedValue': '16', 'typology': 'fixed'}, '200': {'fixedValue': '17', 'typology': 'fixed'}, '210': {'fixedValue': '18', 'typology': 'fixed'}, '220': {'fixedValue': '19', 'typology': 'fixed'}}}, 'dryLevel': {'opt3': {'1': {'fixedValue': '1', 'typology': 'fixed'}}}}}, 'applianceType': 'TD', 'attributes': {'prStr': 'All in One', 'channel': 'mobileApp', 'energyLabel': '0', 'origin': 'standardProgram'}, 'device': {'appVersion': '1.54.9', 'deviceModel': 'raven', 'osVersion': '33', 'mobileId': 'redacted', 'mobileOs': 'android'}, 'parameters': {'dryingManager': '0', 'hybrid': '0', 'checkUpStatus': '0', 'anticrease': '0', 'delayTime': '0', 'prCode': '33', 'prPosition': '9', 'dryLevel': '3', 'bestIroning': '0', 'onOffStatus': '1'}, 'transactionId': 'de-ad-be-ef-12-34_2023-04-22T13:51:43.169Z', 'timestamp': '2023-04-22T13:51:43.169Z'}, 'timestampAccepted': '2023-04-22T13:51:43.7Z', 'timestampExecuted': '2023-04-22T13:51:43.7Z'}, 'lastConnEvent': {'macAddress': 'de-ad-be-ef-12-34', 'category': 'DISCONNECTED', 'instantTime': '2023-04-22T16:44:52Z', 'timestampEvent': 1682181892269}}
{}

The traceback then spits out:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/hon/__init__.py", line 31, in async_setup_entry
    hon = await Hon(
  File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 41, in create
    await self.setup()
  File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 67, in setup
    await self._create_appliance(appliance)
  File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 52, in _create_appliance
    await asyncio.gather(
  File "/usr/local/lib/python3.10/site-packages/pyhon/appliance.py", line 144, in load_commands
    self._appliance_model = raw.pop("applianceModel")
KeyError: 'applianceModel'
Londonlad95 commented 1 year ago

Yea I have the same error:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/hon/init.py", line 31, in async_setup_entry hon = await Hon( File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 41, in create await self.setup() File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 67, in setup await self._create_appliance(appliance) File "/usr/local/lib/python3.10/site-packages/pyhon/hon.py", line 52, in _create_appliance await asyncio.gather( File "/usr/local/lib/python3.10/site-packages/pyhon/appliance.py", line 144, in load_commands self._appliance_model = raw.pop("applianceModel") KeyError: 'applianceModel'

Andre0512 commented 1 year ago

It would be easiest if one of you could give me your account data (change password before and after, appliances can be turned off) so I can debug this error better. Send me a mail if that's ok with you.

AaronIsFab commented 1 year ago

Same issue, have mailed details over to allow debug. nde h10a2tce was working prior.

Andre0512 commented 1 year ago

Thanks @AaronIsFab, that was helpful! I could find the issue, it was the virtual wine cellar... And I could find some more issues with your hoover appliance. Try the new beta, you can find some more configs now :slightly_smiling_face: Don't forget to change your password :wink:

folieamatt commented 1 year ago

I can confirm that it's now working. Thanks @Andre0512 😊