Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/half-shot/autopowerbill

Calculate the cost of power usage from a power monitor, hooked up to Octopus UK energy prices.
https://github.com/half-shot/autopowerbill

iot mqtt octopus-energy

Last synced: 11 days ago
JSON representation

Calculate the cost of power usage from a power monitor, hooked up to Octopus UK energy prices.

Awesome Lists containing this project

README

        

# autopowerbill
Calculate the cost of power usage from a power monitor, hooked up to Octopus UK Agile energy prices.

This tool will measure the amount of kwh used between monitoring periods, and work out with reasonable
accuracy how much power was used between two points and therefore which prices apply. The more often
power is reported, the better the accuracy.

New prices are automatically fetched every 3 hours.

### Usage

You need to install Rust. And if you don't have it, you have some important life questions to ask yourself.

You can then run `-h` to get the command line arguments.
```sh
cargo run -- -h

Monitors telemetry from a Tasmota Smart Plug and accurate records the costs for each period of use, using Octopus Agile energy prices

Usage: autopowerbill [OPTIONS] --host --topic --product-code --tariff-code --database

Options:
--host MQTT broker host name
-p, --port MQTT broker port
-t, --topic MQTT topic
--product-code Octopus Energy product code
--tariff-code Octopus Energy tariff code
--database Postgres database connection string
-h, --help Print help
-V, --version Print version
```

For example, you can (after running `cargo install`) do:

```sh
autopowerbill --product-code "AGILE-24-04-03" --tariff-code "E-1R-AGILE-24-04-03-D" --topic "tele/your-device-topic/SENSOR" --host 'your-broker-address' --database 'postgres://connectionstring'
```

to start recording data. Data is automatically recorded into two CSV files:

- `powerusage.csv` contains the total power usage at a given timestamp.
- `,`
- `costfile.csv` contains the costs incurred since the last recorded time.
- `,,,`