OiO.lk Blog python Unable to connect to Kasa Smart Plug via tp-link
python

Unable to connect to Kasa Smart Plug via tp-link


I have one Kasa Smart Plug HS103P4. Its connected to WiFi and working. I have registered it in TP Link and Kasa Smart app on Android Device. I used python-kasa to discover the device and get its host IP which is 192.168.x.x.

Now I want to connect to this smart plug in a different country. I dont want to use Mobile application, alexa or any other software for this.

How can I access this smartplug.

I tried using tp-link-cloud-api, but I am getting error.

import requests


payload = {
        "method": "login",
        "params": {
            "appType": "Kasa_Android",
            "cloudUserName": kUser,
            "cloudPassword": kSecret,
            "terminalUUID": str(uuid.uuid4())
        }
}

response = requests.post(url="https://wap.tplinkcloud.com/", json=payload)
obj = response.json()
print(obj)

Response : {‘error_code’: -23003, ‘msg’: ‘App version is too old’}

NOTE : The kUser and kSecret are same as the one user for Registering the device in TP link and Kasa Smart App.

Please guide me on this and ways to connect to this Smart Plug.



You need to sign in to view this answers

Exit mobile version