tomeko12 / pyelectroluxconnect

A python module to communicate with Elecrolux Connectivity Platform
Apache License 2.0
25 stars 9 forks source link

Invalid API response: There is no access for user who is different from the session #16

Closed Veldkornet closed 1 year ago

Veldkornet commented 1 year ago

I’m using the HomeAssistant integration (https://github.com/mauro-midolo/homeassistant_electrolux_status) and basically I have the following issue… I setup my washing machine (AEG LR86CUC94) and I setup the integration and all was working fine. Then, my wife made an account and setup the washing machine, and then the appliance was removed from my account….

Now when I tried to add the washing machine in HomeAssistant, I get the following error. I’ve already completely removed the integration and re-added, but I always receive the same. I’ve even deleted my AEG account…. No succes….

2023-07-25 21:01:53.566 ERROR (SyncWorker_5) [pyelectroluxconnect.Session] API response error ECP0210: There is no access for user who is different from the session
2023-07-25 21:01:53.569 ERROR (SyncWorker_5) [pyelectroluxconnect.Session] Exception in _getAppliancesList: Invalid API response: There is no access for user who is different from the session (ECP0210)
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/pyelectroluxconnect/Session.py", line 188, in _getAppliancesList
    _json = self._requestApi(urls.getAppliances(self._username))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyelectroluxconnect/Session.py", line 969, in _requestApi
    raise ResponseError(err.status_code, err.message) from None
pyelectroluxconnect.Session.ResponseError: Invalid API response: There is no access for user who is different from the session (ECP0210)
2023-07-25 21:01:53.577 ERROR (SyncWorker_5) [pyelectroluxconnect.Session] Error while get Appliances list: Invalid API response: There is no access for user who is different from the session (ECP0210)
2023-07-25 21:01:53.582 ERROR (SyncWorker_5) [pyelectroluxconnect.Session] Invalid API response: There is no access for user who is different from the session (ECP0210)
2023-07-25 21:01:53.585 ERROR (MainThread) [custom_components.electrolux_status.config_flow] Invalid API response: There is no access for user who is different from the session (ECP0210)
Traceback (most recent call last):
  File "/config/custom_components/electrolux_status/config_flow.py", line 126, in _test_credentials
    await self.hass.async_add_executor_job(client.login)
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyelectroluxconnect/Session.py", line 1073, in login
    raise Exception(ErrorArg) from None
Exception: Invalid API response: There is no access for user who is different from the session (ECP0210)

I made an issue on the integration page as well, but I guess this is where I should actually be. https://github.com/mauro-midolo/homeassistant_electrolux_status/issues/122

tomeko12 commented 1 year ago

Appliance must be paired with account used in integration. You must see washing machine in AEG/Electrolux mobile app logged with username from integration.

Veldkornet commented 1 year ago

It is yes, I login to the app with the same credentials and I see the device. With the old credentials, the device is gone.

tomeko12 commented 1 year ago

Could You test this Python code:

import pyelectroluxconnect
import logging

_LOGGER = logging.getLogger(__name__)
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)

ses = pyelectroluxconnect.Session("email","password", region="emea") # or other region
ses.login()

appllist = ses.getAppliances()
print(appllist)

and paste output?

Veldkornet commented 1 year ago

I tried it again today, and it worked, without changing anything. I don’t know if it took a while to move between accounts on AEG’s side maybe or something.