Skip to content

Latest commit

 

History

History
96 lines (75 loc) · 8.5 KB

README.md

File metadata and controls

96 lines (75 loc) · 8.5 KB

tapo-api

An unofficial TPLink Tapo API Client written in Go.

GitHub Release GitHub go.mod Go version GitHub License

Reverse engineered from https://k4czp3r.xyz/blog/post/reverse-engineering-tp-link-tapo
Reference implementation: https://github.com/mihai-dinculescu/tapo

Docs: https://pkg.go.dev/github.com/fabiankachlock/tapo-api

Usage

go get github.com/fabiankachlock/tapo-api
package main

import (
	"log"
	"os"

	"github.com/fabiankachlock/tapo-api"
)

func main() {
	tapoIp := "192.168.0.2"
	tapoEmail := os.Getenv("TAPO_EMAIL")
	tapoPass := os.Getenv("TAPO_PASS")

	client := tapo.NewClient(tapoEmail, tapoPass)
	device, err := client.P115(tapoIp)
	if err != nil {
		log.Fatalln(err)
	}

	device.Toggle()
}

Device support

Supported Devices:

  • P110
  • P115 (tested)

Supported Protocols:

  • KLAP

✅ - Implemented
✓ - Supported by reference implementation in rust

Feature


GenericDevice


L510
L520
L610
L530
L630

L900


L920
L930

P100
P105

P110
P115

P300


H100


device_reset
get_child_device_component_list_json
get_child_device_list
get_child_device_list_json
get_current_power
get_device_info
get_device_info_json
get_device_usage
get_energy_data
get_energy_usage
off
on
refresh_session
set_brightness
set_color
set_color_temperature
set_hue_saturation
set_lighting_effect
set() API *

* The set() API allows multiple properties to be set in a single request.

Hub (H100) Child Devices Support

Feature

KE100

S200B

T100

T110

T300

T310
T315
get_device_info *
get_device_info_json
get_temperature_humidity_records
get_trigger_logs
set_child_protection
set_frost_protection
set_max_control_temperature
set_min_control_temperature
set_target_temperature
set_temperature_offset

* Obtained by calling get_child_device_list on the hub device or get_device_info on a child device handler.