TP link HS110 errors

Hi,

I’ve just purchased a TP Link HS110 (energy monitoring version) and when I am trying to add it into Home Assistant I’m getting the below error. I already have two HS100 (non energy monitoring) connected and working fine. Can anybody help to get it working?

tplink: Error on device update!
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 197, in _async_add_entity
    yield from entity.async_device_update(warning=False)
  File "/usr/src/app/homeassistant/helpers/entity.py", line 327, in async_device_update
    yield from self.hass.async_add_job(self.update)
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 327, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 243, in result
    raise self._exception
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/components/switch/tplink.py", line 108, in update
    = "{:.2f}".format(emeter_readings["power"])
KeyError: 'power'

Just found another thread and looks like this issue has been around for a while and is known :frowning:

This issue has a fix in the pipeline, but no one has stepped up to test it.

If you can test this pull request and provide feedback we can resolve this:

https://github.com/GadgetReactor/pyHS100/pull/107

Sure happy to try it out. Could you let me know the commands? My HA instance is in docker on a NAS

Anyone found a solution to this problem yet? Have two new HS-110’s sitting around that I cant do anything with.

This a work around in this thread TPLink HS110 smart plug configuration help/error its a bit hacky and you need to redo it after every update but it works well

1 Like

Thank you. I have had a look and have downloaded both files. I have Putty for SSH but am not really familiar how to use it. There seem to be three places I need to replace the smartdevice.py file but I have absolutely no idea how to

You only need to replace one of the files (can’t tell you which one) but replacing all three it should work as well.

With putty you can upload the new file. On the left is your computer desktop and the right is the directory for your pi. Just navigate to the correct folder of the pi and then upload from them left

Thank you. I will see if I can get that to work. Using putty I was only able to see the command shell and no folder structures as you mentioned. I will look a bit harder

Thank you so much for your help. I could not find the file location that I had to replace as I was logging in using the SSH as described here. https://www.home-assistant.io/addons/ssh/

I needed to follow these instructions https://www.home-assistant.io/developers/hassio/debugging/ and by using WinSCP I was able to find the file and replace it. Everything is working now and I can see my switch.

Thanks so much for your help :slight_smile:

I just realized I was thinking of winscp when I told you what to do :upside_down_face: glad you got it working

Recently I have made simple to use fix that you just copy to custom_components without any need to use SSH or modify installed files

2 Likes

Thanks for this!

Hi all,

I have a communication error issue.

I tried with both official and custom component but nothing changed.

Could not read state for Switch Server: Communication error

Can someone help me?

@zwierzak is there any way to change the refresh rate for power usage? At the moment it can take up to 30 seconds to register that the device I have connected is drawing power.

I have 3x HS100 which all work fine via the Kasa app. I also have them linked via home assistant, however only 2 of them work fine whilst the other appears in HA but is greyed out and can’t be controlled. Any ideas what is wrong with this 3rd device?

image
I do see this icon below under status: