FHEM-Log-Parser/README.md

61 lines
1.8 KiB
Markdown
Raw Permalink Normal View History

2018-02-18 23:02:44 +01:00
# Wonderful FHEM log parser!
2018-02-18 23:04:09 +01:00
Parses `fhem` logs. Primarily used to calculate how much `heat` was used.
2018-02-18 23:02:44 +01:00
> Use with care. May bite if not fed properly.
## Installation
1. Clone the repo:
2018-02-18 23:04:09 +01:00
```
2018-02-18 23:02:44 +01:00
git clone https://github.com/vale981/Da.git
2018-02-18 23:04:09 +01:00
```
2018-02-18 23:02:44 +01:00
2. Install the requirements (/note that on your system `pip` may be `pip3` etc./):
2018-02-18 23:04:09 +01:00
```
2018-02-18 23:02:44 +01:00
pip -r requirements.txt
2018-02-18 23:04:09 +01:00
```
2018-02-18 23:02:44 +01:00
3. Enjoy!
## Usage
2018-02-18 23:04:09 +01:00
```
2018-02-18 23:02:44 +01:00
usage: parseLogs.py [-h] [--parse FILE [FILE ...]] [--list]
[--heatAmmount HEATER] [--allHeatAmmount]
[--timeSpan t1..t2 | t1 | ..t2] [--verbose]
Parse the FHEM logfiles into a Database.
optional arguments:
-h, --help show this help message and exit
--parse FILE [FILE ...], -p FILE [FILE ...]
List of Logfiles to Parse.
--list, -l List all Heaters in the Database.
--heatAmmount HEATER Sum of the actuator value times a time slice.
--allHeatAmmount Get the heat ammount from all known heaters.
--timeSpan t1..t2 | t1 | ..t2
The time span for the heatAmmount calculation. Either
t1/t2 or both may be supplied.
--verbose, -v Output names and dates.
2018-02-18 23:04:09 +01:00
```
2018-02-18 23:02:44 +01:00
If run without arguments, the script will spit out the total heat amount for all heaters.
### Output Formating, Usage
Get the accumulated heat of `OG2_303_RT_01`:
2018-02-18 23:04:09 +01:00
```
2018-02-18 23:02:44 +01:00
# ./parseLogs.py --heatAmmount OG2_303_RT_01 --timeSpan '1 may 2016'..'1 june 2016' --verbose
OG2_303_RT_01, 0, 1462053600, 1464732000
2018-02-18 23:04:09 +01:00
```
2018-02-18 23:02:44 +01:00
Less info:
2018-02-18 23:04:09 +01:00
```
2018-02-18 23:02:44 +01:00
# ./parseLogs.py --heatAmmount OG2_303_RT_01 --timeSpan '1 may 2016'..'1 june 2016'
OG2_303_RT_01, 0, 1462053600, 1464732000
2018-02-18 23:04:09 +01:00
```
2018-02-18 23:02:44 +01:00
From the earliest record till a given date:
2018-02-18 23:04:09 +01:00
```
2018-02-18 23:02:44 +01:00
# ./parseLogs.py --heatAmmount OG2_303_RT_01 --timeSpan ..'1 june 2016'
OG2_303_RT_01, 285457264, 0, 1464732000
2018-02-18 23:04:09 +01:00
```
2018-02-18 23:07:44 +01:00