[APP][Pro] TP-Link KASA LAN - Smart Plugs and Bulbs (WIFI)

I honestly don’t see anywhere to debug from that kasa app, but at this point this is over my head. I’ve tried removing the devices and adding them again and it’s the same error every time. If it was just one switch that would be one thing but it’s every one of my kasa switches. They still work with no issues from the kasa app, and they still work with no issues throughout Alexa, but for whatever reason they will not work with Homey. They didn’t work with the official TP-Link kasa app which brought me to this app, which worked great for awhile and then just one night all kasa switches stopped working with homey

Is this what you need?

f7be36fd-fd9a-4e91-b255-dc03235e324b

I’m looking into some possibilities to incorporate some of the devices which are not supported by the API, which are :

Plugs: EP25, HS100, KP125M
Power Strips: EP40M
Wall Switches: HS200, HS220, KS205, KS225, KS240

Without having those devices myself nor having official API, can’t even attempt to do the magic despite I can’t promise I will make it work after all.

I’m searching for someone willing to support this app development, who has skills and ability to provide :

  • port forwarding for external access (public IP might be necessary or knowledge of Tailscale solution) - both can be revoked after end of tests - necessary for CLI installation and debugging
  • access to Homey on manager level (please beware of the privacy risk) - same as above
  • TPLink credentials (again can be reset after the tests) - can’t test authentication without credentials

For period of 1 week up to 1 month, can be provided adhoc only, if needed (enable/disable) as my free time for this hobby allows.

If you are the right person, contact me via DM.

Beware, you are letting stranger in to your house, literally. So it’s recommended only to those of you knowing what they do, despite I have some history here, you can’t trust stranger. But still offering this option to everyone.

I start seeing some reports about some devices not being reachable anymore.
If those devices are listed in my message above, that’s the reason.
If not, please check in the KASA App you have enabled 3rd party compatibility :

Sharkys, ping me, I will assist you.

I have prepared a substantial update for the TP-Link KASA LAN app.

https://homey.app/en-cz/app/nu.baretta.tplink/TP-Link-KASA-LAN/test

This update adds authenticated local-LAN support for newer TP-Link SMART devices:

  • KS225 — on/off, dimming and LED control
  • S500D — on/off, dimming and LED control
  • KS240 — separate fan and light devices, including on/off and level control

The app still communicates with these devices locally. TP-Link account credentials are required only to authenticate the newer encrypted local protocol.

The update also includes:

  • TP-Link TDP v2 discovery while retaining legacy Kasa discovery.
  • Automatic discovery and manual-IP pairing.
  • Separate and safely cleaned-up pairing sessions.
  • Improved polling for ES20M, HS110, HS220 and KS230.
  • Compatibility preservation for existing paired devices and Flows.

I previously asked for help from owners of these devices in this post, followed by this reminder. Not even a single volunteer with suitable hardware was available, so physical-device testing has still not been possible.

What I need tested

For KS225, S500D and KS240:

  1. Automatic discovery.
  2. Manual-IP pairing if automatic discovery fails.
  3. Pairing with your TP-Link account email and password.
  4. On/off control and status updates.
  5. Dimming or level control.
  6. LED control on KS225 and S500D.
  7. Both fan and light channels on KS240.
  8. Operation after restarting the TP-Link KASA LAN app.
  9. Recovery after the device’s IP address changes.

For existing ES20M, HS110, HS220 and KS230 installations:

  1. Confirm that existing paired devices remain available.
  2. Test controls and status updates.
  3. Test power measurements where supported.
  4. Confirm that existing Flows still work.
  5. Restart the app and confirm that communication resumes.

Existing KS225, S500D or KS240 devices may require TP-Link credentials to be entered in the device’s Advanced Settings after updating.

If something stops working

Please do not remove the paired device immediately, because doing so may affect existing Flows.

Instead:

  1. Restart the TP-Link KASA LAN app once.

  2. Reproduce the problem.

  3. Generate an app diagnostic report immediately.

  4. Share the diagnostic-report ID together with:

    • Exact TP-Link model.
    • Hardware and firmware version, if you are able to obtain it (eg. via oficial KASA App).
    • Whether the device was newly paired or already installed.
    • Whether automatic discovery or manual IP was used.
    • The action that failed.

For legacy Kasa devices that suddenly become unreachable, also verify that “Third-Party Compatibility” remains enabled in the Kasa app.

Successful reports are welcome, but failure reports with diagnostics are equally valuable. Community testing is the only practical way to make this update reliable across the different hardware and firmware revisions.

@Sharkys are you the app maintainer now? I’d love to have support for the HS107 (2 plug). I’ve got one for physical testing, hence my ask.

Hi @ericthemantis,

Yes, I am currently maintaining the app for some time already (since January, 2024). Thank you for offering to test the HS107.

I have prepared experimental HS107 support in the TEST version.

Please be aware that the underlying API and the related recent driver changes must currently be considered unstable. Despite my earlier request for community testing, nobody with the required devices was willing to help verify the broader update on real hardware.

