FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: sylvester am 24 Mai 2016, 12:41:39

Titel: Dummy in Log eintragen
Beitrag von: sylvester am 24 Mai 2016, 12:41:39
Hallo,

damit Änderungen einer Dummy-Variable in das Log-File geschrieben werden, habe ich mir ein notify gebaut:

define Dummy_Variable_Notify_Log     notify Dummy_Variable:[Oo]n|[Oo]ff   {if (Value("Dummy_Variable") !~ OldValue("Dummy_Variable"))        {Log 3, "Notify Log: Dummy_Variable $EVENT"}}


Das funktioniert eigentlich auch ganz gut. "Dummy Variable on" wird eingetragen, "Dummy Variable off" wird allerdings mehrfach eingetragen. (Im Log-File der Dummy-Variable sieht man allerdings, das sie nur einmal auf off gesetzt wird.)

Daher habe ich nun zwei Fragen:
1. Hat jemand eine Idee, warum off mehrfach eingetragen wird?
2. Geht das grundsätzlich einfacher?

Viele Grüße

Stephan
Titel: Antw:Dummy in Log eintragen
Beitrag von: Wernieman am 24 Mai 2016, 13:01:42
Wozu ein eigenes Notify? Du kannst Du direkt das Dummy loggen lassen?
Titel: Antw:Dummy in Log eintragen
Beitrag von: sylvester am 24 Mai 2016, 13:07:54
Wie geht das denn?
Wobei ich die Einträge gerne im globalen Log-File hätte ...
Titel: Antw:Dummy in Log eintragen
Beitrag von: frank am 24 Mai 2016, 13:09:57
ich denke in der regex fehlen eventuell klammern

Dummy_Variable:([Oo]n|[Oo]ff)

ansonsten im Log3 cmd die variable $NAME einbauen, dann siehst du woher das off kommt.
Titel: Antw:Dummy in Log eintragen
Beitrag von: Wernieman am 24 Mai 2016, 13:11:49
Eigenes Logfile: Siehe Doku
Titel: Antw:Dummy in Log eintragen
Beitrag von: sylvester am 24 Mai 2016, 13:19:54
Hallo Frank,

es lag an den Klammern.

Vielen Dank!