All Projects → jamesbarnett91 → Tplink Energy Monitor

jamesbarnett91 / Tplink Energy Monitor

Licence: gpl-3.0
An energy monitoring dashboard for TP-Link smart plugs

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Tplink Energy Monitor

Esp Dash
A blazing fast library to create a functional dashboard for ESP8266 and ESP32
Stars: ✭ 548 (+73.42%)
Mutual labels:  graph, chart, dashboard
Swiftcharts
Easy to use and highly customizable charts library for iOS
Stars: ✭ 2,336 (+639.24%)
Mutual labels:  graph, chart
Flutter Candlesticks
Elegant OHLC Candlestick and Trade Volume charts for @Flutter
Stars: ✭ 318 (+0.63%)
Mutual labels:  graph, chart
Charts
Simple, responsive, modern SVG Charts with zero dependencies
Stars: ✭ 14,112 (+4365.82%)
Mutual labels:  graph, chart
Graphic
A Flutter data visualization library based on Grammar of Graphics.
Stars: ✭ 173 (-45.25%)
Mutual labels:  graph, chart
V Chart Plugin
Easily bind a chart to the data stored in your Vue.js components.
Stars: ✭ 188 (-40.51%)
Mutual labels:  graph, chart
Meter
Laravel package to find performance bottlenecks in your laravel application.
Stars: ✭ 204 (-35.44%)
Mutual labels:  graph, chart
React D3 Components
D3 Components for React
Stars: ✭ 1,599 (+406.01%)
Mutual labels:  graph, chart
Chart.js
Simple HTML5 Charts using the <canvas> tag
Stars: ✭ 55,646 (+17509.49%)
Mutual labels:  graph, chart
Fl chart
A powerful Flutter chart library, currently supporting Line Chart, Bar Chart, Pie Chart, Scatter Chart and Radar Chart.
Stars: ✭ 3,882 (+1128.48%)
Mutual labels:  graph, chart
Datagear
数据可视化分析平台,使用Java语言开发,采用浏览器/服务器架构,支持SQL、CSV、Excel、HTTP接口、JSON等多种数据源
Stars: ✭ 266 (-15.82%)
Mutual labels:  chart, dashboard
Aachartkit Swift
📈📊📱💻🖥️An elegant modern declarative data visualization chart framework for iOS, iPadOS and macOS. Extremely powerful, supports line, spline, area, areaspline, column, bar, pie, scatter, angular gauges, arearange, areasplinerange, columnrange, bubble, box plot, error bars, funnel, waterfall and polar chart types. 极其精美而又强大的跨平台数据可视化图表框架,支持柱状图、条形图、…
Stars: ✭ 1,962 (+520.89%)
Mutual labels:  graph, chart
Npmcharts.com
Compare npm package downloads over time
Stars: ✭ 129 (-59.18%)
Mutual labels:  graph, chart
Jira Dependency Graph
Graph visualizer for JIRA tickets' dependencies
Stars: ✭ 194 (-38.61%)
Mutual labels:  graph, chart
Asciigraph
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.
Stars: ✭ 1,805 (+471.2%)
Mutual labels:  graph, chart
Squid
A Ruby library to plot charts in PDF files
Stars: ✭ 205 (-35.13%)
Mutual labels:  graph, chart
Sparklinelayout
Simple and lightweight library for drawing sparklines / graphs. Support markers and gradients.
Stars: ✭ 291 (-7.91%)
Mutual labels:  graph, chart
Coingraph
Coingraph is a real-time graph for cryptocurrencies.
Stars: ✭ 116 (-63.29%)
Mutual labels:  graph, chart
X6
🚀 JavaScript diagramming library that uses SVG and HTML for rendering.
Stars: ✭ 2,686 (+750%)
Mutual labels:  graph, chart
Clchart
A fast, simple and cross-platform(html5 react-native weex wechat-applet) stock chart library created using canvas.
Stars: ✭ 250 (-20.89%)
Mutual labels:  graph, chart

TPLink Energy Monitor

