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