Thomas55555 / husqvarna_automower

Custom component for Home Assistant to monitor and control your Husqvarna Automower
https://github.com/Thomas55555/husqvarna_automower
MIT License
105 stars 28 forks source link

Getting an error in coordinator.data in HomeAssistantOS - new installation #8

Closed nsolvepaul closed 3 years ago

nsolvepaul commented 3 years ago

I believe I have followed the installation instructions but am getting this error in the logviewer:

File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 198, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/husqvarna_automower/vacuum.py", line 43, in async_setup_entry for idx, ent in enumerate(coordinator.data["data"]) KeyError: 'data'

Any tips please

Thomas55555 commented 3 years ago

Hi, can you please tell me the version of the integration, that your are using, and also the home assistant version? And for more information, can you enable the debug logging for the integration in your configuration.yaml?

logger:
  default: warning
  logs:
    custom_components.husqvarna_automower: debug
    custom_components.husqvarna_automower.vacuum: debug
    custom_components.husqvarna_automower.config_flow: debug
nsolvepaul commented 3 years ago

`Thanks for the reply @Thomas55555

System Health

version core-2021.2.3
installation_type Home Assistant OS
dev false
hassio true
docker true
virtualenv false
python_version 3.8.7
os_name Linux
os_version 5.4.83-v7l
arch armv7l
timezone Europe/London
Home Assistant Community Store GitHub API | ok -- | -- Github API Calls Remaining | 4928 Installed Version | 1.11.3 Stage | running Available Repositories | 749 Installed Repositories | 2
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 5.12 -- | -- update_channel | stable supervisor_version | supervisor-2021.02.11 docker_version | 19.03.13 disk_total | 28.6 GB disk_used | 4.0 GB healthy | true supported | true board | rpi4 supervisor_api | ok version_api | ok installed_addons | Mosquitto broker (5.1.1), File editor (5.2.0), Samba share (9.3.1), Terminal & SSH (9.0.2), Log Viewer (0.9.1), ESPHome (1.16.2)
Lovelace dashboards | 1 -- | -- resources | 0 mode | auto-gen

With logging:

2021-02-26 06:57:06 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for husqvarna_automower which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant. 2021-02-26 06:57:06 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for miele which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant. 2021-02-26 06:57:06 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant. 2021-02-26 06:57:12 INFO (MainThread) [custom_components.husqvarna_automower]

husqvarna_automower Version: 2021.2.1 This is a custom integration! If you have any issues with this you need to open an issue here: https://github.com/Thomas55555/husqvarna_automower

2021-02-26 06:57:12 INFO (MainThread) [custom_components.husqvarna_automower] Inizialising UpdateCoordiantor 2021-02-26 06:57:12 INFO (MainThread) [custom_components.husqvarna_automower] Updating data 2021-02-26 06:57:12 INFO (MainThread) [custom_components.husqvarna_automower] Getting new token, because Null oder expired 2021-02-26 06:57:16 INFO (MainThread) [custom_components.husqvarna_automower] {'access_token': 'eyJhbGciOi.....LbQLQ', 'scope': 'iam:read', 'expires_in': 86399, 'refresh_token': 'ee25....1d35', 'provider': 'husqvarna', 'user_id': 'f846....c59c', 'token_type': 'Bearer'} 2021-02-26 06:57:16 INFO (MainThread) [custom_components.husqvarna_automower] Token expires at 1614409035.087819 UTC 2021-02-26 06:57:16 DEBUG (MainThread) [custom_components.husqvarna_automower] Finished fetching husqvarna_automower data in 4.178 seconds 2021-02-26 06:57:16 ERROR (MainThread) [homeassistant.components.vacuum] Error while setting up husqvarna_automower platform for vacuum Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 198, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/husqvarna_automower/vacuum.py", line 43, in async_setup_entry for idx, ent in enumerate(coordinator.data["data"]) KeyError: 'data'`

Thomas55555 commented 3 years ago

I could reproduce the error. You probably only have connected to the Authentication API and not to the Automower Connect API. See step 5 of the instructions. Please connect to the Automower API on the Husqvarna website and then it should work.

grafik

nsolvepaul commented 3 years ago

Thank you that was indeed the issue, completely missed it sorry