If the HS107 is your only device in this app and you do not depend on other TP-Link devices for important automations, the TEST version should be okay to try.

Please test:

  1. Automatic discovery and manual-IP pairing.
  2. Pairing both outlets as separate Homey devices.
  3. Independent on/off control of both outlets.
  4. The shared status LED.
  5. Operation after restarting the app.

HS107 does not provide energy measurements.

Please report both successful and unsuccessful results. If something fails, do not remove the paired device immediately. Restart the app once, reproduce the problem and send me the diagnostic-report ID together with the hardware and firmware versions.

Version 0.3.3 — Added experimental local-LAN support for TP-Link Kasa HS107, with both outlets paired separately and supporting independent on/off plus shared LED control.

Have tried to use dynamic ip discovery for my HS110, but the app does not seem to discover it after it changes ip address? Is this supposed to work ?

Diagnostic logs?

Shure, I take that as a confirmation. diag is sent

Yes, enabling dynamic IP discovery is intended to let the app find your HS110 again after its address changes.

Thanks for the diagnostic report. I found an issue in your app version, v0.2.47: the connection failures shown for your HS110 bypass the automatic rediscovery logic. This error path has been corrected in newer code. Please install latest Test version and report back that worked…

nice. Well done. The device went unavailable for a second, and then the ip was updated to the new and correct one. How are you actually finding it ? by the mac address ?

I did send a diag to let you see how it went

Thanks for testing and confirming it recovered! :slightly_smiling_face:

It uses TP-Link’s local network discovery: the app sends a broadcast request and matches replies against the plug’s unique TP-Link device ID, rather than its MAC address. That ID stays the same when the IP changes, so the app can recognise your existing plug and save its new address. It becomes available again after a successful status check.

This was a longstanding issue. Looking through the code history, recovery only recognised one particular connection error as far back as January 2019, so ordinary timeouts could fail to trigger discovery. A separate error-handling gap introduced in January 2024 could also bypass recovery. The latest fix addresses both across the affected drivers—it wasn’t limited to the HS110.

I have the same issue in the past month or so. Error 9999.

I would certainly be willing to test a fix. Because with the official app I am getting the connection refused error.

Send the App. diagnostic log, without that it’s hard to tell, ideally with device name, HW and SW version from the Kasa app.

I have tested the version you posted for testing. It fixed my problem!

I’ve added the devices in a couple of flows and I’ll keep testing.

:clap::folded_hands:

This is a follow-up to the recent discussions here:

I already have a few users willing to test the latest changes, but some wider testing would be very much appreciated before this version is promoted to production.

The current production version is still 0.2.47, so the Test version contains quite a substantial set of changes accumulated since then.

Test version 0.3.11

Main changes since production version 0.2.47

Added support for newer authenticated TP-Link Kasa devices and firmware.
Added authenticated SMART-device support.
Added authenticated EP10 support for newer firmware.
Added app-wide TP-Link account credentials, with optional per-device overrides.
Added migration support for existing installations and secure credential handling during pairing.
Added support for newer HS200 firmware using KLAP authentication with login_version 2.
Added automatic selection between legacy TCP and KLAP transport where required.
Added additional HS200 logging in 0.3.11 to help diagnose remaining authentication or connection issues.
Added experimental HS107 support, with both outlets paired separately and supporting independent on/off control plus shared LED control.
Improved KS240 support.
Improved HS220 support, including:
    support for the newer transport method,
    correct 0% dimming behaviour,
    correct brightness reporting while switched off,
    rounded dimming levels.
Improved automatic IP rediscovery across affected devices.
Improved timeout recovery, isolated discovery sessions and retry handling.
Optimized polling to use roughly half the previous number of network connections.
Staggered device startup to avoid connection bursts when the app starts.
Removed an unnecessary startup polling delay while preserving connection caching and recovery.
Fixed shared LED Flow actions.
Added additional authentication, brightness and connection diagnostics.

What I would like you to test

Please install 0.3.11 from the Test channel and use your devices normally.

Because the production version is still 0.2.47, feedback is useful not only for HS200 but for all supported Kasa devices.

Testing is especially useful if you have:

HS200
HS220
KS240
EP10
HS107

devices using newer authenticated/KLAP firmware

older devices still using the legacy protocol

Please check:

pairing,
normal on/off operation,
dimming where applicable,
LED control,
device status updates,
recovery after a device temporarily becomes unavailable,
recovery after an IP address change,
behaviour after restarting the app or Homey.

If you experience any issue, please create a Diagnostic Report from the TP-Link Kasa LAN app shortly after reproducing the problem and post the diagnostic ID here together with the device model and firmware version.

Positive feedback is useful as well. Even a short confirmation such as:

0.3.11 works fine with HS200 / firmware xxx as part of the diagnostic log, helps confirm that the changes do not introduce regressions for existing devices.

Thanks to everyone willing to help test this version before it moves from Test to production.

I recently purchased several KS240 units and was not able to get them to be recognized in v0.2.47. After installing v0.3.11 they are now recognized and connected. So far seems to be working as expected. I just update a few hours ago so do not have much time on them yet.