Skip to content

solectrus/power-splitter

Repository files navigation

Continuous integration Maintainability wakatime Test Coverage

Power Splitter

This tool retrieves power consumption data from an InfluxDB database. It then divides up the total power imported from the grid among various users, such as a heat pump, a wallbox, and the household.

This enables SOLECTRUS to accurately calculate the electricity usage and costs for each distinct consumer. This is especially useful in settings where multiple devices or systems are drawing power.

Requirements

  • InfluxDB 2 database with a bucket filled with values for:
    • Grid import power
    • House power
    • Heatpump power and/or Wallbox power
  • Linux machine with Docker installed

Getting started

  1. Make sure that your InfluxDB2 database is ready (not subject of this README)

  2. Prepare an .env file (see .env.example)

  3. Run the Docker container on your Linux box:

    docker compose up

The Docker image supports multiple platforms: linux/amd64, linux/arm64

To force a data rebuild, you can send USR1 signal to the container:

docker compose kill --signal USR1 power-splitter

Development

For development you need a recent Ruby setup. On a Mac, I recommend rbenv.

Run the app

bundle exec app.rb

Run tests

bundle exec rspec

Run linter

bundle exec rubocop

License

Copyright (c) 2024 Georg Ledermann georg@ledermann.dev