Giter VIP home page Giter VIP logo

plugmon's Introduction

Plugmon

This is a monitoring exporter for a smart plug I own.

It works with the Watts Clever INPLUG, and exports data for use by Prometheus.

The protocol

Here are some notes about the protocol that I have reverse engineered so far.

(https://github.com/Diagonactic/Ankuoo was a good starting point.)

It operates using a custom protocol via UDP on port 80. My best guess why they use that port for a non-HTTP protocol is to make it more likely to get past firewalls.

If you send a broadcast UDP message with 48 bytes that look like this:

	// These first 32 bytes will be echoed back.
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x0a, 0x00, 0x00, 0x00, 0xe1, 0x07, 0x05, 0x0c,
	0x01, 0x06, 0x1d, 0x04, 0x00, 0x00, 0x00, 0x00,
	10, 0, 0, 2,  // your local IP
	portLo, portHi,  // your local UDP port, little endian
	0x00, 0x00,

	// dunno what the rest is for
	0x8c, 0xc1, 0x00, 0x00, 0x00, 0x00,
	0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

then INPLUGs on the network will respond back. See ping.go for some initial work on decoding that.

plugmon's People

Contributors

dsymonds avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.