Giter Site home page Giter Site logo

eulemitkeule / estimenergy Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 444 KB

EstimEnergy is tool for monitoring and estimating energy usage and cost built with FastAPI and Angular.

License: MIT License

Python 73.51% Dockerfile 0.82% Shell 0.09% TypeScript 15.26% HTML 10.27% CSS 0.06%
energy energy-calculator energy-consumption fastapi home-assistant python estimenergy home-assistant-glow angular

estimenergy's Introduction

PyPI hacs_badge

Publish Code Quality

EstimEnergy

EstimEnergy is tool for monitoring and estimating energy usage and cost. It consists of a FastAPI backend that collects data from a device, an Angular frontend for configuration and a HACS enabled custom integration for Home Assistant that exposes the data via a sensor entity.

Installation

Create the following directories:

/path/to/appdata/estimenergy/config
/path/to/appdata/estimenergy/postgresql
/path/to/appdata/estimenergy/influxdb
/path/to/appdata/estimenergy/prometheus

Create a configuration file named config.yml in the config directory.

db:
  url: "postgresql://estimenergy:<db-password>@estimenergy-postgresql:5432/estimenergy?sslmode=disable"

influxdb:
  url: http://estimenergy-influxdb:8086
  org: estimenergy
  token: <influx-token>
  bucket: estimenergy

Now you can deploy the application stack using the example docker-compose configuration. Add mounting paths according to where you created the corresponding directories.

Using InfluxDB and Prometheus is optional. If you don't want to use InfluxDB, you need to remove the configuration from the config.yml file.

Postgres is also optional and can be replaced with any other SQL database including SQLite. If you want to use SQLite, you need to change to database URL in the config file to sqlite:////config/estimenergy.db. Using an external database is recommended, since the Grafana dashboard needs to access the database directly.

# docker-compose

services:
  estimenergy:
    # ...
    volumes:
      - /path/to/appdata/estimenergy/config:/config

  estimenergy-postgresql:
    # ...
    volumes:
      - /path/to/appdata/estimenergy/postgresql:/var/lib/postgresql/data

  estimenergy-influxdb:
    # ...
    volumes:
      - /path/to/appdata/estimenergy/influxdb:/var/lib/influxdb2

  estimenergy-prometheus:
    # ...
    volumes:
      - /path/to/appdata/estimenergy/prometheus:/prometheus

Now you should have EstimEnergy running on port 12321, a prometheus collector running at port 9090, InfluxDB at port 8086 and PostgreSQL at port 5432.

Prometheus will scrape the metrics exposed by EstimEnergy every 15 seconds and keep the data for five years or until 1TB of space is used. This can be configured using the --storage.tsdb.retention.time and --storage.tsdb.retention.size command options in the docker-compose file.

You should now be able to access the web UI at port 12321. You will have to create one or more devices and configure them using your energy contract data.

Home Assistant Integration

Install the repository in HACS via the custom repository option. After restarting Home Assistant you can add and configure the integration in the integrations UI. You need to provide the hostname or IP of the EstimEnergy docker container and the port on which it is running on.

This will create sensor entities for each collector and each metric that is being collected. You can use the Total Energy and Total Cost entities as data sources for the Home Assistant Energy Dashboard.

Specification

config.yml

option type description
db dict Database configuration
db.url str Database URL
influxdb dict InfluxDB configuration
influxdb.url str InfluxDB URL
influxdb.org str InfluxDB organization
influxdb.token str InfluxDB token

device

option type description
name str User defined name for the collector
host str The hostname or IP of the collector
port int The port of the collector
password str The password of the collector configured in ESPHome
cost_per_kwh float Money spent per kilowatt hour used
base_cost_per_month float Usage independent cost per month
payment_per_month float Money prepaid per month
billing_month int Month in which the billing period begins
min_accuracy float Minimum accuracy required to avoid estimating the month or day

estimenergy's People

Contributors

eulemitkeule avatar mifiamigahna avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

estimenergy's Issues

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Cannot push to the Git repository.

semantic-release cannot push the version tag to the branch master on the remote Git repository with URL https://x-access-token:[secure]@github.com/EuleMitKeule/EstimEnergy.

This can be caused by:


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Missing package.json file.

A package.json file at the root of your project is required to release on npm.

Please follow the npm guideline to create a valid package.json file.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

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.