Package: estimenergy
EstimEnergyEstimEnergy 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.InstallationCreate the following directories:/path/to/appdata/estimenergy/config/path/to/appdata/estimenergy/postgresql/path/to/appdata/estimenergy/influxdb/path/to/appdata/estimenergy/prometheusCreate a configuration file namedconfig.ymlin the config directory.db:url:"postgresql://estimenergy:<db-password>@estimenergy-postgresql:5432/estimenergy?sslmode=disable"influxdb:url:http://estimenergy-influxdb:8086org:estimenergytoken:<influx-token>bucket:estimenergyNow you can deploy the application stack using the exampledocker-composeconfiguration.
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 theconfig.ymlfile.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 tosqlite:////config/estimenergy.db. Using an external database is recommended, since the Grafana dashboard needs to access the database directly.# docker-composeservices:estimenergy:# ...volumes:-/path/to/appdata/estimenergy/config:/configestimenergy-postgresql:# ...volumes:-/path/to/appdata/estimenergy/postgresql:/var/lib/postgresql/dataestimenergy-influxdb:# ...volumes:-/path/to/appdata/estimenergy/influxdb:/var/lib/influxdb2estimenergy-prometheus:# ...volumes:-/path/to/appdata/estimenergy/prometheus:/prometheusNow you should have EstimEnergy running on port12321, a prometheus collector running at port9090, InfluxDB at port8086and PostgreSQL at port5432.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.timeand--storage.tsdb.retention.sizecommand 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 IntegrationInstall 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 theTotal EnergyandTotal Costentities as data sources for the Home Assistant Energy Dashboard.Specificationconfig.ymloptiontypedescriptiondbdictDatabase configurationdb.urlstrDatabase URLinfluxdbdictInfluxDB configurationinfluxdb.urlstrInfluxDB URLinfluxdb.orgstrInfluxDB organizationinfluxdb.tokenstrInfluxDB tokendeviceoptiontypedescriptionnamestrUser defined name for the collectorhoststrThe hostname or IP of the collectorportintThe port of the collectorpasswordstrThe password of the collector configured in ESPHomecost_per_kwhfloatMoney spent per kilowatt hour usedbase_cost_per_monthfloatUsage independent cost per monthpayment_per_monthfloatMoney prepaid per monthbilling_monthintMonth in which the billing period beginsmin_accuracyfloatMinimum accuracy required to avoid estimating the month or day