I have an Eufy light bulb that had been previously been working with HA. I am now getting the following error on startup. Any thoughts on whats wrong? I am running HA 0.74.0
2018-07-22 13:41:38 ERROR (MainThread) [homeassistant.components.light] Error while setting up platform eufy
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 129, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/light/eufy.py”, line 31, in setup_platform
add_devices([EufyLight(discovery_info)], True)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/light/eufy.py”, line 58, in init
self._bulb.connect()
File “/usr/local/lib/python3.6/site-packages/lakeside/init.py”, line 102, in connect
return device.connect(self)
File “/usr/local/lib/python3.6/site-packages/lakeside/init.py”, line 58, in connect
self.update()
File “/usr/local/lib/python3.6/site-packages/lakeside/init.py”, line 166, in update
response = self.get_status()
File “/usr/local/lib/python3.6/site-packages/lakeside/init.py”, line 115, in get_status
response = self.send_packet(packet, True)
File “/usr/local/lib/python3.6/site-packages/lakeside/init.py”, line 105, in send_packet
return device.send_packet(self, packet, response)
File “/usr/local/lib/python3.6/site-packages/lakeside/init.py”, line 76, in send_packet
length = struct.unpack("<H", decrypted_packet[0:2])[0]
struct.error: unpack requires a buffer of 2 bytes
Tue Aug 14 2018 06:16:49 GMT-0400 (Eastern Daylight Time)
Error while setting up platform eufy
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/light/eufy.py", line 31, in setup_platform
add_devices([EufyLight(discovery_info)], True)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/light/eufy.py", line 58, in __init__
self._bulb.connect()
File "/usr/local/lib/python3.6/site-packages/lakeside/__init__.py", line 102, in connect
return device.connect(self)
File "/usr/local/lib/python3.6/site-packages/lakeside/__init__.py", line 58, in connect
self.update()
File "/usr/local/lib/python3.6/site-packages/lakeside/__init__.py", line 166, in update
response = self.get_status()
File "/usr/local/lib/python3.6/site-packages/lakeside/__init__.py", line 115, in get_status
response = self.send_packet(packet, True)
File "/usr/local/lib/python3.6/site-packages/lakeside/__init__.py", line 105, in send_packet
return device.send_packet(self, packet, response)
File "/usr/local/lib/python3.6/site-packages/lakeside/__init__.py", line 76, in send_packet
length = struct.unpack("<H", decrypted_packet[0:2])[0]
struct.error: unpack requires a buffer of 2 bytes
Can you check the IP of your light/switch and compare it to what’s in config/entity_registry.yaml ? Mine started working again and then I noticed that this config has an IP in it. I set the device to have a static IP in my router and have not had issues since.
I just tried completely removing all references to the lightbulb in the config, entity_registry, and known_devices files, rebooting HA, and then just readding the Eufy account information in the config again, and no luck. Same error message and the lightbulb isn’t found. Not sure what else to do at this point…
My Eufy Smart Plugs have also gone MIA. I too am getting the “ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform eufy” in my log. I am running HA in Unraid as a docker container, now at version 0.78.2
I found this suggestion here of unplugging and re-plugging in the eufy devices. I did that then restarted HA and it rediscovered the missing Eufy plugs.
I also updated to 0.78.3. Not sure if that made a difference.
Same issue here, and thanks for opening an issue. I tried both discovery and then hard coding them based on the configuration page (by getting access tokens using a CURL command). Hoping that @mjg59 has some luck with this as it’s a great component and very inexpensive hardware.
I had a similar issue. After pulling my hair out for a few days and trying to see if there was an issue in the code or on my pi or network, I just simply manually upgraded the lakeside component and it started working. It looks like euphy switched the protocol they use which was updated in the latest version of lakeside. In hassbian or a virtual environment it was a simple matter of activating the virtual environment and pip install --upgrade lakeside.
If you have hassbian or HA installed in a virtual environment it is just a matter of activating the venv and running pip install --upgrade lakeside. And if you don’t have it installed in a virtual environment you would just run the pip command
I can’t help you with hass.io or docker, I don’t have much experience. You could look into the Hassio SSH & Shell addon and trying to run the commands from there, as long as you have the components enabled in the configuration. I’m curious if anyone else has some insight into this
I have HassOS running as VM in unraid but after updating to 0.83.2 one of the eufy plugs that randomly disconnected is now found again. Not sure if that update has the newer lakeside component or just updating HA rediscovered the missing eufy plug.