question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Eufy light switch control stops working

See original GitHub issue

The problem

Eufy light switches initially work but after some time they are no longer controllable from Hassio, The Eufy application still works fine when this occurs. Resetting the switch fixes the issue for a little while but the issue eventually comes back and the switch has to be reset again. The log file is filling up with looping error messages (currently 951 occurrences).

Environment

  • Home Assistant Core release with the issue: 107.7
  • Last working Home Assistant Core release (if known): never
  • Operating environment (Home Assistant/Supervised/Docker/venv): Hass.io on Pi 3B
  • Integration causing this issue: Eufy
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/eufy/

Problem-relevant configuration.yaml


eufy:
  username: email@gmail.com
  password: !secret eufy_password
  devices:
    - address: 192.168.7.134
      access_token: CAB97F9490E7410B
      type: T1211
      name: Smart Switch
    - address: 192.168.7.133
      access_token: 4D4CB87620254F87
      type: T1211
      name: Smart Switch
    - address: 192.168.7.108
      access_token: 8B25953ED3C94FA8
      type: T1211
      name: Smart Switch
    - address: 192.168.7.110
      access_token: CCDBAC1E1DAB4DF1
      type: T1211
      name: Smart Switch

Traceback/Error logs


2020-04-03 08:43:01 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.main_lights fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 476, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/eufy/switch.py", line 34, in update
    self._switch.update()
  File "/usr/local/lib/python3.7/site-packages/lakeside/__init__.py", line 246, in update
    response = self.get_status()
  File "/usr/local/lib/python3.7/site-packages/lakeside/__init__.py", line 242, in get_status
    response = self.send_packet(packet, True)
  File "/usr/local/lib/python3.7/site-packages/lakeside/__init__.py", line 232, in send_packet
    return device.send_packet(self, packet, response)
  File "/usr/local/lib/python3.7/site-packages/lakeside/__init__.py", line 97, in send_packet
    length = struct.unpack("<H", decrypted_packet[0:2])[0]
struct.error: unpack requires a buffer of 2 bytes

Additional information

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:12
  • Comments:32 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
dereitzcommented, Apr 9, 2020

Same issue here – and it appears to be common among all Eufy components. In my case, I’m using a Eufy bulb. There have been some fixes in the past to address this that have helped, but I’m still intermittently seeing this issue. There are two workarounds I’m currently aware of:

  1. Restart the Eufy device (bulb in my case)
  2. Restart HASS

Both seem to resolve the issue for days->weeks.

2reactions
duckbraincommented, Jul 31, 2022

It does look like python-lakeview isn’t being maintained, but there were a few people who submitted PRs against it to add a guard against malformed devices. I wonder if that patch could make it more resilient. https://github.com/google/python-lakeside/pull/20

Seeing as the dependency isn’t maintained and the code is simple, it’d probably be better to copy it into home assistant and apply the patch to maintain it in the future.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Q&A for Smart Switch - eufy Support
If Smart Switch does not respond, press the RESTART button to restart it. This is the equivalent of turning off the power to...
Read more >
How to Fix Basic Issues with eufy Smart Home Devices
Wait ten seconds. Turn the power back on, or plug back in the lamp. Light switch on. Wait one minute for the Lumos...
Read more >
Why Eufy Keep Stopping and Not Working? (SOLVED)
If a Eufy robot vacuum cannot be activated, it can mean that the power switch is in the OFF position, the battery is...
Read more >
RoboVac 30C - eufy | Support
4. Check to see if the side switch on RoboVac is turned on (in the ""I"" position) and make sure your RoboVac operates...
Read more >
Smart Switch Won't Connect To Wifi: 3 WAYS TO FIX - YouTube
3 WIFI LIGHT SWITCH FIXES: 1. Connect to 2.4GHz Network 2. Check Wifi Network and Password 3. Wifi Network Range/ Wifi Network Age...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found