Denkfehler beim Filelog? //regexp

Begonnen von M.Piet, 21 September 2018, 07:58:03

Vorheriges Thema - Nächstes Thema

M.Piet

Hallo Zusammen,

ich poste das mal unter Anfängerfragen....denke das ich irgendwo einen blöden Denkfehler habe. Nicht der erste Filelog den ich nutze.

Ich habe 3 HM wired Kontakte. Deren Zustand will ich Loggen.

Wenn ich im Regexp keinen Filter einbaue und alles logge klappt das auch:
HMW_Sen_SC_12_DR_OEQ0863464_01:.*|HMW_Sen_SC_12_DR_OEQ0863464_02:.*|HMW_Sen_SC_12_DR_OEQ0863464_03:.*
2018-09-20_19:11:26 HMW_Sen_SC_12_DR_OEQ0863464_01 sensor: open
2018-09-20_19:11:26 HMW_Sen_SC_12_DR_OEQ0863464_01 Tor geschlossen
2018-09-20_19:12:12 HMW_Sen_SC_12_DR_OEQ0863464_02 sensor: open
2018-09-20_19:12:12 HMW_Sen_SC_12_DR_OEQ0863464_02 Tor geschlossen
2018-09-20_19:44:32 HMW_Sen_SC_12_DR_OEQ0863464_02 sensor: closed
2018-09-20_19:44:32 HMW_Sen_SC_12_DR_OEQ0863464_02 Tor geöffnet
2018-09-20_19:46:18 HMW_Sen_SC_12_DR_OEQ0863464_02 sensor: open
2018-09-20_19:46:18 HMW_Sen_SC_12_DR_OEQ0863464_02 Tor geschlossen


Wenn ich jetzt aber die 3 Regexp auf "state" einrichte, bleibt das Log leer (siehe auch Screenshot):
HMW_Sen_SC_12_DR_OEQ0863464_01:state:.*|HMW_Sen_SC_12_DR_OEQ0863464_02:state:.*|HMW_Sen_SC_12_DR_OEQ0863464_03:state:.*

An welcher Stelle ist mein Denkfehler?

Danke schon mal.


alanblack

Zitat von: M.Piet am 21 September 2018, 07:58:03
Wenn ich jetzt aber die 3 Regexp auf "state" einrichte, bleibt das Log leer (siehe auch Screenshot):
HMW_Sen_SC_12_DR_OEQ0863464_01:state:.*|HMW_Sen_SC_12_DR_OEQ0863464_02:state:.*|HMW_Sen_SC_12_DR_OEQ0863464_03:state:.*

An welcher Stelle ist mein Denkfehler?

Danke schon mal.
Hast Du mal ein list von einem oder zwei der Kontakte? Und von dem filelog?

Danke!
FHEM 6.0 auf raspi3&ODROID XU4 mit HMLAN und HM-MOD-RPI-PCB, LaCrosse via JeeLink, COC868 und CUL433, Xiaomi Aqara+div. Zigbee via deCONZ, Dooya via SIGNALDuino, ZWave mit Danalock
Jeder Witz kann ein Einzeiler sein mit genügend Semikolons

LuckyDay

state ist doch die Sonderlocke als reading

HMW_Sen_SC_12_DR_OEQ0863464_01:state:.*|HMW_Sen_SC_12_DR_OEQ0863464_02:state:.*|HMW_Sen_SC_12_DR_OEQ0863464_03:T.*

Wenn im state nur die zwei Zustände
Tor geschlossen
Tor geöffnet

dann reicht T.*
oder weiter einschränken z.B.
Tor.*

M.Piet

@fhem-hm-knecht:
Zitatstate ist doch die Sonderlocke als reading
Was meinst du damit?

@alanblack
Hier ist er.
Filelog:
Internals:
   CFGFN     
   DEF        ./log/Tore-%Y-%m.log HMW_Sen_SC_12_DR_OEQ0863464_01:.*|HMW_Sen_SC_12_DR_OEQ0863464_02:.*|HMW_Sen_SC_12_DR_OEQ0863464_03:.*
   NAME       FileLog_Tore
   NOTIFYDEV  HMW_Sen_SC_12_DR_OEQ0863464_02,HMW_Sen_SC_12_DR_OEQ0863464_03,HMW_Sen_SC_12_DR_OEQ0863464_01
   NR         77059
   NTFY_ORDER 50-FileLog_Tore
   REGEXP     HMW_Sen_SC_12_DR_OEQ0863464_01:.*|HMW_Sen_SC_12_DR_OEQ0863464_02:.*|HMW_Sen_SC_12_DR_OEQ0863464_03:.*
   STATE      active
   TYPE       FileLog
   currentlogfile ./log/Tore-2018-09.log
   logfile    ./log/Tore-%Y-%m.log
   READINGS:
     2018-09-20 19:46:18   linesInTheFile  36
Attributes:
   room       Logs


Einer der 3 Kontakte:

