hacc-ozmo icon indicating copy to clipboard operation
hacc-ozmo copied to clipboard

Error on custom_component init

Open hanunes opened this issue 3 years ago • 3 comments

After installing the integration and restarting HA, I get the following error

2021-11-17 11:34:24 ERROR (MainThread) [homeassistant.setup] Error during setup of component deebot Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 254, in _async_setup_component result = await task File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/deebot_hacc/init.py", line 107, in setup device["nick"], KeyError: 'nick'

After some troubleshooting, I found out that the API is sending some different info: 2021-11-17 11:38:04 DEBUG (SyncWorker_0) [custom_components.deebot_hacc] Ecobot devices: [{'did': 'd59caf2e-9c7b-417e-b26f-2be320e6e117', 'name': 'E0001249918610430728', 'class': 'ls1ok3', 'resource': '3WFH', 'nick': None, 'company': 'eco-ng', 'bindTs': 1582317532533, 'service': {'jmq': 'jmq-ngiot-eu.dc.ww.ecouser.net', 'mqs': 'api-ngiot.dc-as.ww.ecouser.net'}, 'iotmq': True}, {'did': 'E0001161418600772095', 'name': 'E0001161418600772095', 'class': '155', 'resource': 'atom', 'company': 'eco-legacy', 'iotmq': False}]

As you can see, there is no "nick" property on the JSON returned by the API, for any of the vaccums on my account.

To resolve this: In vacuum.py, line 60 and 61, change "nick" to "name" In init.py, line 107, change "nick" to "name"

After changing this, restart HA, all vacuums should be visible.

hanunes avatar Nov 17 '21 11:11 hanunes

Thank you for this, fixed it for me.

livefeed avatar Dec 14 '21 01:12 livefeed

same here. helped to stop the nick error 😄 but still the device status is "error", yet this is the furthest i got with my 930 deebot

JohannesKie avatar Dec 31 '21 01:12 JohannesKie

Thanks for this. i also had to change: init.py LINE 107 from "nick" to "name" and got it to work for my N79!

Jizzay1 avatar Apr 04 '22 23:04 Jizzay1