Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lost communication with TP Link Kasa Plugs after firmware update #43088

Closed
danielsmith89 opened this issue Nov 11, 2020 · 102 comments
Closed

Lost communication with TP Link Kasa Plugs after firmware update #43088

danielsmith89 opened this issue Nov 11, 2020 · 102 comments
Assignees
Labels
integration: tplink stale waiting-for-upstream We're waiting for a change upstream

Comments

@danielsmith89
Copy link

danielsmith89 commented Nov 11, 2020

WORKAROUND

https://www.tp-link.com/us/support/faq/2707/

The problem

Lost communication with all TP Link Smart Plugs. Smart Lightbulbs still working as expected. However all works fine on TP Link Kasa App, so I know it's on the network and working correctly.

Environment

  • Home Assistant Core release with the issue: 0.117.5
  • Last working Home Assistant Core release (if known): 0.117.5
  • Operating environment (OS/Container/Supervised/Core): Container
  • Integration causing this issue: TP Link Kasa
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/tplink/

Problem-relevant configuration.yaml

tplink:
  discovery: false
  light:
    - host: 192.168.1.188
  switch:
    - host: 192.168.1.181
    - host: 192.168.1.176

Traceback/Error logs

2020-11-11 10:18:36 WARNING (SyncWorker_0) [homeassistant.components.tplink.common] Unable to communicate with device 192.168.1.181: Communication error
2020-11-11 10:18:36 WARNING (SyncWorker_0) [homeassistant.components.tplink.common] Unable to communicate with device 192.168.1.176: Communication error

Additional information

@tumm
Copy link

tumm commented Nov 11, 2020

Same thing happened to me this morning

@danielsmith89
Copy link
Author

Same thing happened to me this morning

It's bizarre. I've even just moved them to running local with static IP's, still nothing. Light bulb is still working flawlessly though, so weird.

@Robbo312
Copy link

Robbo312 commented Nov 11, 2020

I'm having the same issue as well on some of my HS110 switches..

Seems to be these don't work, firmware reported in HA; Firmware: 1.0.4 Build 191111 Rel.143903
These do; Firmware: 1.5.10 Build 191125 Rel.094314

I've hit the update firmware in the app, some updated, but im not sure which ones - however looking at a device that has issues it says it's on Firmware Version 1.1.0 (hardware version 4.1) and not 1.0.4 as reported in HA. So it looks like a firmware upgrade borked something. The ones that work are on hardware version 2.1, firmware 1.5.10.

@danielsmith89
Copy link
Author

I wonder if TP Link have pushed a firmware update overnight, which has borked some devices...

@Robbo312
Copy link

Robbo312 commented Nov 11, 2020

Just done a simple nmap on the devices, the ones that work have port 9999 open, the ones that don't have port 80 open. I don't know if this was the case when they were both working.

