I tried to run a very simple typescript application:
import {login} from "tplink-cloud-api";
const main = async () => {
let tplink = await login(user, pass, "TermID");
let deviceList = await tplink.getDeviceList();
try {
const relayState = await tplink.getHS110(deviceList[1].alias).get_relay_state()
console.log("relay state: " + relayState.toString())
}
catch(ex){
console.log(ex.toString())
}
}
main()
I always get an Exception : Error: response error: code=-20571, status="", message="Device is offline"
I have two plugs, one is defined in the Tapo app, the second one is shared plug coming form another account, which I can monitor from the Tapo app. Also the getDeviceList returns the list of device, but not the name used in the Tapo app
Am I doing something wrong ?
Thanks
Nicolas
I tried to run a very simple typescript application:
import {login} from "tplink-cloud-api";
const main = async () => {
let tplink = await login(user, pass, "TermID");
let deviceList = await tplink.getDeviceList();
try {
const relayState = await tplink.getHS110(deviceList[1].alias).get_relay_state()
console.log("relay state: " + relayState.toString())
}
catch(ex){
console.log(ex.toString())
}
}
main()
I always get an Exception : Error: response error: code=-20571, status="", message="Device is offline"
I have two plugs, one is defined in the Tapo app, the second one is shared plug coming form another account, which I can monitor from the Tapo app. Also the getDeviceList returns the list of device, but not the name used in the Tapo app
Am I doing something wrong ?
Thanks
Nicolas