
This is a basic command-line interface for TP-Link Kasa Control – Smartplug/Smart bulb control for Windows, this is based on reverse engineering of the TPLink protocol. It is still a work in progress, so please check back for updates.
If you have any issues please let me know in the comments below.
Instructions
Command Line

This allows batch scripts to control devices.
The login command is only required once per session, this saves the Username and Password for multiple commands, Logoff clears them.
Example Script TPLinkCmd -login -username "test@account.com" -password "password" TPLinkCmd -device "LAMP" -on TPLinkCmd -device "LAMP" -brightness 20 TPLinkCmd -device "BEDROOM" -off TPLinkCmd -logoff
Commands TPLinkCmd -login -username "test@account.com" -password "password" Login: OK TPLinkCmd -devicelist DOOR,PLUG,HS100(UK) BEDROOM,PLUG,HS100(UK) SERVER,PLUG,HS110(UK) LAMP,BULB,LB110(EU) TPLinkCmd -device "BEDROOM" -on Relay: 1 TPLinkCmd -device "BEDROOM" -off Relay: 0 TPLinkCmd -device "BEDROOM" -toggle Relay: 1 TPLinkCmd -device "BEDROOM" -status Relay: 0 or 1 TPLinkCmd -device "BEDROOM" -brightness 62 Relay: 1 Brightness: 62 TPLinkCmd -logoff Logoff: Ok
Supported Devices and Actions
Please let me know in the comments if there are missing working devices in this list, I cannot test all Kasa devices only the ones I own.
HS100/HS110
- Relay On/Off/Toggle
KP115
- Relay On/Off/Toggle
KP303 (3 Way Powerstrip)
- Each socket Relay On/Off/Toggle
LB100
- Relay On/Off/Toggle
LB110/LB120/LB130
- Relay On/Off/Toggle
- Brightness
Download

I’ve purchased TPLinkCmd but when I put the login option into a script it always fails to login successfully (works OK if I type it in a command window) and the logoff command, in a command window, always brings up the help text rather than logging off. I’m using this with Windows 11.
I have created a ticket on https://rewsteruk.freshdesk.com
Works well, using the task scheduler trigger to turn on lamps when the computer wakes up from sleep. It does seem pretty slow, but it gets the job done.
Hi Mr. Rewster,
Just wanted to say that I love you for making this application. It works so well for my home studio application. Now my phone can be in the other room (where i like it) and I can still turn on and off various outlets in the room. YOU’RE THE MAN!!!!
Thanks for the nice comment