nordicopen / easee_hass

Custom component for Easee EV charger integration with Home Assistant
209 stars 34 forks source link

Not able to log in #145

Closed SVH-Powel closed 2 years ago

SVH-Powel commented 2 years ago

I installed 0.9.34 this morning and found out it would not start. There was a error message about not able to log in. It was also not possible to configure the integration. So I deleted it and tried to install it new and fresh, but was not able to log in. I then installed the previous version, 0.9.33 and everything went smooth. Log in worked and configuring the integration worked as expected.

astrandb commented 2 years ago

@SVH-Powel What version of HA are you using? Anything relevant in HA log?

SVH-Powel commented 2 years ago

2021.9.7

No, nothing relevant in the log.

astrandb commented 2 years ago

We haven't seen this problem here. It would be helpful if you could assist in debugging by sending us logs. Please enable full debug log of the integration by entering following in configuration.yaml, restart homeassistant and repeat the failing procedure.

logger:
  default: warning
  logs:
    custom_components.easee: debug
    pyeasee: debug
SVH-Powel commented 2 years ago

I was able to solve it. But as said, this was not a problem with the previous version.

`2021-10-04 12:06:34 DEBUG (MainThread) [pyeasee.easee] getting token for user: xxxxx@yyyyy 2021-10-04 12:06:37 ERROR (MainThread) [pyeasee.easee] Bad request service (400: {'errorCode': 727, 'errorCodeName': 'EmailNotVerified', 'type': None, 'title': 'Email address not verified', 'status': 400, 'detail': '[Empty in production]', 'instance': None, 'extensions': {}} https://api.easee.cloud/api/accounts/login) 2021-10-04 12:06:37 ERROR (MainThread) [custom_components.easee.controller] Authorization failed to easee 2021-10-04 12:06:37 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry xxxxx@yyyyy for easee Traceback (most recent call last): File "/config/custom_components/easee/controller.py", line 245, in initialize await self.easee.connect() File "/usr/local/lib/python3.9/site-packages/pyeasee/easee.py", line 185, in connect await raise_for_status(response) File "/usr/local/lib/python3.9/site-packages/pyeasee/easee.py", line 49, in raise_for_status raise AuthorizationFailedException(data) pyeasee.exceptions.AuthorizationFailedException: {'errorCode': 727, 'errorCodeName': 'EmailNotVerified', 'type': None, 'title': 'Email address not verified', 'status': 400, 'detail': '[Empty in production]', 'instance': None, 'extensions': {}}

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 304, in async_setup result = await component.async_setup_entry(hass, self) # type: ignore File "/config/custom_components/easee/init.py", line 34, in async_setup_entry await controller.initialize() File "/config/custom_components/easee/controller.py", line 257, in initialize raise Unauthorized from err homeassistant.exceptions.Unauthorized: Unauthorized`

astrandb commented 2 years ago

OK, we have changed the logic of how errors are logged. The main reason is that the Easee cloud server spits out errors or warnings from time to time and they tend to clutter the logs. However, this particular authentication error could be explained further in the log. We will look into it.