Starting Nmap 7.70 ( https://nmap.org ) at 2020-11-11 11:23 GMT
Nmap scan report for 192.168.88.51
Host is up (0.00071s latency).
Not shown: 999 filtered ports
PORT STATE SERVICE
9999/tcp open abyss
MAC Address: D8:0D:17:23:47:4E (Unknown)

Starting Nmap 7.70 ( https://nmap.org ) at 2020-11-11 11:23 GMT
Nmap scan report for 192.168.88.55
Host is up (0.0023s latency).
Not shown: 999 closed ports
PORT STATE SERVICE
80/tcp open http
MAC Address: B0:95:75:5E:F0:DD (Unknown)

@igiannakas
Copy link

igiannakas commented Nov 11, 2020

Same issue here. TP Link Smart Plug HS110, HW Version 4.1, Firmware Version: 1.1.0, running the latest home assistant release. Using NMAP I see that port 80/TCP is open.

My second TP Link smart plug - HS100, HW Version 2.1, FW version 1.5.10 is working perfectly via HA. Using nmap I see that port 9999/TCP is open

@danielsmith89
Copy link
Author

Just done a simple nmap on the devices, the ones that work have port 9999 open, the ones that don't have port 80 open. I don't know if this was the case when they were both working.

nmap 192.168.88.51

Starting Nmap 7.70 ( https://nmap.org ) at 2020-11-11 11:23 GMT
Nmap scan report for 192.168.88.51
Host is up (0.00071s latency).
Not shown: 999 filtered ports
PORT STATE SERVICE
9999/tcp open abyss
MAC Address: D8:0D:17:23:47:4E (Unknown)

nmap 192.168.88.55

Starting Nmap 7.70 ( https://nmap.org ) at 2020-11-11 11:23 GMT
Nmap scan report for 192.168.88.55
Host is up (0.0023s latency).
Not shown: 999 closed ports
PORT STATE SERVICE
80/tcp open http
MAC Address: B0:95:75:5E:F0:DD (Unknown)

That seems to match up with my devices too. Like you though, I couldn't say if that was the case before we started having problems.

@tombeynon
Copy link

I'm seeing this on HS100 devices as well as HS110. Tried restarts, removing integration and re-adding but obviously nothing working. 4 of my 8 devices are working, seems consistently the same devices, but I can't find any difference between those and the missing ones.

@igiannakas
Copy link

I'm seeing this on HS100 devices as well as HS110. Tried restarts, removing integration and re-adding but obviously nothing working. 4 of my 8 devices are working, seems consistently the same devices, but I can't find any difference between those and the missing ones.

What is the firmware version for your devices that are working vs the ones not? Im thinking maybe TP Link has pushed a FW update that broke the integration.

@tombeynon
Copy link

tombeynon commented Nov 11, 2020

HS110 working - one on 1.2.6 and one on 1.5.10
HS100 working - 1.0.3
KP303 strip working - 1.0.4 (seems to have combined the entities into one of the plugs as the device)

HS100 not working - 1.1.0

@danielsmith89
Copy link
Author

Glad to hear it's not just me 😅 been tearing my hair out this morning thinking it was an issue on my network! Here's hoping it's a simple/easy fix!

@igiannakas
Copy link

Seems like the v1.1.0 firmware may be the culprit. My HS110 on V1.1.0 is the one not working as well.

@deosrc
Copy link
Contributor

deosrc commented Nov 11, 2020

I thought I had broke my DNS again 😂

Interestingly it seems the Hardware Version may play into the Firmware Version. I have a few HS110 plugs:

Hardware Version Firmware Version Status
2.1 1.5.7 Working (x2)
4.1 1.0.4 Working
4.1 1.1.0 "Unavailable" since 4AM

Guess it's time to add these to the growing list of devices I don't allow access to the internet 😞

EDIT: Updated with status of disconnected plugs

@deosrc
Copy link
Contributor

deosrc commented Nov 11, 2020

Also worth noting that the "broken" plug wouldn't connect in Kasa until I updated the app.

@honkerst
Copy link

Same symptoms here. One HS110 with HW 2.1 and FW 1.5.7 still working, but another HS110 with HW4.1 and FW1.1.0 stopped working last night.

@SimonWilkinson
Copy link

The "broken" devices have a responsive web server on port 80, which claims to be "Server: SHIP 2.0"

@oscarhibbert
Copy link

Same symptoms & w/ same timeframe also.

6x UK HS100's
Hardware v4.1
Firmware 1.1.0

Working without issue via Kasa app.

@spacegaier
Copy link
Member

spacegaier commented Nov 12, 2020

Interestingly enough, mine still work (both via HA and app):
HS100 (HW 4.0, FW 1.1.5)
HS110 (HW 4.0, FW 1.0.4)

Looking through here, it seems the issue only/mainly affects hardware version 4.1?

@danielsmith89
Copy link
Author

Interestingly enough, mine still work (both via HA and app):
HS100 (HW 4.0, FW 1.1.5)
HS110 (HW 4.0, FW 1.0.4)

Looking through here, it seems the issue only/mainly affects hardware version 4.1?

I think it's just the firmware version 1.1.0 that is causing the problem.

@drewy-uk
Copy link

Any way to revert back to the older firmware?

@YaBoiDan
Copy link

I can confirm the same has happened here too, all firmware version 1.1.0.

@Madbeefer
Copy link

Madbeefer commented Nov 13, 2020

All of my normal switches (HS200)s are offline, but my dimmers (HS220) are online. Sometimes I will get a couple of the HS200s back after an update to HA comes out, but as soon as it needs to be reset after the update I get only the dimmers back.

@igiannakas
Copy link

igiannakas commented Nov 13, 2020

As I rely on this integration working to automate my “dumb” dehumidifier, I’ve created a workaround via Alexa to control it. I’ve created a helper toggle that is used in a binary sensor value template exposed to Alexa. Then Alexa controls the tp link plug via the Kasa skill when the state of that binary sensor changes. It works the same way and with no real delay, but it’s the long way around and I’ve lost the current and wattage reporting capabilities of the native integration.

@danielsmith89
Copy link
Author

@rytilahti or @TheGardenMonkey, any chance either of you could have a look into this? Thanks.

@rytilahti
Copy link
Member

rytilahti commented Nov 13, 2020

See the linked python-kasa issue, and also python-kasa/python-kasa#42 . It is all very unclear, but from the looks of it (and due to that changelog entry mentioned in the issue) it may be that tplink is blocking this access on newer firmwares. Only thing I can do is to recommend not updating the devices nor connecting them to the cloud, if not necessary. T

here were some previous reports that some devices will lose the local access when connected to the cloud, although https://www.tp-link.com/de/support/faq/2707/ is still up. Potentially relevant issue (if the device still works when configured statically): python-kasa/python-kasa#105

Reading through the comments wrt. port 80 being open, see python-kasa/python-kasa#113 (comment)

@TheGardenMonkey
Copy link
Contributor

All of my
HS100's are HW - 2.0 and FW - 1.56
HS105's are HW - 1.0 and FW - 1.56
HS107's are HW - 1.0 and FW - 1.0.10
HS300 is HW - 1.0 and FW - 1.0.19
HS200's are HW - 2.0 and FW - 1.5.7
HS210's are HW - 1.0 and FW - 1.5.8
HS220's are HW - 1.0 and FW - 1.5.11
KL110 is HW - 1.0 and FW - 1.8.11
KP400 is HW - 2.0 and FW - 1.0.6

I have a few other models I should plugin and check, but everything (27 devices in total) is working as expected. I usually just purchase my switches on amazon but I don't know how to get a V4 specifically to help troubleshoot.

@rytilahti
Copy link
Member

Potentially related, if someone wants to take a look into potentially downgrading to a previous firmware version (although I'd guess that downgrades are not allowed): https://pceasies.com/blog/2017/12/17/updating-tp-link-smart-plug-firmware-hs110/

@github-actions github-actions bot removed the stale label Jul 13, 2021
@JohnHof1275
Copy link

Having issues as well

@bdraco bdraco changed the title Lost communication with TP Link Kasa Plugs Lost communication with TP Link Kasa Plugs after firmware update Sep 27, 2021
@bdraco
Copy link
Member

bdraco commented Sep 28, 2021

The TPLink integration will switch to using python-kasa next month.

python-kasa/python-kasa#117 has gone a bit stale, but it does provide a path forward to support the new encryption protocols.

It needs a champion to finish the work who has one of the affected devices to test with.

@rytilahti rytilahti added the waiting-for-upstream We're waiting for a change upstream label Oct 7, 2021
@miranml
Copy link

miranml commented Oct 28, 2021

I get this error once per day:

Logger: homeassistant.components.tplink.coordinator
Source: helpers/update_coordinator.py:219
Integration: TP-Link Kasa Smart (documentation, issues)
First occurred: October 27, 2021, 12:58:57 (3 occurrences)
Last logged: October 27, 2021, 22:45:52

Error fetching 192.168.55.111 data: Unable to connect to the device: 192.168.55.111

@davs2rt
Copy link

davs2rt commented Nov 20, 2021

Address Resolution Protocol (ARP) is how Ethernet converts an IP address to the MAC address that is used on the LAN. I discovered my HS103 does not respond to ARP queries, so Windows can't figure out where to try to send a packet, gives "Destination Host Unreachable" errors and just stops without sending anything out.

In Windows, adding an ARP entry is long and convoluted, must be run in an administrative command window, and yet doesn't solve the problem:
e.g. netsh interface ipv4 add neighbors "Wi-Fi" 192.168.17.2 e8-48-b8-f5-12-34
(Replace the name of the interface, the IP address and MAC address with your local values)
This only changes the error to "Request timed out". Wireshark-ing it, the ping is sent out now, but no response is received. I'm not sure what to make of that.

Adding a permanent ARP cache entry has been a useful work-around in Linux. There, with the ARP issue wallpapered over, Linux can successfully ping the plug. The command is simpler, too:
sudo arp -v -s 192.168.17.2 e8:48:b8:f5:12:34

TP-Link support has been responsive in getting me through the "local only" setup described here, which does work if you're patient enough. When the instructions say "may take a few minutes", they really mean it. Don't interrupt it, thinking that it must be hung up.

I will lobby with them that the ARP issue is a network bug (not a "security feature") and should be fixed.

plug version info:
(venv) davs2rt@heavymetal:~/code/kasa$ kasa --host kasa22 --plug sysinfo
== System info ==
{'active_mode': 'none',
'alias': 'TP-LINK_Smart Plug_DD83',
'dev_name': 'Smart Wi-Fi Plug Mini',
'deviceId': '8006E70EFABC14B8E62408640F9AE5581E743039',
'err_code': 0,
'feature': 'TIM',
'hwId': 'B25CBC5351DD892EA69AB42199F59E41',
'hw_ver': '5.0',
'icon_hash': '',
'latitude_i': 0,
'led_off': 0,
'longitude_i': 0,
'mac': 'E8:48:B8:F5:DD:83',
'mic_type': 'IOT.SMARTPLUGSWITCH',
'model': 'HS103(US)',
'next_action': {'type': -1},
'oemId': '211C91F3C6FA93568D818524FE170CEC',
'on_time': 1809,
'relay_state': 1,
'rssi': -32,
'status': 'new',
'sw_ver': '1.0.3 Build 201015 Rel.142523',
'updating': 0}

@SimonWilkinson
Copy link

I'm not longer actively working on this. I found the Kasa plugs with the new firmware to be somewhat unreliable - they would reboot at seemingly random times during the night, and when they rebooted they'd come back on with their output off. So, I've removed them from my setup in favour of Zigbee based plugs.

Happy to provide what help I can to get this moving along though.

@jakemauer
Copy link

@SimonWilkinson I’m interested to know what zigbee plugs or strips you’ve transitioned to using.

@Robbo312
Copy link

@SimonWilkinson I’m interested to know what zigbee plugs or strips you’ve transitioned to using.

I went to a Smartthings Zigbee plugs as they have energy monitoring. I couldn’t find anything else in the UK. I use them with zigbee2mqtt via a conbee.

@SimonWilkinson
Copy link

SimonWilkinson commented Nov 20, 2021

For energy monitoring I’m using a mixture of the SmartThings Smart Plug and the Aurora AOne double socket (which requires installation) For just turning things on and off, the IKEA Tradfri plug works a charm.

@jakemauer
Copy link

I love the Tradfri sockets. Has anyone in this thread that is surely to be closed any moment now for off topic chatting found a good zigbee power strip with 3+ outlets?

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Feb 18, 2022
@MasterSmurf
Copy link

I found the solution to integrate my HS100 in HA again. Local setup worked after resetting the Kasa HS100 and following this guide from TP-Link: https://www.tp-link.com/us/support/faq/2707/

Initially I setup a Cloud account, which caused the problems after updating HA.

@github-actions github-actions bot removed the stale label Feb 25, 2022
@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added stale and removed stale labels Jul 15, 2022
@tjmoore
Copy link

tjmoore commented Nov 7, 2022

Just to add I've had my Kasa plugs and bulbs for a couple of years now and only just got round to installing HA. I've used the Kasa app (Android) in the past to update to latest firmware and checked again and it says they're the latest.

It detected them fine and have had no issues with them.

KL110B HW1.0- Firmware 1.8.11
KP105 HW1.0 - Firmware 1.0.7

(UK models possibly. Bought in UK at least)

Also, the note about the plugs rebooting at times. I had that early on, particular late and night and all the plugs would switch off and back on again. Since firmware updates I've not had that problem since. I'm pretty happy with them really. Power monitoring on the plugs would be nice but can't have everything. Not about to bin them over that.

A lot of this could be hardware specific though.

p.s. the workaround link is dead. Or maybe they think it's fixed? https://www.tp-link.com/us/support/faq/2707/

@LordNex
Copy link

LordNex commented Nov 12, 2022

Add me to the mix. I have both single and 3 way wall switches, plugs, and various bulb

@LordNex
Copy link

LordNex commented Nov 12, 2022

Just to add I've had my Kasa plugs and bulbs for a couple of years now and only just got round to installing HA. I've used the Kasa app (Android) in the past to update to latest firmware and checked again and it says they're the latest.

It detected them fine and have had no issues with them.

KL110B HW1.0- Firmware 1.8.11 KP105 HW1.0 - Firmware 1.0.7

(UK models possibly. Bought in UK at least)

Also, the note about the plugs rebooting at times. I had that early on, particular late and night and all the plugs would switch off and back on again. Since firmware updates I've not had that problem since. I'm pretty happy with them really. Power monitoring on the plugs would be nice but can't have everything. Not about to bin them over that.

A lot of this could be hardware specific though.

p.s. the workaround link is dead. Or maybe they think it's fixed? https://www.tp-link.com/us/support/faq/2707/

Try powerc

Just to add I've had my Kasa plugs and bulbs for a couple of years now and only just got round to installing HA. I've used the Kasa app (Android) in the past to update to latest firmware and checked again and it says they're the latest.

It detected them fine and have had no issues with them.

KL110B HW1.0- Firmware 1.8.11 KP105 HW1.0 - Firmware 1.0.7

(UK models possibly. Bought in UK at least)

Also, the note about the plugs rebooting at times. I had that early on, particular late and night and all the plugs would switch off and back on again. Since firmware updates I've not had that problem since. I'm pretty happy with them really. Power monitoring on the plugs would be nice but can't have everything. Not about to bin them over that.

A lot of this could be hardware specific though.

p.s. the workaround link is dead. Or maybe they think it's fixed? https://www.tp-link.com/us/support/faq/2707/

Try powercalc

https://github.com/bramstroker/homeassistant-powercalc

it will allow you to build “virtual sensors” based upon known factors regarding various brands of devices.

@aporcupine
Copy link

Archived FAQ

@pfps
Copy link

pfps commented Feb 17, 2023

What's the status of Kasa devices in homeassistant? I bought some plugs and switches and I can control them directly using python-kasa by using their IP addresses. But discovery doesn't work so I have to add them one by one by their IP address. Is there another way of doing this?

@rytilahti
Copy link
Member

rytilahti commented Feb 17, 2023

@pfps That's off-topic on this issue (which has dozens of participants now getting notified...), so let's keep it off from this. Briefly answering your question, there's no way to do that without editing the source (the upstream lib allows defining the target network so modifying the discovery could work, but it's broadcast so the network needs to be directly connected).

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale May 25, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
integration: tplink stale waiting-for-upstream We're waiting for a change upstream
Projects
None yet
Development

No branches or pull requests