home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.94k stars 29.03k forks source link

Eufy Component of core causing error message. #112758

Open karllogue opened 4 months ago

karllogue commented 4 months ago

The problem

I have been receiving this error across multiple versions of HA. Some versions of HA (the first March 2024 version for instance) cause all of the devices in the Eufy integration to no longer be recognized. Restoring to a previous version of HA fixes this. This error, however, has been consistent, even when the Eufy devices are properly recognized.

Logger: homeassistant.setup Source: setup.py:333 First occurred: 2:32:57 AM (1 occurrences) Last logged: 2:32:57 AM

Error during setup of component eufy Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 333, in _async_setup_component result = await task ^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/eufy/init.py", line 61, in setup data = lakeside.get_devices( ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/lakeside/init.py", line 39, in get_devices token = r.json()['access_token']


KeyError: 'access_token'

According to fuatakgun](https://github.com/fuatakgun, the issue "issue is coming from eufy component of core not eufy security custom component".

It seems every other iteration of HA causes Eufy to lose the devices. 

### What version of Home Assistant Core has the issue?

2024.2.5

### What was the last working version of Home Assistant Core?

_No response_

### What type of installation are you running?

Home Assistant OS

### Integration causing the issue

Eufy

### Link to integration documentation on our website

_No response_

### Diagnostics information

_No response_

### Example YAML snippet

_No response_

### Anything in the logs that might be useful for us?

```txt
2024-03-07 19:56:02.278 ERROR (MainThread) [homeassistant.setup] Error during setup of component eufy
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 390, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/eufy/__init__.py", line 61, in setup
    data = lakeside.get_devices(
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/lakeside/__init__.py", line 39, in get_devices
    token = r.json()['access_token']
            ~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'access_token'
```

### Additional information

_No response_
home-assistant[bot] commented 4 months ago

eufy documentation eufy source

billdwhite commented 2 months ago

I'm seeing this same issue as well; my Eufy components work and the integration is functioning fine. But I still see this in the system notifications after every reboot