1
Votestplink-cloud-api: Error: code=-23003v"App version is too old"
tplink-cloud-api: Error: code=-23003v"App version is too old"
I am trying to use the Kasa tplink-cloud-api in my Node.js Express application. When I try to authenticate, i.e., const tplink = await login(username, password, terminalUUID), I get the error code noted in my subject line.
I've installed the latest version of tplink-cloud-api (0.8.1). I know that part of it is working because if I intentionally insert the wrong email, I get an error saying the email or password does not match.
The code is straightforward:
async function outletInfo() { const username = "XXXX@gmail.com"; const password = "XXXX"; const { v4: uuidv4 } = require('uuid'); const terminalUUID = uuidv4();try { try { // Log in to the TP-Link Cloud API and get an instance const tplink = await login(username, password, terminalUUID); console.log("Logged in successfully. Token:", tplink.getToken()); // Retrieve the device list registered to your account const deviceList = await tplink.getDeviceList(); console.log("Device List:", JSON.stringify(deviceList, null, 2)); // Assume you have a smart plug with an alias "My Smart Plug" const smartPlug = tplink.getHS100("My Smart Plug"); // Toggle the smart plug (if it's on, this will turn it off; if off, it will turn it on) const toggleResponse = await smartPlug.toggle(); console.log("Toggle Response:", JSON.stringify(toggleResponse, null, 2)); } catch (error) { console.error("Error:", error); } }