Giter VIP home page Giter VIP logo

tp-link-hs110's Introduction

TPLINKHS110

TP-Link has a set of interesting WiFi smart plugs -- the HS100 which provides remote access and control for a power plug, and HS110 which is essentially HS100 but with energy monitoring.

tplinkhs110 is a Go library for accessing these smart plugs, based on the information available above. I have tested them out with a HS110 only and it works perfectly fine. An example of how to use this library is:

package main

import (
	"fmt"
	"github.com/shirdonl/tplinkhs110"
)

func main() {
	plug := tplinkhs110.Hs1xxPlug{IPAddress: "192.168.0.196"}
	results, err := plug.MeterInfo()
	if err != nil {
		fmt.Println("err:", err)
	}
	fmt.Println(results)

}

The results printed (after cleaning up):

{
	"emeter": {
		"get_realtime": {
			"current": 0.015135,
			"voltage": 296.213416,
			"power": 1.193017,
			"total": 0.061,
			"err_code": 0
		},
		"get_vgain_igain": {
			"vgain": 16566,
			"igain": 13042,
			"err_code": 0
		}
	}
}

Functions include:

  • TurnOn() -- turning on the power on the plug
  • TurnOff() -- turning off the power on the plug
  • SystemInfo() -- getting information on the plug
  • MeterInfo() -- metering info on the plug, including the current, voltage, power and the total power consumption till date, as well as the vgain and igain
  • DailyStats(month, year) -- energy consumed per day for the given month and year

tp-link-hs110's People

Contributors

shirdonl avatar

Stargazers

superman avatar  avatar xinglongshuai avatar  avatar leastismost avatar barry avatar  avatar

Watchers

James Cloos avatar  avatar leastismost avatar  avatar  avatar xinglongshuai avatar barry avatar superman avatar

Forkers

freqeur

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.