Hey,
I tried to set up a logWatcher device to parse the data from the miflora plant monitor into pimatic. The used script is working well and I get my logs to where I want to have them and read them once, but if the logfile changes the device is not updated.
I tried multiple logWatcher devices with different logfiles, but all behave the same way: In case I restart pimatic or recreate the device it reads the content from the logfile and shows correct values. But when the logfile changes (new data from sensor) it is ignored. Do I have to invoke a manuall refresh somehow?
here my device config:
{
"file": "/home/pi/miflora/wohnzi.log",
"attributes": [
{
"name": "Temperature",
"type": "number",
"unit": "°C",
"acronym": "🌡"
},
{
"name": "Moisture",
"type": "number",
"unit": "%",
"acronym": "💦"
},
{
"name": "Light",
"type": "number",
"unit": "lux",
"acronym": "💡"
},
{
"name": "Conductivity",
"type": "number",
"unit": "us/cm"
},
{
"name": "Battery",
"type": "number",
"unit": "%",
"acronym": "🔋"
}
],
"lines": [
{
"match": "Temperature: (.+)",
"predicate": "miflora.temperature",
"Temperature": "$1"
},
{
"match": "Moisture: (.+)",
"predicate": "miflora.moisture",
"Moisture": "$1"
},
{
"match": "Light: (.+)",
"predicate": "miflora.light",
"Light": "$1"
},
{
"match": "Conductivity: (.+)",
"predicate": "miflora.conductivity",
"Conductivity": "$1"
},
{
"match": "Battery: (.+)",
"predicate": "miflora.battery",
"Battery": "$1"
}
],
"xAttributeOptions": [],
"id": "miflora-wohnzi",
"name": "Pflanzen Wohnzimmer",
"class": "LogWatcher"
},
and one of the logfiles:
pi@raspberrypi:~/miflora $ nano wohnzi.log
GNU nano 2.2.6 Datei: wohnzi.log
Getting data from Mi Flora
FW: 2.8.6
Name: Flower care
Temperature: 19.6
Moisture: 64
Light: 52
Conductivity: 1070
Battery: 100