Implementation of Tapo API using a reverse engineering blog post.
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()
go install github.com/richardjennings/tapo
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
}
}