Internals:
   CFGFN     
   DEF        0001AAD0_01
   NAME       HMW_Sen_SC_12_DR_OEQ0863464_01
   NR         22762
   STATE      Tor geschlossen
   TYPE       HM485
   chanNo     01
   device     HMW_Sen_SC_12_DR_OEQ0863464
   peerRole   none
   READINGS:
     2018-09-17 21   R-input_locked  no
     2018-09-21 07   sensor          open
     2018-09-21 07   state           sensor_open
   devHash:
     CFGFN     
     DEF        0001AAD0
     FailedConfigReads 0
     IODev      hm485
     NAME       HMW_Sen_SC_12_DR_OEQ0863464
     NR         22760
     RawDeviceType 25
     RawFwVersion 769
     STATE      ACK
     TYPE       HM485
     channel_01 HMW_Sen_SC_12_DR_OEQ0863464_01
     channel_02 HMW_Sen_SC_12_DR_OEQ0863464_02
     channel_03 HMW_Sen_SC_12_DR_OEQ0863464_03
     channel_04 HMW_Sen_SC_12_DR_OEQ0863464_04
     channel_05 HMW_Sen_SC_12_DR_OEQ0863464_05
     channel_06 HMW_Sen_SC_12_DR_OEQ0863464_06
     channel_07 HMW_Sen_SC_12_DR_OEQ0863464_07
     channel_08 HMW_Sen_SC_12_DR_OEQ0863464_08
     channel_09 HMW_Sen_SC_12_DR_OEQ0863464_09
     channel_10 HMW_Sen_SC_12_DR_OEQ0863464_10
     channel_11 HMW_Sen_SC_12_DR_OEQ0863464_11
     channel_12 HMW_Sen_SC_12_DR_OEQ0863464_12
     READINGS:
       2018-09-17 21   D-deviceKey     HMW_SEN_SC_12_DR
       2018-09-17 21   D-fwVersion     3.01
       2018-09-17 21   D-serialNr      OEQ0863464
       2018-09-17 21   R-central_address 00000001
       2018-09-17 21   configStatus    OK
       2018-09-17 21   state           ACK
     cache:
       sets       Unknown argument ?, choose one of  config getConfig raw reset
       01:
         allowedSets
         sets       Unknown argument ?, choose one of  config
         peeredChannels:
       02:
         allowedSets
         sets       Unknown argument ?, choose one of  config
         peeredChannels:
       03:
         allowedSets
         sets       Unknown argument ?, choose one of  config
         peeredChannels:
       04:
         allowedSets
         sets       Unknown argument ?, choose one of  config
         peeredChannels:
       05:
         allowedSets
         sets       Unknown argument ?, choose one of  config
         peeredChannels:
       06:
         allowedSets
         sets       Unknown argument ?, choose one of  config
         peeredChannels:
       07:
         allowedSets
         sets       Unknown argument ?, choose one of  config
         peeredChannels:
       08:
         allowedSets
         sets       Unknown argument ?, choose one of  config
         peeredChannels:
       09:
         allowedSets
         sets       Unknown argument ?, choose one of  config
         peeredChannels:
       10:
         allowedSets
         sets       Unknown argument ?, choose one of  config
         peeredChannels:
       11:
         allowedSets
         sets       Unknown argument ?, choose one of  config
         peeredChannels:
       12:
         allowedSets
         sets       Unknown argument ?, choose one of  config
         peeredChannels:
       linkParams:
         actuator:
           channels   00
         sensor:
           channels   00
       peers:
         sensors:
Attributes:
   alias      HMW_Sen_SC_12_DR__01_Garagentor_Scheune
   eventMap   /sensor_open geschlossen/sensor_closed geöffnet/
   room       HM485
   subType    sensor

Wzut

Zitat von: M.Piet am 21 September 2018, 11:05:49
@fhem-hm-knecht:Was meinst du damit?
Das Thema mit state gibt es hier min einmal pro Monat ....
Tipp : commandref lesen :
ZitataddStateEvent

    attr <device> addStateEvent [0|1]
    As you probably know the event associated with the state Reading is special, as the "state: " string is stripped, i.e event is not "state: on" but just "on".
    Mostly it is desireable to get the complete event without "state: " stripped, so it is the default behavior of DbLog. That means you will get state-event complete as "state: xxx".
    In some circumstances, e.g. older or special modules, it is a good idea to set addStateEvent to "0". Try it if you have trouble with the default adjustment. 
Maintainer der Module: MAX, MPD, UbiquitiMP, UbiquitiOut, SIP, BEOK, readingsWatcher

M.Piet

ZitatDas Thema mit state gibt es hier min einmal pro Monat ....
OK, das klingt logisch und beschreibt auch genau mein Problem. Darüber bin ich noch nie gestolpert.

Ich habe nur ein Problem: in den HM-Komponenten gibt es kein attr. addStateEvent ?!

Wzut

 natürlich haben sie das nicht .... Ok ich hab halt einfach den ersten Block mit stateEvent aus der commandref zitiert.
Vllt gefällt dir ja der Abschnit von notify besser (dir geht es ja wohl um FileLog) :
ZitataddStateEvent
The event associated with the state Reading is special, as the "state: " string is stripped, i.e $EVENT is not "state: on" but just "on". In some circumstances it is desireable to get the event without "state: " stripped. In such a case the addStateEvent attribute should be set to 1 (default is 0, i.e. strip the "state: " string).
Note 1: you have to set this attribute for the event "receiver", i.e. notify, FileLog, etc.
Note 2: this attribute will only work for events generated by devices supporting the readingFnAttributes.
Maintainer der Module: MAX, MPD, UbiquitiMP, UbiquitiOut, SIP, BEOK, readingsWatcher

M.Piet

Super, danke dir. Das war es. Ich war der Meinung, ich müsste das in dem Quell-Device (also meine HM-Kontakte machen). Ich habe es nun im Filelog eingerichtet, denke mal das es jetzt geht.
Ich danke Dir für die klärenden Worte.... :)