Git Product home page Git Product logo

emeter's Introduction

emeter

Publish Kasa plug metrics to Influx Cloud

emeter-volts emeter-watts emeter-milliamps

Setup

Usage

The following env variables are required:

  • INFLUX_TOKEN: API Token provided by Influx Cloud
  • INFLUX_ORG: Your Influx Cloud organization name
  • INFLUX_BUCKET: Your Influx Cloud bucket name (Default: power-usage)
  • PLUG: IP Address of the Kasa plug to monitor

Additional supported env variables include:

  • DEBUG: Enable or disable in-app debug logging (Default: False)
  • DEVICE: Preferred name for this device (Default: My Device)
  • INFLUX_HOST: Host of the Influx Cloud bucket (Default: https://us-central1-1.gcp.cloud2.influxdata.com)

Launch

The application can be launched with docker-compose:

docker-compose up -d

Dashboard

A sample dashboard is provided in this repo and can be imported:

  • Ensure that emeter is running
  • Login to Influx Cloud and go to Dashboards
  • Use the dropdown on Create Dashboard to import the template

emeter's People

Contributors

imgbotapp avatar jonfairbanks avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

emeter's Issues

Self-hosted Influxdb

I am using the Docker image via Docker Hub. With the INFLUX_HOST environment variable, is the expectation that I can point this tool to my own self-hosted instance if InfluxDb (v2.4.0)? I have tried but I get the following error. Am I simply trying to do something that isn't possible?

Traceback (most recent call last):
  File "/home/python/app/main.py", line 62, in <module>
    asyncio.run(main())
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/home/python/app/main.py", line 20, in main
    client = InfluxDBClient(url=HOST, token=TOKEN, org=ORG)
  File "/home/python/.local/lib/python3.9/site-packages/influxdb_client/client/influxdb_client.py", line 55, in __init__
    super().__init__(url=url, token=token, debug=debug, timeout=timeout, enable_gzip=enable_gzip, org=org,
  File "/home/python/.local/lib/python3.9/site-packages/influxdb_client/client/_base.py", line 59, in __init__
    self.auth_header_value = "Token " + auth_token
TypeError: can only concatenate str (not "NoneType") to str
Exception ignored in: <function InfluxDBClient.__del__ at 0x1497a69101f0>
Traceback (most recent call last):
  File "/home/python/.local/lib/python3.9/site-packages/influxdb_client/client/influxdb_client.py", line 262, in __del__
AttributeError: 'InfluxDBClient' object has no attribute 'api_client'
EMeter is running...

Support Multiple Plugs

This is working well for me, thanks for your work. May I make a suggestion for an enhancement? Currently for multiple plugs I need to run multiple containers; it would be great to be able to specify a list of plugs to get data from. I'm not sure whether each one ought to go in to its own bucket or into the same bucket.

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.