TPLink HS100 Switches Unavailable

In the last couple of days all of the TPLink HS100 switches in my HASSI.IO configuration have stopped working. They show as “unavailable” in HASS Overview screen and the following message appears in the log:

Could not read state for Family Room Light: Communication error
7:22 PM components/switch/tplink.py (WARNING)

I have checked that the IP address has not changed. The switches work correctly from KASA app and from my Google Home device, but not from Home Assistant.

I’m running HASSIO 0.61.1

You need to enable debug logging for components.switch.tplink and pyHS100, or alternatively try pyhs100 command line tool to see if it gives more verbose error messages.

Mine have become very intermittent. They were fine a few versions ago (sorry did not keep track of when it started happening).

Is the the correct debug setup?

logger:
  default: error
  logs:
    components.switch.tplink: debug
    components.pyHS100: debug

Not sure about the last one.

Also - since this is spamming the hell out of my log, I have been running the log with components.switch.tplink: error , but it is still spamming the notification area (the ‘i’ in the dashboard’) and making a huge db. I have tried messing with ‘recorder’ to get it to stop doing that but can’t find the right way to do it.

recorder:
  exclude:
    domains:
      - switch

Does not do it… Is the ‘i’ notification log tied to the recorder anyway? I notice my switches are not in history anymore, so thinking it worked, but the ‘i’ notifications are not controlled by that.

You have to use simply pyHS100: debug without components in front of it. The easiest way to do testing is to use pyhs100 console tool as you don’t need to restart homeassistant for that to verify whether it is working or not :slight_smile: I don’t know about workings of recorder, so cannot really help you there, sorry.

Thanks. FYI to anyone else who happens along - the recorder issue is a know issue here:
https://github.com/home-assistant/home-assistant/issues/10663

hello, having same issue. any help would be great

Same issue

Seem to be having the same issue,

2018-06-24 12:43:30 WARNING (SyncWorker_8) [homeassistant.components.switch.tplink] Could not read state for Washing Machine: Communication error

The switches show as connected to the network according to the LED and then can be accessed through Kasa semi reliably (sometimes OK, sometimes slow, sometimes times out). HA has the same behavior essentially, but more often then not, not working.

It’s all pretty weird behavior:
*The switches can be pinged by some devices on the local network but not others.
*They dont seem to respond to ARP requests on my Windows PC, but the ARP entries are there on the HA box
*They are sending out weird GARP frames, see below,
*The switches still work ok’ish in Kasa (can timeout occasionally)
*HA more than not wont connect to them, but can intermittently show up in the UI,

From the switches in wireshark
3148 86.976816 Tp-LinkT_b7:fa:1c Broadcast ARP 60 Gratuitous ARP for 0.0.0.0 (Request)
8613 274.588502 Tp-LinkT_b7:fa:1c Broadcast ARP 60 Gratuitous ARP for 255.255.255.255 (Request)
55431 1469.545352 Tp-LinkT_b7:f9:b4 Broadcast ARP 60 Gratuitous ARP for 255.255.255.255 (Request) (duplicate use of 255.255.255.255 detected!)

Had another go at rebooting them and it didnt fix it, seems to be related to rebooting my AP, which has many other items on there with no issue.

This isn’t the only oddity with these things, they are constantly sending out DNS requests for aps1-api.tplinkra.com which is a non-existant domain. When the lookup fails they retry every second. I’ve ended up using pihole to create a lookup to itself, and when this succeeds on the plug it only queries for updates every minute or so. No idea what they are actually attempting to do, I see no traffic in pcap after they perform that lookup.

I was having a similar issue with my HS200’s (2 of them) going unavailable more than 2 dozen times a day. I dropped them from my network, added them again and upgraded the firmware through the Kasa app and they’ve been flawless for the last weekend and a half. Haven’t gone unavailable once since.

I’ve found the same problem with the tplink switches sending about 300,000 DNS lookups a day for aps1-api.tplinkra.com (and something sending 100,000 lookups for netgear too). How did you use pihole to create a lookup to itself? I added the domain to the blocklist but that seems to be different because if I reboot the modem, the switches don’t seem to reconnect to wifi unless I unblock in pihole.

Just put a static entry (exact match) in the blacklist for ‘aps1-api.tplinkra.com’.

That hasn’t caused any issue with them after they are rebooted for me.

It doesnt stop them trying but they only try like once every 20 seconds now instead of 3 times a second.

Ok thanks, that’s what I did. I just wasn’t sure if “create a lookup to itself” was the same as blacklisting it. The problem with the switches not reconnecting to wifi seems to have been a one-off. It’s all working well now and pi-hole is reporting many many many fewer DNS requests. Very happy.

I’m having the same issue as OP, don’t know if it’s ever been fixed or figured out?

I’ve got 2 HS110 running but multiple times a day one is reporting “Communication error”, but the same minute it’s working again. How can I debug this? Is Home Assistant just sending too much requests? Is the Wifi not good enough? Is the timeout too low?

I’ve been having this problem and recently added an old router I had to extend the wifi. I’ve now gone from having one router upstairs to having one upstairs and another downstairs.

The smart plugs seem much better after that, in fact I don’t think they’ve shown as unavailable since.

1 Like

Just changed the 2.4G channel to a less busy channel, so far (30 minutes) no interruptions anymore. Haven’t looked at the channel before because I’m using 5G with all other devices. In the Kasa app the strength is good I think; -69 dBm. That’s from my Asus RT-AC68U downstairs to the switch at the attic. Thanks!

2 Likes

I disabled “no ACK” on the wifi and it seems to have solved i, so far (20 mins).

Was having my TP-Link lights and switches dropping randomly as well, but found the solution. Changed my 2.4Ghz power settings on my APs to a max of 17dB (was originally 23dB).

The issue is while the APs can see the TP-Link, the TP-Link can’t communicate back in some cases since it can’t transmit stronger than 17dB.

1 Like

I am seeing what I think is the same issue with multiple different tp-link switches and bulbs at 2 different locations (my place and a buddies).

Sometimes some of them show up as unavailable and HA has to be restarted or they’ll never come back. Sometimes takes multiple restarts.

WiFi seems strong to the ones that are acting up, though. And this only started happening after a certain HA update (wish I wrote down the version). Pretty sure it was when the integration was added to the UI.