Hauptmenü

DOIF auf reading event

Begonnen von willib, 01 Dezember 2018, 14:33:28

Vorheriges Thema - Nächstes Thema

willib

Moin

mein DOIF für die Schlafzimmerbeleuchtung sieht derzeit so aus:
Internals:
   DEF        ([SZ_Dimmer_Dim:"off"] and [HUEDevice6:onoff] eq "1")(set HUEDevice6 off) DOELSEIF
([SZ_Dimmer_Dim:"off"] and [HUEDevice6:onoff] eq "0")(set ls_SZ_Haupt scene insbett)
DOELSEIF
([09:00] and [HUEDevice6:bri] < 20 and [HUEDevice6:onoff] eq "1")(set HUEDevice6 off)
   MODEL      FHEM
   NAME       di_SZ_licht
   NR         372
   NTFY_ORDER 50-di_SZ_licht
   STATE      cmd_2
   TYPE       DOIF
   READINGS:
     2018-12-01 13:36:46   Device          HUEDevice6
     2018-12-01 13:26:19   cmd             2
     2018-12-01 13:26:19   cmd_event       SZ_Dimmer_Dim
     2018-12-01 13:26:19   cmd_nr          2
     2018-12-01 13:36:46   e_HUEDevice6_onoff 0
     2018-12-01 13:26:19   e_SZ_Dimmer_Dim_events deviceMsg: off (to VCCU),dim: stop:off,level: 0,overheat: off,overload: off,pct: 0,phyLevel: 0,reduced: off,off,timedOn: off,Fakergb: ffa500,Fakestate: off,struct: off
     2018-12-01 09:37:52   mode            enabled
     2018-12-01 13:26:19   state           cmd_2
     2018-12-01 09:37:52   timer_01_c03    02.12.2018 09:00:00
   Regex:
   attr:
     cmdState:
     wait:
     waitdel:
   condition:
     0          ::EventDoIf('SZ_Dimmer_Dim',$hash,'off',1) and ::ReadingValDoIf($hash,'HUEDevice6','onoff') eq "1"
     1          ::EventDoIf('SZ_Dimmer_Dim',$hash,'off',1) and ::ReadingValDoIf($hash,'HUEDevice6','onoff') eq "0"
     2          ::DOIF_time_once($hash,0,$wday) and ::ReadingValDoIf($hash,'HUEDevice6','bri') < 20 and ::ReadingValDoIf($hash,'HUEDevice6','onoff') eq "1"
   days:
   devices:
     0           SZ_Dimmer_Dim HUEDevice6
     1           SZ_Dimmer_Dim HUEDevice6
     2           HUEDevice6
     all         SZ_Dimmer_Dim HUEDevice6
   do:
     0:
       0          set HUEDevice6 off
     1:
       0          set ls_SZ_Haupt scene insbett
     2:
       0          set HUEDevice6 off
     3:
   helper:
     event      onoff: 0,pct: 0,off
     globalinit 1
     last_timer 1
     sleeptimer -1
     timerdev   SZ_Dimmer_Dim
     timerevent deviceMsg: off (to VCCU)
     triggerDev HUEDevice6
     DOIF_eventas:
       cmd_nr: 2
       cmd: 2
       cmd_event: SZ_Dimmer_Dim
       state: cmd_2
     timerevents:
       deviceMsg: off (to VCCU)
       dim: stop:off
       level: 0
       overheat: off
       overload: off
       pct: 0
       phyLevel: 0
       reduced: off
       off
       timedOn: off
       Fakergb: ffa500
       Fakestate: off
       struct: off
     timereventsState:
       deviceMsg: off (to VCCU)
       dim: stop:off
       level: 0
       overheat: off
       overload: off
       pct: 0
       phyLevel: 0
       reduced: off
       state: off
       timedOn: off
       Fakergb: ffa500
       Fakestate: off
       struct: off
     triggerEvents:
       onoff: 0
       pct: 0
       off
     triggerEventsState:
       onoff: 0
       pct: 0
       state: off
   internals:
   intervalfunc:
   itimer:
   localtime:
     0          1543737600
   readings:
     0           HUEDevice6:onoff
     1           HUEDevice6:onoff
     2           HUEDevice6:bri HUEDevice6:onoff
     all         HUEDevice6:onoff HUEDevice6:bri
   realtime:
     0          09:00:00
   time:
     0          09:00:00
   timeCond:
     0          2
   timer:
     0          0
   timers:
     2           0
   trigger:
     all         SZ_Dimmer_Dim
   triggertime:
     1543737600:
       localtime  1543737600
       hash:
   uiState:
   uiTable:
Attributes:
   do         always
   group      Hide
   room       Schlafzimmer


Teilweise geht das Hue Licht kurz an und direkt wieder aus. Ich vermute das liegt an den events die der HM Dimmer generiert. Daher möchte ich gerne auf exakt dieses event aus dem event reading des DOIF triggern:
deviceMsg: off (to VCCU)
im Eventmonitor sieht es so aus
CUL_HM SZ_Dimmer_Dim deviceMsg: off (to VCCU)
Wie muss ich meinen Code anpassen? Ich habe diverse Kombinationen getestet auch mit . statt Leerzeichen.
Vielen Dank euch.
FHEM in Debian 10 LXC unter Proxmox auf NUC, Homematic, Hue, Intertechno, Jeelink, RFXTRX, Harmony Hub, VU+ Uno 4K, Sonos, AMAD

amenomade

Im Eventmonitor die gesamte Zeile des Events markieren, auf "Create/modify Device" klicken und DOIF auswählen. So kriegst Du die richtige Regex.
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

Ellert

Zitat von: amenomade am 02 Dezember 2018, 01:42:56
Im Eventmonitor die gesamte Zeile des Events markieren, auf "Create/modify Device" klicken und DOIF auswählen. So kriegst Du die richtige Regex.
In diesem Fall könnte es sein, dass die Klammern maskiert werden müssen
[SZ_Dimmer_Dim:"deviceMsg: off (to VCCU)"]
zu
[SZ_Dimmer_Dim:"deviceMsg: off \(to VCCU\)"]

amenomade

ZitatIn diesem Fall könnte es sein, dass die Klammern maskiert werden müssen

Das macht "Create/Modify" im Eventmonitor schon

Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

willib

Zitat von: Ellert am 02 Dezember 2018, 09:34:27
In diesem Fall könnte es sein, dass die Klammern maskiert werden müssen
[SZ_Dimmer_Dim:"deviceMsg: off (to VCCU)"]
zu
[SZ_Dimmer_Dim:"deviceMsg: off \(to VCCU\)"]

Das war es. Vielen Dank
FHEM in Debian 10 LXC unter Proxmox auf NUC, Homematic, Hue, Intertechno, Jeelink, RFXTRX, Harmony Hub, VU+ Uno 4K, Sonos, AMAD