Description
Tapo devices (P100 plug, L530 bulb) return "Device is offline" (error -20571) even when the devices are online and controllable through the official Tapo app.
Probably root cause: Tapo devices from the Kasa device list are incorrectly treated as Kasa devices — they get cloud_type: "kasa", are POSTed to the Kasa app server (e.g., n-aps1-wap.tplinkcloud.com) instead of the Tapo gateway (n-aps1-wap-gw.tplinkcloud.com), and receive Kasa-format passthrough payloads instead of Tapo-format.
Device info
- Device model: P100(EU)
- Device firmware version: 1.4.3 Build 251205
- Device type: SMART.TAPOPLUG
Environment
- Python version: 3.13
- tplink-cloud-api version: latest
- OS: macOS
Steps to reproduce
- Log in with credentials that have Tapo devices on the account.
- Call device_manager.get_devices().
- Observe that the Tapo P100 plug is assigned cloud_type: "kasa" and class TPLinkDevice (fallback).
- Call device.get_sys_info() — it POSTs to the Kasa app server (n-aps1-wap.tplinkcloud.com) with a Kasa-format payload ({"system": {"get_sysinfo": null}}).
- The Kasa server returns -20571 "Device is offline" because Tapo devices cannot be reached through the Kasa passthrough endpoint.
What should happen
- Devices with deviceType: "SMART.TAPOPLUG" or "SMART.TAPOBULB" should be detected as Tapo regardless of which cloud's device list they appear in.
- Passthrough requests should POST to the Tapo gateway URL (n-aps1-wap-gw.tplinkcloud.com) returned by the Tapo login.
- requestData should use Tapo-format JSON: {"method": "get_device_info"} instead of {"system": {"get_sysinfo": null}}.
- Response parsing should handle Tapo's {"method": "get_device_info", "result": {...}} structure instead of Kasa's {"system": {"get_sysinfo": {...}}}.
Description
Tapo devices (P100 plug, L530 bulb) return "Device is offline" (error -20571) even when the devices are online and controllable through the official Tapo app.
Probably root cause: Tapo devices from the Kasa device list are incorrectly treated as Kasa devices — they get cloud_type: "kasa", are POSTed to the Kasa app server (e.g., n-aps1-wap.tplinkcloud.com) instead of the Tapo gateway (n-aps1-wap-gw.tplinkcloud.com), and receive Kasa-format passthrough payloads instead of Tapo-format.
Device info
Environment
Steps to reproduce
What should happen