After spending hours getting the logreader coöp with my PV energy log in CSV format. I noticed that i’m missing the unit for values defined as string.
- Log content:
id, total-on-time, uptime, total-kWh, actual-W, peak-W, resets, time
cf7d, 34378228, 15349134, 671.79, 162.0, 701.4, 3, 1427723302.97
{
"id": "PV-Tuinhuis",
"name": "PV-Tuinhuis",
"class": "LogWatcher",
"file": "/home/pi/scripts/ec3k/ec3k2file.log",
"attributes": [
{
"name": "Actual1",
"type": "number",
"unit": "Watt"
},
{
"name": "Total",
"type": "string",
"unit": "kWh"
},
{
"name": "Peak",
"type": "string",
"unit": "Watt"
}
],
"lines": [
{
"match": "\\s*cf7d, \\d*, \\d*, \\d*.\\d*, (.+)",
"Actual1": "$1"
},
{
"match": "\\s*cf7d, \\d*, \\d*, (\\d*.\\d*)",
"Total": "$1"
},
{
"match": "\\s*cf7d, \\d*, \\d*, \\d*.\\d*, \\d*.\\d*, (\\d*.\\d*)",
"Peak": "$1"
}
]
},
The right results are showed in pimatic, but without showing the “Unit”, when I change “string” into “number” “Unit” shows up, but I don’t want a Graph for all available log fields.
Is this a bug in the log-reader plugin? Or do I need to submit the Unit after $1? if so, how?