Build Status Quality Gate

A web based monitoring dashboard displaying energy usage data and statistics for TP-Link HS110 smart plugs.

Written in Node.js + Express, and fully responsive so works well on mobile devices.

Screenshot

Features

  • Automatically scans for TP-Link smart plug devices on your local network on server start.
  • Realtime current, voltage, power readings.
  • Recent power usage trend chart.
  • Configurable power usage history logger.
  • Plug on/off state and uptime.
  • Daily & monthly energy usage totals and averages.
  • Historical daily and monthly energy usage charts.

Setup

You can use any of the following methods to get the project running:

Packaged executable

The easiest way to run the project is to download one of the packaged executables from the releases page. These are zip files containing a single executable file and some config. Just download the relevant file for your OS (Windows, Linux and MacOS available), extract the zip somewhere and double click executable. Then go to localhost:3000 in your browser to access the dashboard.

Docker

Alternatively, you can pull the jbarnett/tplink-energy-monitor image and run that. Note that because the server needs access to your local network to scan for TP-Link devices, you must run the image using host networking e.g.:

$ docker run -d --network host jbarnett/tplink-energy-monitor

Node + NPM

To run directly via NPM:

$ git clone https://github.com/jamesbarnett91/tplink-energy-monitor && cd tplink-energy-monitor
$ npm install
$ npm start

Logging

By default this app will log the current power usage of each plug every minute, and store 24 hours worth of entries (removing the older entries as new ones are added) to files in the root project directory. This log interval, max retention limit and log directory are configurable in the logger-config.json file in the root project directory.

{
  // Directory path specifying where log files should be stored. It will be created if it doesn't already exist.
  "logDirPath": "path/to/logs",

  // The number of seconds between each log entry
  "logIntervalSeconds": 60,

  // The maximum number of log entries to store
  "maxLogEntries": 1440 // 24hrs at 1 log/min
}

You can also specify the path to a custom logger config file as a command line argument, and the application will load that config rather than the default one in the project root e.g.

npm start /home/username/tplink-logger-config.json

The logged data is shown on the 'Logged Usage' graph on the dashboard. Logs are written in JSON format, with the filename <plug-id>-log.json e.g. 8FCA808B79-log.json. Each file contains all the log entries for that plug, up to the maximum configured number, at which point it will remove the oldest entry when adding a new one.

If you are running the app from the Docker image and you want to change the logger config, you can mount your desired config file into /opt/tplink-monitor/. The logs can be accessed in the same way.

Each logfile is a JSON array of entries. Each entry contains a timestamp in unix/epoch format ts, and a power reading in watts pw.

If you want to analyse the log files in Excel or similar office tools you can convert the JSON file into csv format. This can be done numerous ways including online converters such as konklone.io/json, or if you are on a Unix system (or otherwise have access to sed) user ballachango has posted this sed command sed -e 's/},{/\\\n/g' -e 's/[]["tspw:}{\\]//g' <input.json> > log.csv

Note

Because the server needs access to your local network to scan for TP-Link device, you must run the server on the same network which your TP Link plugs are connected to. For the vast majority of people this shouldn't be an issue, and you can still use different network interfaces (i.e. plug(s) on WiFi and server on ethernet) as long as they all connect to the same network.

A note for Windows users: There seems to be an issue with the UDP broadcast the server performs to scan for devices which occurs when you also have VirtualBox installed on your Windows machine. I think this is because the response from the plug is routed to the VirtualBox Host-Only network adapter, rather than your primary network interface (for some reason).

If you hit this issue you can try disabling the VirtualBox adapter in Control Panel > Network and Internet > Network Connections and see if that solves the problem.

TODOs

  • [x] Show historical data
  • [x] Build dists
  • [x] Docker image
  • [x] Support switching between multiple plugs
  • [x] Switch to websockets
  • [x] Configurable realtime usage logging
  • [ ] Show cumulative energy usage form all devices
  • [ ] Rescan for devices on the fly
  • [ ] Add daily cost metrics
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].