Skip to content

richardjennings/tapo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tapo SmartPlug API Client

About

Implementation of Tapo API using a reverse engineering blog post.

Library

    import (
        "github.com/richardjennings/tapo/pkg/tapo"
    )

    var t *tapo.Tapo
    var r map[string]interface{}
    var err error

    t, err = tapo.NewTapo("192.168.0.200", "username", "password")
    r, err = t.TurnOn()
    r, err = t.TurnOff()
    r, err = t.GetEnergyUsage()
    r, err = t.DeviceInfo()

CLI

go install github.com/richardjennings/tapo

Usage

tapo <ip-address> <username> <password> [on, off, energy-usage, device-info]

For example:

tapo 192.168.0.101 email@address thepassword energy-usage
{
  "error_code": 0,
  "result": {
    "current_power": 0,
    ...
    "month_energy": 10000,
    "month_runtime": 10000,
    "today_energy": 400,
    "today_runtime": 300
  }
}

Used By