EDIMAX Failed to communicate with SmartPlug

Somewhere down the upgrade from 0.46 to 0.49.1 i lost the EDIMAX plug, the plug works fine with EDIMAX own app
IP, username and password is set correct, is it just me or a general fail in EDIMAC component?

jul 26 08:17:15 raspberrypi hass[1129]: ERROR:homeassistant.helpers.entity:Update for switch.lys_stue fails
jul 26 08:17:15 raspberrypi hass[1129]: Traceback (most recent call last):
jul 26 08:17:15 raspberrypi hass[1129]: File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity.py”, line 225, in async_update_ha_state
jul 26 08:17:15 raspberrypi hass[1129]: yield from self.hass.async_add_job(self.update)
jul 26 08:17:15 raspberrypi hass[1129]: File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
jul 26 08:17:15 raspberrypi hass[1129]: yield self # This tells Task to wait for completion.
jul 26 08:17:15 raspberrypi hass[1129]: File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
jul 26 08:17:15 raspberrypi hass[1129]: value = future.result()
jul 26 08:17:15 raspberrypi hass[1129]: File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
jul 26 08:17:15 raspberrypi hass[1129]: raise self._exception
jul 26 08:17:15 raspberrypi hass[1129]: File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
jul 26 08:17:15 raspberrypi hass[1129]: result = self.fn(*self.args, **self.kwargs)
jul 26 08:17:15 raspberrypi hass[1129]: File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/switch/edimax.py”, line 97, in update
jul 26 08:17:15 raspberrypi hass[1129]: self._state = self.smartplug.state == ‘ON’
jul 26 08:17:15 raspberrypi hass[1129]: File “/home/homeassistant/.homeassistant/deps/pyedimax/smartplug.py”, line 172, in state
jul 26 08:17:15 raspberrypi hass[1129]: raise Exception(“Failed to communicate with SmartPlug”)
jul 26 08:17:15 raspberrypi hass[1129]: Exception: Failed to communicate with SmartPlug

Which plugs do you have, I am on 49.0 with no issues.

model is SP-1101w, FW 2.04

Interesting, do they ever connect? Or are they connecting and dropping?

Double check all the settings in your config is about all the troubleshooting I can offer. I’m no good at reading the error logs most of the time.

I have the same issue.
Since firmware upgrade to version 2.04 hass.io can’t connect to my Edimax SmartPlugs SP-1101W switches.
Error messages found as follows:

2017-08-28 23:05:32 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.edimax2 fails
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 225, in async_update_ha_state
    yield from self.hass.async_add_job(self.update)
  File "/usr/lib/python3.6/asyncio/futures.py", line 331, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 244, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 244, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/switch/edimax.py", line 97, in update
    self._state = self.smartplug.state == 'ON'
  File "/usr/lib/python3.6/site-packages/pyedimax/smartplug.py", line 172, in state
    raise Exception("Failed to communicate with SmartPlug")
Exception: Failed to communicate with SmartPlug
2017-08-28 23:05:32 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.edimax1 fails
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 225, in async_update_ha_state
    yield from self.hass.async_add_job(self.update)
  File "/usr/lib/python3.6/asyncio/futures.py", line 331, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 244, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 244, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/switch/edimax.py", line 97, in update
    self._state = self.smartplug.state == 'ON'
  File "/usr/lib/python3.6/site-packages/pyedimax/smartplug.py", line 172, in state
    raise Exception("Failed to communicate with SmartPlug")
Exception: Failed to communicate with SmartPlug
2017-08-28 23:05:33 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.edimax3 fails
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 225, in async_update_ha_state
    yield from self.hass.async_add_job(self.update)
  File "/usr/lib/python3.6/asyncio/futures.py", line 331, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 244, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 244, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/switch/edimax.py", line 97, in update
    self._state = self.smartplug.state == 'ON'
  File "/usr/lib/python3.6/site-packages/pyedimax/smartplug.py", line 172, in state
    raise Exception("Failed to communicate with SmartPlug")
Exception: Failed to communicate with SmartPlug

What could be the reason? From the EdiLife App I can access the devices. PW doublechecked.

HASS config:

core-ssh:/config# cat switches.yaml
### switches.yaml
- platform: edimax
  host: 192.168.133.119
  username: !secret switch_edimax_user
  password: !secret switch_edimax_password
  name: edimax1
- platform: edimax
  host: edimax2
  username: !secret switch_edimax_user
  password: !secret switch_edimax_password
  name: edimax2
- platform: edimax
  host: edimax3
  username: !secret switch_edimax_user
  password: !secret switch_edimax_password
  name: edimax3

Before the firmware update, the switches worked without problem.

They have changed their api from basic auth to digest auth so the current code in home assistant is no longer compatible. Hopefully someone will change it soon. The new python code needed to control the switches can be found here

2 Likes

I assume no volunteers yet to fix this issue?

FYI This is now fixed in version 0.65, see the release notes and here:


Unfortunately the new edimax fw 2.04 doesn’t allow the plug to be discovered in the Edismart app (for me at least) so I can’t control them via Alexa. Can’t have everything I guess.

I’m getting similar error messages with version 0.65.6 and plug firmware 2.08.

Did the update to 0.65 help you?

UPDATE:
Solved by removing pyedimax directories: /srv/homeassistant/lib/python3.5/site-packages/pyedimax* and restarting HA.