FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: Kai-Alfonso am 05 Oktober 2017, 11:58:01

Titel: [gelöst][Regex] Warum kein match in readingsHistory
Beitrag von: Kai-Alfonso am 05 Oktober 2017, 11:58:01
Wieso match folgendes Regex im Event Monitor (Notify-Type: deviceName:event) und nicht im readingsHistorymodul, was ja Regex unterstützt laut commandref

HM_Rolllade_.*:control\s.*



Vielen Dank,

gruß

Kai
Titel: Antw:[Regex] Warum kein match in readingsHistory
Beitrag von: CoolTux am 05 Oktober 2017, 12:03:36

HM_Rolllade_.*.control\s.*


Geht es denn so?
Nur zum testen!
Titel: Antw:[Regex] Warum kein match in readingsHistory
Beitrag von: Kai-Alfonso am 05 Oktober 2017, 12:05:48
Zitat von: CoolTux am 05 Oktober 2017, 12:03:36

HM_Rolllade_.*.control\s.*


Geht es denn so?
Nur zum testen!

Nope, geht auch nicht
Titel: Antw:[Regex] Warum kein match in readingsHistory
Beitrag von: CoolTux am 05 Oktober 2017, 12:09:05
HM_Rolllade_.*:control.*

Und so?
Titel: Antw:[Regex] Warum kein match in readingsHistory
Beitrag von: Kai-Alfonso am 05 Oktober 2017, 12:14:37
Zitat von: CoolTux am 05 Oktober 2017, 12:09:05
HM_Rolllade_.*:control.*

Und so?

Das geht - das hatte ich getestet - hilft mir aber nicht bei meinem Problem. Ich würde gerne auf control[Leerzeichen][Zahl] matchen und nicht auf control:[Leerzeichen][Zahl]
Titel: Antw:[Regex] Warum kein match in readingsHistory
Beitrag von: CoolTux am 05 Oktober 2017, 12:24:05

HM_Rolllade_.*:control.[0-9]+


Probier mal bitte
Titel: Antw:[Regex] Warum kein match in readingsHistory
Beitrag von: Kai-Alfonso am 05 Oktober 2017, 12:27:13
Zitat von: CoolTux am 05 Oktober 2017, 12:24:05

HM_Rolllade_.*:control.[0-9]+


Probier mal bitte

im Event Monitor ja, in readingsHistory nope

Titel: Antw:[Regex] Warum kein match in readingsHistory
Beitrag von: CoolTux am 05 Oktober 2017, 12:28:22
gib mal bitte ein list Deines readingsHistory Devices
Titel: Antw:[Regex] Warum kein match in readingsHistory
Beitrag von: Kai-Alfonso am 05 Oktober 2017, 12:29:33
Zitat von: CoolTux am 05 Oktober 2017, 12:28:22
gib mal bitte ein list Deines readingsHistory Devices

Das ist noch sehr übersichtlich ;-)

defmod rh.Rollladen readingsHistory HM_Rolllade_.*:control.[0-9]+
attr rh.Rollladen alias Rolllade Logfile
attr rh.Rollladen room Rollladen
attr rh.Rollladen rows 10


Titel: Antw:[Regex] Warum kein match in readingsHistory
Beitrag von: CoolTux am 05 Oktober 2017, 12:34:11
sieht gut aus. Und wie schaut ganz genau der Event aus?
Titel: Antw:[Regex] Warum kein match in readingsHistory
Beitrag von: Kai-Alfonso am 05 Oktober 2017, 12:36:31
Zitat von: CoolTux am 05 Oktober 2017, 12:34:11
sieht gut aus. Und wie schaut ganz genau der Event aus?



Der ganze Event sieht so aus (ohne Filter)

2017-10-05 12:35:44 HMCCUDEV HM_Rolllade_Bad control 99
2017-10-05 12:35:45 HMCCUDEV HM_Rolllade_Bad 1.LEVEL: 100
2017-10-05 12:35:45 HMCCUDEV HM_Rolllade_Bad control: 100
2017-10-05 12:35:45 HMCCUDEV HM_Rolllade_Bad 100
2017-10-05 12:35:45 HMCCUDEV HM_Rolllade_Bad 1.DIRECTION: ab
2017-10-05 12:35:45 HMCCUDEV HM_Rolllade_Bad hmstate: 100
2017-10-05 12:35:48 HMCCUDEV HM_Rolllade_Bad 1.LEVEL: 99
2017-10-05 12:35:48 HMCCUDEV HM_Rolllade_Bad control: 99
2017-10-05 12:35:48 HMCCUDEV HM_Rolllade_Bad 99
2017-10-05 12:35:48 HMCCUDEV HM_Rolllade_Bad 1.DIRECTION: keine
2017-10-05 12:35:48 HMCCUDEV HM_Rolllade_Bad hmstate: 99
Titel: Antw:[Regex] Warum kein match in readingsHistory
Beitrag von: CoolTux am 05 Oktober 2017, 12:40:53

