Tapo Python and Rust library now speaks TP-Link TPAP
What the Third-Party Compatibility switch really does, how three releases in a week taught the tapo client a protocol TP-Link never documented, and which devices still need the switch on.

A script that has switched a Tapo plug on and off for months starts getting 403 Forbidden after the plug quietly updates its firmware. Nothing in the code changed. The cause is a setting in the Tapo app called Third-Party Compatibility, under Me > Third-Party Services. Since firmware 1.4.0, a plug only talks to third-party clients the old way while that switch is on, and it ships turned off. At least nine issues on the tapo project tell this same story, among them #441, #449 and #473.
As of v0.11.1 of tapo, the unofficial Rust and Python client for TP-Link Tapo devices, the switch can stay off, with a few exceptions listed below. The library now speaks TPAP, the protocol TP-Link introduced with firmware 1.4.0 and never documented.
The Python package is a thin wrapper around the Rust crate, so every change lands in both under the same version number. If you drive Tapo devices from Python, this release is the one that removes the app-side workaround.
Why the 403 appears
On recent Tapo firmware, the Third-Party Compatibility switch decides which protocol a device speaks. A light, plug, power strip or H100 hub speaks KLAP when the switch is on and TPAP when it is off. Before v0.11.1 the library only knew KLAP, so it could reach a device only if the owner had flipped the switch. Otherwise the login was rejected, and from the script's side that looks like a bug in your code.
The switch is off by default. TP-Link's FAQ says the feature is 'disabled by default to ensure security' and that enabling it 'may reduce the security of your devices'. So every plug that takes firmware 1.4.0 arrives in the state that breaks existing scripts, and the fix lives in a phone app screen that most people running a Python script on a server never open.
The third lockout in three years
This is the third time since 2023 that a security change has locked third-party clients out of Tapo hardware, and each one cost client maintainers something different.
- 2023, lights and plugs. Researchers from the University of Catania and Royal Holloway reported four flaws in how Tapo devices talk to the app, starting from an L530E bulb. A few months later, firmware updates began replacing the original AES protocol with KLAP, without an announcement. Every third-party client, this library included, had to learn KLAP.
- 2024, cameras. Cameras on new firmware stopped accepting the Home Assistant integration's login by April 2024. A workaround through TP-Link's cloud was reviewed and refused. In December 2024 TP-Link shipped the Third-Party Compatibility toggle instead.
- 2025 into 2026, plugs and lights again. Firmware 1.4.0 brought TPAP and put plugs behind the same switch. Lights followed in the first half of 2026 on firmware 1.4.1 to 1.4.3.
This time the escape hatch existed before the door closed, but it was opt-in and undocumented from the client's side. Owners who asked on the TP-Link forum were told Home Assistant 'is not an officially supported third-party platform for Tapo products'.
What shipped, and when
The work landed in three releases within a week: v0.10.0 on 28 September, v0.11.0 on 2 October and v0.11.1 on 4 October. The headline is TPAP support in v0.11.1. Along the way the library also gained a new family of devices and two features of the Tapo app that people had been asking for. The changelog has the per-release detail.
TPAP works for lights, plugs, power strips, hubs and the cameras that require it. It works both when you connect by IP address and when you go through discover_devices. There is nothing to change in your code: the client works out which protocol the device speaks and logs in over that one. The examples in the original write-up are in Rust and the Python calls mirror them, so a Python script that already connects to a plug should only need the library upgraded.
Two errors that should never sit in a retry loop
TPAP devices have a lockout. After too many failed logins a device refuses every login for a while, so a wrong password is more costly than it was under KLAP. The library reports the two cases separately:
TPAP_CREDENTIALSmeans the password was wrong.TPAP_AUTH_ATTEMPTS_LIMITmeans the device has locked you out.
Do not retry either of them in a loop. A supervisor that restarts a crashed Python process every few seconds, with stale credentials baked into its environment, will keep the lockout alive for as long as it runs. Treat both errors as terminal for that run: log them, alert a human, and stop. A scheduled job that fails once per run is annoying; a loop that holds a plug locked out is worse, because it hides the real fault behind a second one.
Where TPAP does not reach yet
Cameras never spoke KLAP. Their older protocol is AES SSL, and some of them refuse it when the switch is off. TPAP support for them depends on model and firmware, so the picture is uneven:
- A C220 and a C510W on firmware 1.3.4 speak TPAP and work with the switch off.
- A C210 on firmware 1.5.2 does not speak TPAP. The library logs in over AES SSL, and the camera refuses that login while the switch is off, so it works only with the switch on.
- An H200 camera hub on firmware 1.7.5 announces AES SSL whether the switch is on or off, and the library logs in over that. Camera hubs do not speak TPAP yet.
So 'the switch can stay off' is true for lights, plugs, power strips and the H100 hub. For cameras it is a per-model question. If you manage a mixed fleet, test each camera model and firmware pair before telling anyone to flip the setting back.
The old AES protocol is gone
While one protocol arrived, another left. The original AES protocol, the one KLAP replaced in 2023, was still in the library. It probed every light and plug it connected to by IP address to find out whether the device wanted that protocol or KLAP. No firmware has shipped with it for a long time, so v0.11.0 removes it.
Do not confuse it with AES SSL, which stays. AES SSL is the one cameras and camera hubs speak. It is a close relative, the same kind of encrypted envelope, but over HTTPS and with a different login. If you grep the changelog for 'AES' while upgrading, the removal and the retained protocol are two separate entries.
Why the switch is a downgrade
Turning Third-Party Compatibility on swaps the new login for the old one, and the new one is better. KLAP proves that both sides know your credentials by exchanging hashes built from them and from two random values sent in the clear. That is the protocol you fall back to when you flip the switch for a plug or light.
TP-Link has never documented TPAP, so what a client knows about it comes from reverse engineering. The library author's write-up goes into how the TPAP login differs from KLAP, and we are not going to paraphrase it beyond the point we can stand behind. The practical consequence is simple enough: a script that works with the switch off is a script that did not need the security trade-off in the first place.
Where this does not fit
Check the following before you rely on it:
- Some cameras still need the switch on. The C210 on firmware 1.5.2 is the documented example, and others may behave the same way.
- The library is unofficial. It follows a protocol TP-Link has never published, and the history above is three breaking changes in three years. A firmware update can break a working setup again, and pinning firmware is not always possible on devices that auto-update.
- Lockouts are real. Test credentials by hand before you deploy them to a scheduled job or a service that restarts itself.
- Lights, plugs and strips are the confident case. For anything else, read the release notes for your exact model before you decide the switch can stay off.
- #KLAP
- #Python
- #TP-Link
- #TPAP
- #Third-Party Compatibility
- #tapo


Comments