Rewrite electricity-logger to use an sqlite3 database
This commit is contained in:
24
docs/ELECTRICITY_LOGGER.md
Normal file
24
docs/ELECTRICITY_LOGGER.md
Normal 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.
|
||||
Reference in New Issue
Block a user