HM_Rolllade_.*:control:.[0-9]+


Das sollte es sein. Sorry hätte mir schon vorher auffallen sollen
Titel: Antw:[Regex] Warum kein match in readingsHistory
Beitrag von: Kai-Alfonso am 05 Oktober 2017, 12:56:36
Zitat von: CoolTux am 05 Oktober 2017, 12:40:53

HM_Rolllade_.*:control:.[0-9]+


Das sollte es sein. Sorry hätte mir schon vorher auffallen sollen

Kein Problem :-) das matcht auf control: 100 - eigentlich umgekehrt sollte es sein: control: 100 nein, control 100 ja
Titel: Antw:[Regex] Warum kein match in readingsHistory
Beitrag von: CoolTux am 05 Oktober 2017, 13:00:08
Ah jetzt habe ich es auch gesehen. Du willst das er auf den set Event matcht und nicht auf das schreiben des Readings. Mom
Titel: Antw:[Regex] Warum kein match in readingsHistory
Beitrag von: CoolTux am 05 Oktober 2017, 13:01:36
Kann mich irren aber ich denke das geht nicht. Du wirst wohl auf das schreiben des Readings und dem damit verbundenen Event warten.
Grund ist das das ganze ja readingsProxy heißt und nicht setProxy  ;D
Titel: Antw:[Regex] Warum kein match in readingsHistory
Beitrag von: Kai-Alfonso am 05 Oktober 2017, 13:06:40
Zitat von: CoolTux am 05 Oktober 2017, 13:01:36
Kann mich irren aber ich denke das geht nicht. Du wirst wohl auf das schreiben des Readings und dem damit verbundenen Event warten.
Grund ist das das ganze ja readingsProxy heißt und nicht setProxy  ;D

lol - als du es geschrieben hattest, ist bei mir auch der Groschen gefallen - da hätte ich auch selber drauf kommen können  ??? ??? ??? ::) ::) ::)   Danke für deine Hilfe.

Hast Du vielleicht eine Idee zu meinem Problem? Das HMCCUDEV Device akualisiert das Reading control beim set 2 mal - einmal der aktuelle Stand, dann der neue Stand. Ich würde gerne aber in readingsHistory den neuen Stand speichern:

relevante Readings sind fett

Zitat2017-10-05 12:35:44 HMCCUDEV HM_Rolllade_Bad control 99
2017-10-05 12:35:45 HMCCUDEV HM_Rolllade_Bad 1.LEVEL: 100
2017-10-05 12:35:45 HMCCUDEV HM_Rolllade_Bad control: 100
2017-10-05 12:35:45 HMCCUDEV HM_Rolllade_Bad 100
2017-10-05 12:35:45 HMCCUDEV HM_Rolllade_Bad 1.DIRECTION: ab
2017-10-05 12:35:45 HMCCUDEV HM_Rolllade_Bad hmstate: 100
2017-10-05 12:35:48 HMCCUDEV HM_Rolllade_Bad 1.LEVEL: 99
2017-10-05 12:35:48 HMCCUDEV HM_Rolllade_Bad control: 99
2017-10-05 12:35:48 HMCCUDEV HM_Rolllade_Bad 99
2017-10-05 12:35:48 HMCCUDEV HM_Rolllade_Bad 1.DIRECTION: keine
2017-10-05 12:35:48 HMCCUDEV HM_Rolllade_Bad hmstate: 99

das für mich relevante Readings-Set ist 2017-10-05 12:35:48 HMCCUDEV HM_Rolllade_Bad control: 99

Titel: Antw:[Regex] Warum kein match in readingsHistory
Beitrag von: CoolTux am 05 Oktober 2017, 13:11:16
Eventuell mit event-on-change-reading .* mal testen. Also beim HM_Rolllade_Bad Device
Titel: Antw:[Regex] Warum kein match in readingsHistory
Beitrag von: Kai-Alfonso am 05 Oktober 2017, 13:16:19
Das hats gebracht - vielen Dank für deine Hilfe

Titel: Antw:[gelöst][Regex] Warum kein match in readingsHistory
Beitrag von: CoolTux am 05 Oktober 2017, 13:20:59
Gerne doch