Wie nur bestimmte Ereignisse in LOG schreiben?

Begonnen von Vladi2010, 24 November 2015, 10:17:40

Vorheriges Thema - Nächstes Thema

Vladi2010

Hallo ich will zur anzeige in SVG ein Bestimmter Ereignis in die Log Schreiben.

Nur present

Momentan hebe ich es so:
define Toni_Bluetooth_Handy PRESENCE local-bluetooth 54:xx:73:90:xx:FD 60 300
attr Toni_Bluetooth_Handy Andreas Anwesenheit


define FileLog_Toni_Bluetooth_Handy FileLog ./log/Toni_Bluetooth_Handy-%Y.log Toni_Bluetooth_Handy
attr FileLog_Toni_Bluetooth_Handy logtype text
attr FileLog_Toni_Bluetooth_Handy room Schalter_Taster

Ergebnis:


2015-11-24_07:47:31 Toni_Bluetooth_Handy presence: absent
2015-11-24_07:48:36 Toni_Bluetooth_Handy absent
2015-11-24_07:48:36 Toni_Bluetooth_Handy presence: absent
2015-11-24_07:49:39 Toni_Bluetooth_Handy present
2015-11-24_07:49:39 Toni_Bluetooth_Handy presence: present
2015-11-24_07:49:39 Toni_Bluetooth_Handy device_name: Acer Z520
2015-11-24_07:55:24 Toni_Bluetooth_Handy present
2015-11-24_07:55:24 Toni_Bluetooth_Handy presence: present
2015-11-24_07:55:24 Toni_Bluetooth_Handy device_name: Acer Z520
2015-11-24_08:00:41 Toni_Bluetooth_Handy present

wie muss ich LileLog ändern damit nur ,,present" in die LOG geschrieben wird ?

Grüße Andreas

marvin78

Der einfache Weg und wenn presence auch kein Event erzeugen soll: Schau dir die Attribute event-on-change-reading und Co. an.

Vladi2010


marvin78

Dann musst du den Regex in deiner Filelog Definition anpassen. Beispiele dafür gibt es in der commandref zu FileLog.

loescher

Ich weiss, dass das ein alter Thread ist, aber falls jemand diesen über die Suche findet:
Die Lösung müsste so ausschauen:

define FileLog_Toni_Bluetooth_Handy FileLog ./log/Toni_Bluetooth_Handy-%Y.log Toni_Bluetooth_Handy:(absent|present)

Ich hatte das gleiche Problem und da funktioniert es so.