Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

estimenergy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

estimenergy

Estimate Energy Consumption

  • 2.1.2
  • PyPI
  • Socket score

Maintainers
1

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
optiontypedescription
dbdictDatabase configuration
db.urlstrDatabase URL
influxdbdictInfluxDB configuration
influxdb.urlstrInfluxDB URL
influxdb.orgstrInfluxDB organization
influxdb.tokenstrInfluxDB token
device
optiontypedescription
namestrUser defined name for the collector
hoststrThe hostname or IP of the collector
portintThe port of the collector
passwordstrThe password of the collector configured in ESPHome
cost_per_kwhfloatMoney spent per kilowatt hour used
base_cost_per_monthfloatUsage independent cost per month
payment_per_monthfloatMoney prepaid per month
billing_monthintMonth in which the billing period begins
min_accuracyfloatMinimum accuracy required to avoid estimating the month or day

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc