Rewrite electricity-logger to use an sqlite3 database

This commit is contained in:
2022-06-25 22:17:46 +02:00
parent 458d824dc8
commit 5b09b06bcf
62 changed files with 5937 additions and 3 deletions

View File

@@ -0,0 +1,24 @@
## About
This small tool is meant for logging the electricity values from the `Landis Gyr E350` electricity meter. As a bonus it also stores the gas concumption values.
## Example Usage
```bash
#!/bin/bash
directoryPath="/var/log/electricity/$(date +%Y/)"
if ! [ -d "$directoryPath" ]; then
mkdir -p "$directoryPath"
fi
outputFile="$directoryPath$(date +%m_%d.txt)"
if ! [ -f "$outputFile" ]; then
touch "$outputFile"
fi
datestr="$(date +%Y-%m-%dT%T)"
electricity-logger -c "$datestr" /dev/ttyUSB0 >> "$outputFile"
```
Use the `--help` switch for more information about the possible arguments `electricity-logger` can take.