DOIF springt zwischen CMD1 und CMD2 her

Begonnen von Wasserwerk33, 24 Mai 2021, 19:29:01

Vorheriges Thema - Nächstes Thema

Wasserwerk33

Hallo Leute,

Ich schalte mit meinem DOIF eine Lampe im Esszimmer ein. Der Lichtwert kommt von einem Zwave Modul unter der Decke zwischen Wohnzimmer und Esszimmer. Bis 22:15 uhr soll es angehen wenn wir nicht da sind. Sind wir da soll es bis 20:15 uhr angehen und der Fernseher aber nicht läuft. Dieses klappt auch eigentlich soweit. Nur leider schaltet mein DOIF hin und her. Zwischen 1 und 2. Jetzt wollte ich meinen Lichtsensor mit einem ? abfragen jetzt schaltet es aber garnicht mehr erst ein. Müsste es wo anderes hin? oder hat einer eine andere Idee für mein DOIF

([?7:00-21:55] and [?ZWave_SENSOR_NOTIFICATION_23:luminance:d] < 30) (set HUEDevice2 on)

DOELSEIF

(([22:15] and [Stefan] eq "absent" and [Christin] eq "absent") or ([?19:00-21:55] and ([Pioneer_Anlage:input] eq "PS_4" or [Pioneer_Anlage:input] eq "TV")) or [?ZWave_SENSOR_NOTIFICATION_23:luminance:d]> 30)
(set HUEDevice2 off)


Internals:
   DEF        ([?7:00-21:55] and [?ZWave_SENSOR_NOTIFICATION_23:luminance:d] < 30) (set HUEDevice2 on)

DOELSEIF

(([22:15] and [Stefan] eq "absent" and [Christin] eq "absent") or ([?19:00-21:55] and ([Pioneer_Anlage:input] eq "PS_4" or [Pioneer_Anlage:input] eq "TV")) or [?ZWave_SENSOR_NOTIFICATION_23:luminance:d]> 30)
(set HUEDevice2 off)
   FUUID      6085b12d-f33f-87a8-7f82-342a2fbae8249367
   MODEL      FHEM
   NAME       EsszimmerLicht
   NOTIFYDEV  Christin,Pioneer_Anlage,global,Stefan
   NR         112
   NTFY_ORDER 50-EsszimmerLicht
   STATE      initialized
   TYPE       DOIF
   VERSION    24434 2021-05-13 20:27:41
   READINGS:
     2021-05-24 19:28:28   Device          Stefan
     2021-05-24 19:20:24   cmd             0
     2021-05-24 19:28:09   e_Christin_STATE present
     2021-05-24 19:28:28   e_Stefan_STATE  present
     2021-05-24 19:20:24   mode            enabled
     2021-05-24 19:20:24   state           initialized
     2021-05-24 19:20:24   timer_01_c01    25.05.2021 07:00:00
     2021-05-24 19:20:24   timer_02_c01    24.05.2021 21:55:00
     2021-05-24 19:20:24   timer_03_c02    24.05.2021 22:15:00
     2021-05-24 19:20:24   timer_04_c02    25.05.2021 19:00:00
     2021-05-24 19:20:24   timer_05_c02    24.05.2021 21:55:00
   Regex:
     accu:
     collect:
     cond:
       Christin:
         0:
         1:
           &STATE     ^Christin$
       Pioneer_Anlage:
         1:
           input      ^Pioneer_Anlage$:^input:
       Stefan:
         0:
         1:
           &STATE     ^Stefan$
   attr:
     cmdState:
     wait:
     waitdel:
   condition:
     0          ::DOIF_time($hash,0,1,$wday,$hms) and ::ReadingValDoIf($hash,'ZWave_SENSOR_NOTIFICATION_23','luminance','','d') < 30
     1          (::DOIF_time_once($hash,2,$wday) and ::InternalDoIf($hash,'Stefan','STATE') eq "absent" and ::InternalDoIf($hash,'Christin','STATE') eq "absent") or (::DOIF_time($hash,3,4,$wday,$hms) and (::ReadingValDoIf($hash,'Pioneer_Anlage','input') eq "PS_4" or ::ReadingValDoIf($hash,'Pioneer_Anlage','input') eq "TV")) or ::ReadingValDoIf($hash,'ZWave_SENSOR_NOTIFICATION_23','luminance','','d')> 30
   days:
   do:
     0:
       0          set HUEDevice2 on
     1:
       0          set HUEDevice2 off
     2:
   helper:
     DEVFILTER  ^global$|^Stefan$|^Christin$|^Pioneer_Anlage$
     NOTIFYDEV  global|Stefan|Christin|Pioneer_Anlage
     event      present,presence: present
     globalinit 1
     last_timer 5
     sleeptimer -1
     triggerDev Stefan
     triggerEvents:
       present
       presence: present
     triggerEventsState:
       state: present
       presence: present
   internals:
     all         Stefan:STATE Christin:STATE
   interval:
     0          -1
     1          0
     3          -1
     4          3
   intervalfunc:
   localtime:
     0          1621918800
     1          1621886100
     2          1621887300
     3          1621962000
     4          1621886100
   readings:
     all         Pioneer_Anlage:input
   realtime:
     0          07:00:00
     1          21:55:00
     2          22:15:00
     3          19:00:00
     4          21:55:00
   time:
     0          7:00
     1          21:55:00
     2          22:15:00
     3          19:00:00
     4          21:55:00
   timeCond:
     0          0
     1          0
     2          1
     3          1
     4          1
   timer:
     0          0
     1          0
     2          0
     3          0
     4          0
   timers:
     1           2
   trigger:
   triggertime:
     1621886100:
       localtime  1621886100
       hash:
     1621887300:
       localtime  1621887300
       hash:
     1621918800:
       localtime  1621918800
       hash:
     1621962000:
       localtime  1621962000
       hash:
   uiState:
   uiTable:
Attributes:
   room       Steckdosen


Danke für euren Tipp

Wasserwerk33

selbst wenn ich bei der Pioneer Anlage die ? hin mache springt es hin und her. Wo ist den mein Fehler? Denn wenn ich das Zwave gerät abfrage springt es erst garnicht an.

Wasserwerk33

Keiner eine Idee wie ich das ändern kann?

Frank_Huber

Poste mal bitte von jedem Zustand wenn er hin und her schaltet ein List.

Wenn du alles mit ? Nicht Triggern einbaust ist auch klar dass er nix macht.

Ellert

Zitat von: Wasserwerk33 am 26 Mai 2021, 21:03:09
Keiner eine Idee wie ich das ändern kann?

Formuliere die Bedingungen genauer, also baue
ZitatSind wir da soll es bis 20:15 uhr angehen und der Fernseher aber nicht läuft
mit ein.

Es ist eine schlechte Idee den Sensor zum Einschalten zu nehmen der durch das Licht, das er schaltet, das Licht gleich wieder ausschaltet.

Wasserwerk33

Hi

Hier ist eine List vom Anschalten:
Internals:
   DEF        ([?7:00-21:55] and [ZWave_SENSOR_NOTIFICATION_23:luminance:d]< 50) (set HUEDevice2 on)

DOELSEIF

((([?19:00-21:55] and ([Pioneer_Anlage:input] eq "PS_4" or [Pioneer_Anlage:input] eq "TV") or ([22:15] and [Stefan] eq "absent" and [Christin] eq "absent") or [ZWave_SENSOR_NOTIFICATION_23:luminance:d]> 51)))
(set HUEDevice2 off)

   FUUID      6085b12d-f33f-87a8-7f82-342a2fbae8249367
   MODEL      FHEM
   NAME       EsszimmerLicht
   NOTIFYDEV  global,Stefan,ZWave_SENSOR_NOTIFICATION_23,Pioneer_Anlage,Christin
   NR         112
   NTFY_ORDER 50-EsszimmerLicht
   STATE      cmd_1
   TYPE       DOIF
   VERSION    24434 2021-05-13 20:27:41
   READINGS:
     2021-05-27 19:46:51   Device          ZWave_SENSOR_NOTIFICATION_23
     2021-05-27 19:46:51   cmd             1
     2021-05-27 19:46:51   cmd_event       ZWave_SENSOR_NOTIFICATION_23
     2021-05-27 19:46:51   cmd_nr          1
     2021-05-27 19:46:23   e_Christin_STATE present
     2021-05-27 19:46:39   e_Stefan_STATE  present
     2021-05-27 19:46:51   e_ZWave_SENSOR_NOTIFICATION_23_luminance 29 Lux
     2021-05-27 19:39:23   mode            enabled
     2021-05-27 19:46:51   state           cmd_1
     2021-05-27 19:39:23   timer_01_c01    28.05.2021 07:00:00
     2021-05-27 19:39:23   timer_02_c01    27.05.2021 21:55:00
     2021-05-27 19:39:23   timer_03_c02    28.05.2021 19:00:00
     2021-05-27 19:39:23   timer_04_c02    27.05.2021 21:55:00
     2021-05-27 19:39:23   timer_05_c02    27.05.2021 22:15:00
   Regex:
     accu:
     collect:
     cond:
       Christin:
         0:
         1:
           &STATE     ^Christin$
       Pioneer_Anlage:
         1:
           input      ^Pioneer_Anlage$:^input:
       Stefan:
         0:
         1:
           &STATE     ^Stefan$
       ZWave_SENSOR_NOTIFICATION_23:
         0:
           luminance  ^ZWave_SENSOR_NOTIFICATION_23$:^luminance:
         1:
           luminance  ^ZWave_SENSOR_NOTIFICATION_23$:^luminance:
   attr:
     cmdState:
     wait:
     waitdel:
   condition:
     0          ::DOIF_time($hash,0,1,$wday,$hms) and ::ReadingValDoIf($hash,'ZWave_SENSOR_NOTIFICATION_23','luminance','','d')< 50
     1          ((::DOIF_time($hash,2,3,$wday,$hms) and (::ReadingValDoIf($hash,'Pioneer_Anlage','input') eq "PS_4" or ::ReadingValDoIf($hash,'Pioneer_Anlage','input') eq "TV") or (::DOIF_time_once($hash,4,$wday) and ::InternalDoIf($hash,'Stefan','STATE') eq "absent" and ::InternalDoIf($hash,'Christin','STATE') eq "absent") or ::ReadingValDoIf($hash,'ZWave_SENSOR_NOTIFICATION_23','luminance','','d')> 51))
   days:
   do:
     0:
       0          set HUEDevice2 on
     1:
       0          set HUEDevice2 off
     2:
   helper:
     DEVFILTER  ^global$|^Stefan$|^Christin$|^Pioneer_Anlage$|^ZWave_SENSOR_NOTIFICATION_23$
     NOTIFYDEV  global|Stefan|Christin|Pioneer_Anlage|ZWave_SENSOR_NOTIFICATION_23
     event      luminance: 29 Lux
     globalinit 1
     last_timer 5
     sleeptimer -1
     timerdev   ZWave_SENSOR_NOTIFICATION_23
     timerevent luminance: 29 Lux
     triggerDev ZWave_SENSOR_NOTIFICATION_23
     DOIF_eventa:
       cmd_nr: 1
       cmd: 1
       cmd_event: ZWave_SENSOR_NOTIFICATION_23
       cmd_1
     DOIF_eventas:
       cmd_nr: 1
       cmd: 1
       cmd_event: ZWave_SENSOR_NOTIFICATION_23
       state: cmd_1
     timerevents:
       luminance: 29 Lux
     timereventsState:
       luminance: 29 Lux
     triggerEvents:
       luminance: 29 Lux
     triggerEventsState:
       luminance: 29 Lux
   internals:
     all         Stefan:STATE Christin:STATE
   interval:
     0          -1
     1          0
     2          -1
     3          2
   intervalfunc:
   localtime:
     0          1622178000
     1          1622145300
     2          1622221200
     3          1622145300
     4          1622146500
   readings:
     all         ZWave_SENSOR_NOTIFICATION_23:luminance Pioneer_Anlage:input
   realtime:
     0          07:00:00
     1          21:55:00
     2          19:00:00
     3          21:55:00
     4          22:15:00
   time:
     0          7:00
     1          21:55:00
     2          19:00:00
     3          21:55:00
     4          22:15:00
   timeCond:
     0          0
     1          0
     2          1
     3          1
     4          1
   timer:
     0          0
     1          0
     2          0
     3          0
     4          0
   timers:
     1           4
   trigger:
   triggertime:
     1622145300:
       localtime  1622145300
       hash:
     1622146500:
       localtime  1622146500
       hash:
     1622178000:
       localtime  1622178000
       hash:
     1622221200:
       localtime  1622221200
       hash:
   uiState:
   uiTable:
Attributes:
   room       Steckdosen



hier ist eine List von dem wo er es wieder Ausschaltet:

Internals:
   DEF        ([?7:00-21:55] and [ZWave_SENSOR_NOTIFICATION_23:luminance:d]< 50) (set HUEDevice2 on)

DOELSEIF

((([?19:00-21:55] and ([Pioneer_Anlage:input] eq "PS_4" or [Pioneer_Anlage:input] eq "TV") or ([22:15] and [Stefan] eq "absent" and [Christin] eq "absent") or [ZWave_SENSOR_NOTIFICATION_23:luminance:d]> 51)))
(set HUEDevice2 off)

   FUUID      6085b12d-f33f-87a8-7f82-342a2fbae8249367
   MODEL      FHEM
   NAME       EsszimmerLicht
   NOTIFYDEV  global,Stefan,ZWave_SENSOR_NOTIFICATION_23,Pioneer_Anlage,Christin
   NR         112
   NTFY_ORDER 50-EsszimmerLicht
   STATE      cmd_2
   TYPE       DOIF
   VERSION    24434 2021-05-13 20:27:41
   READINGS:
     2021-05-27 19:43:53   Device          Christin
     2021-05-27 19:43:53   cmd             2
     2021-05-27 19:43:53   cmd_event       Christin
     2021-05-27 19:43:53   cmd_nr          2
     2021-05-27 19:43:53   e_Christin_STATE present
     2021-05-27 19:43:38   e_Stefan_STATE  present
     2021-05-27 19:43:42   e_ZWave_SENSOR_NOTIFICATION_23_luminance 35 Lux
     2021-05-27 19:39:23   mode            enabled
     2021-05-27 19:43:53   state           cmd_2
     2021-05-27 19:39:23   timer_01_c01    28.05.2021 07:00:00
     2021-05-27 19:39:23   timer_02_c01    27.05.2021 21:55:00
     2021-05-27 19:39:23   timer_03_c02    28.05.2021 19:00:00
     2021-05-27 19:39:23   timer_04_c02    27.05.2021 21:55:00
     2021-05-27 19:39:23   timer_05_c02    27.05.2021 22:15:00
   Regex:
     accu:
     collect:
     cond:
       Christin:
         0:
         1:
           &STATE     ^Christin$
       Pioneer_Anlage:
         1:
           input      ^Pioneer_Anlage$:^input:
       Stefan:
         0:
         1:
           &STATE     ^Stefan$
       ZWave_SENSOR_NOTIFICATION_23:
         0:
           luminance  ^ZWave_SENSOR_NOTIFICATION_23$:^luminance:
         1:
           luminance  ^ZWave_SENSOR_NOTIFICATION_23$:^luminance:
   attr:
     cmdState:
     wait:
     waitdel:
   condition:
     0          ::DOIF_time($hash,0,1,$wday,$hms) and ::ReadingValDoIf($hash,'ZWave_SENSOR_NOTIFICATION_23','luminance','','d')< 50
     1          ((::DOIF_time($hash,2,3,$wday,$hms) and (::ReadingValDoIf($hash,'Pioneer_Anlage','input') eq "PS_4" or ::ReadingValDoIf($hash,'Pioneer_Anlage','input') eq "TV") or (::DOIF_time_once($hash,4,$wday) and ::InternalDoIf($hash,'Stefan','STATE') eq "absent" and ::InternalDoIf($hash,'Christin','STATE') eq "absent") or ::ReadingValDoIf($hash,'ZWave_SENSOR_NOTIFICATION_23','luminance','','d')> 51))
   days:
   do:
     0:
       0          set HUEDevice2 on
     1:
       0          set HUEDevice2 off
     2:
   helper:
     DEVFILTER  ^global$|^Stefan$|^Christin$|^Pioneer_Anlage$|^ZWave_SENSOR_NOTIFICATION_23$
     NOTIFYDEV  global|Stefan|Christin|Pioneer_Anlage|ZWave_SENSOR_NOTIFICATION_23
     event      present,presence: present
     globalinit 1
     last_timer 5
     sleeptimer -1
     timerdev   Christin
     timerevent present,presence: present
     triggerDev Christin
     DOIF_eventa:
       cmd_nr: 2
       cmd: 2
       cmd_event: Christin
       cmd_2
     DOIF_eventas:
       cmd_nr: 2
       cmd: 2
       cmd_event: Christin
       state: cmd_2
     timerevents:
       present
       presence: present
     timereventsState:
       state: present
       presence: present
     triggerEvents:
       present
       presence: present
     triggerEventsState:
       state: present
       presence: present
   internals:
     all         Stefan:STATE Christin:STATE
   interval:
     0          -1
     1          0
     2          -1
     3          2
   intervalfunc:
   localtime:
     0          1622178000
     1          1622145300
     2          1622221200
     3          1622145300
     4          1622146500
   readings:
     all         ZWave_SENSOR_NOTIFICATION_23:luminance Pioneer_Anlage:input
   realtime:
     0          07:00:00
     1          21:55:00
     2          19:00:00
     3          21:55:00
     4          22:15:00
   time:
     0          7:00
     1          21:55:00
     2          19:00:00
     3          21:55:00
     4          22:15:00
   timeCond:
     0          0
     1          0
     2          1
     3          1
     4          1
   timer:
     0          0
     1          0
     2          0
     3          0
     4          0
   timers:
     1           4
   trigger:
   triggertime:
     1622145300:
       localtime  1622145300
       hash:
     1622146500:
       localtime  1622146500
       hash:
     1622178000:
       localtime  1622178000
       hash:
     1622221200:
       localtime  1622221200
       hash:
   uiState:
   uiTable:
Attributes:
   room       Steckdosen


Wasserwerk33

Zitat von: Ellert am 26 Mai 2021, 23:06:03
Formuliere die Bedingungen genauer, also baue  mit ein.

Es ist eine schlechte Idee den Sensor zum Einschalten zu nehmen der durch das Licht, das er schaltet, das Licht gleich wieder ausschaltet.

Naja es soll eigentlich immer angehen auch wenn wir nicht da sind. Es soll sozusagen die presents simulieren

Damian

Zitat von: Wasserwerk33 am 27 Mai 2021, 19:49:45
Naja es soll eigentlich immer angehen auch wenn wir nicht da sind. Es soll sozusagen die presents simulieren

Der Trigger Christin war der Auslöser für cmd2, siehe Device, besser ist:

... ([22:15] and [?Stefan:state] eq "absent" and [?Christin:state] eq "absent")
Programmierte FHEM-Module: DOIF-FHEM, DOIF-Perl, DOIF-uiTable, THRESHOLD, FHEM-Befehl: IF

Wasserwerk33

#8
habe ich probiert.


Wenn ich das richtige sehe triggert er auf den Lichtsensor jedes mal. Geht dann aber nicht mehr aus.
Internals:
   DEF        ([?7:00-21:55] and [ZWave_SENSOR_NOTIFICATION_23:luminance:d]< 50) (set HUEDevice2 on)

DOELSEIF

((([?19:00-21:55] and ([Pioneer_Anlage:input] eq "PS_4" or [Pioneer_Anlage:input] eq "TV") or ([22:15] and [?Stefan:state] eq "absent" and [?Christin:state] eq "absent") or [ZWave_SENSOR_NOTIFICATION_23:luminance:d]> 51)))
(set HUEDevice2 off)

   FUUID      6085b12d-f33f-87a8-7f82-342a2fbae8249367
   MODEL      FHEM
   NAME       EsszimmerLicht
   NOTIFYDEV  global,Pioneer_Anlage,ZWave_SENSOR_NOTIFICATION_23
   NR         112
   NTFY_ORDER 50-EsszimmerLicht
   STATE      cmd_1
   TYPE       DOIF
   VERSION    24434 2021-05-13 20:27:41
   READINGS:
     2021-05-27 20:44:27   Device          ZWave_SENSOR_NOTIFICATION_23
     2021-05-27 20:44:27   cmd             1
     2021-05-27 20:44:27   cmd_event       ZWave_SENSOR_NOTIFICATION_23
     2021-05-27 20:44:27   cmd_nr          1
     2021-05-27 20:44:27   e_ZWave_SENSOR_NOTIFICATION_23_luminance 33 Lux
     2021-05-27 20:40:41   mode            enabled
     2021-05-27 20:44:27   state           cmd_1
     2021-05-27 20:40:41   timer_01_c01    28.05.2021 07:00:00
     2021-05-27 20:40:41   timer_02_c01    27.05.2021 21:55:00
     2021-05-27 20:40:41   timer_03_c02    28.05.2021 19:00:00
     2021-05-27 20:40:41   timer_04_c02    27.05.2021 21:55:00
     2021-05-27 20:40:41   timer_05_c02    27.05.2021 22:15:00
   Regex:
     accu:
     collect:
     cond:
       Pioneer_Anlage:
         1:
           input      ^Pioneer_Anlage$:^input:
       ZWave_SENSOR_NOTIFICATION_23:
         0:
           luminance  ^ZWave_SENSOR_NOTIFICATION_23$:^luminance:
         1:
           luminance  ^ZWave_SENSOR_NOTIFICATION_23$:^luminance:
   attr:
     cmdState:
     wait:
     waitdel:
   condition:
     0          ::DOIF_time($hash,0,1,$wday,$hms) and ::ReadingValDoIf($hash,'ZWave_SENSOR_NOTIFICATION_23','luminance','','d')< 50
     1          ((::DOIF_time($hash,2,3,$wday,$hms) and (::ReadingValDoIf($hash,'Pioneer_Anlage','input') eq "PS_4" or ::ReadingValDoIf($hash,'Pioneer_Anlage','input') eq "TV") or (::DOIF_time_once($hash,4,$wday) and ::ReadingValDoIf($hash,'Stefan','state') eq "absent" and ::ReadingValDoIf($hash,'Christin','state') eq "absent") or ::ReadingValDoIf($hash,'ZWave_SENSOR_NOTIFICATION_23','luminance','','d')> 51))
   days:
   do:
     0:
       0          set HUEDevice2 on
     1:
       0          set HUEDevice2 off
     2:
   helper:
     DEVFILTER  ^global$|^ZWave_SENSOR_NOTIFICATION_23$|^Pioneer_Anlage$
     NOTIFYDEV  global|ZWave_SENSOR_NOTIFICATION_23|Pioneer_Anlage
     event      luminance: 33 Lux
     globalinit 1
     last_timer 5
     sleeptimer -1
     timerdev   ZWave_SENSOR_NOTIFICATION_23
     timerevent luminance: 33 Lux
     triggerDev ZWave_SENSOR_NOTIFICATION_23
     timerevents:
       luminance: 33 Lux
     timereventsState:
       luminance: 33 Lux
     triggerEvents:
       luminance: 33 Lux
     triggerEventsState:
       luminance: 33 Lux
   internals:
   interval:
     0          -1
     1          0
     2          -1
     3          2
   intervalfunc:
   localtime:
     0          1622178000
     1          1622145300
     2          1622221200
     3          1622145300
     4          1622146500
   readings:
     all         ZWave_SENSOR_NOTIFICATION_23:luminance Pioneer_Anlage:input
   realtime:
     0          07:00:00
     1          21:55:00
     2          19:00:00
     3          21:55:00
     4          22:15:00
   time:
     0          7:00
     1          21:55:00
     2          19:00:00
     3          21:55:00
     4          22:15:00
   timeCond:
     0          0
     1          0
     2          1
     3          1
     4          1
   timer:
     0          0
     1          0
     2          0
     3          0
     4          0
   timers:
     1           4
   trigger:
   triggertime:
     1622145300:
       localtime  1622145300
       hash:
     1622146500:
       localtime  1622146500
       hash:
     1622178000:
       localtime  1622178000
       hash:
     1622221200:
       localtime  1622221200
       hash:
   uiState:
   uiTable:
Attributes:
   room       Steckdosen



Habe ihn noch so umgebaut aber immer noch das selbe.



([?7:00-21:55] and [ZWave_SENSOR_NOTIFICATION_23:luminance:d]< 50) (set HUEDevice2 on)

DOELSEIF

((([?19:00-21:55] and [ZWave_SENSOR_NOTIFICATION_23:luminance:d]< 50 and ([Pioneer_Anlage:input] eq "PS_4" or [Pioneer_Anlage:input] eq "TV") or ([22:15] and [?Stefan:state] eq "absent" and [?Christin:state] eq "absent") or [ZWave_SENSOR_NOTIFICATION_23:luminance:d]> 51)))
(set HUEDevice2 off)




Alles auseinander zu schreiben habe ich auch schon probiert. Aber er triggerd immerwieder auf den Lichtsensor. Aber wenn ich den mit einem Fragezeichen versehe Triggerd er garnicht mehr oder??

Internals:
   DEF        ([?7:00-21:55] and [ZWave_SENSOR_NOTIFICATION_23:luminance:d]< 50) (set HUEDevice2 on)

DOELSEIF

([?19:00-21:55] and [ZWave_SENSOR_NOTIFICATION_23:luminance:d]< 50 and ([Pioneer_Anlage:input] eq "PS_4" or [Pioneer_Anlage:input] eq "TV"))
(set HUEDevice2 off)

DOELSEIF

([22:15] and [Stefan:state] eq "absent" and [Christin:state] eq "absent")
(set HUEDevice2 off)

DOELSEIF

([ZWave_SENSOR_NOTIFICATION_23:luminance:d]> 51)
(set HUEDevice2 off)

   FUUID      6085b12d-f33f-87a8-7f82-342a2fbae8249367
   MODEL      FHEM
   NAME       EsszimmerLicht
   NOTIFYDEV  Stefan,global,Pioneer_Anlage,Christin,ZWave_SENSOR_NOTIFICATION_23
   NR         112
   NTFY_ORDER 50-EsszimmerLicht
   STATE      cmd_1
   TYPE       DOIF
   VERSION    24434 2021-05-13 20:27:41
   READINGS:
     2021-05-27 21:05:57   Device          Stefan
     2021-05-27 21:05:54   cmd             1
     2021-05-27 21:05:54   cmd_event       ZWave_SENSOR_NOTIFICATION_23
     2021-05-27 21:05:54   cmd_nr          1
     2021-05-27 21:05:41   e_Christin_state present
     2021-05-27 21:05:57   e_Stefan_state  present
     2021-05-27 21:05:54   e_ZWave_SENSOR_NOTIFICATION_23_luminance 6 Lux
     2021-05-27 20:59:27   mode            enabled
     2021-05-27 21:05:54   state           cmd_1
     2021-05-27 20:59:27   timer_01_c01    28.05.2021 07:00:00
     2021-05-27 20:59:27   timer_02_c01    27.05.2021 21:55:00
     2021-05-27 20:59:27   timer_03_c02    28.05.2021 19:00:00
     2021-05-27 20:59:27   timer_04_c02    27.05.2021 21:55:00
     2021-05-27 20:59:27   timer_05_c03    27.05.2021 22:15:00
   Regex:
     accu:
     collect:
     cond:
       Christin:
         0:
         1:
         2:
           state      ^Christin$:^state:
         3:
       Pioneer_Anlage:
         1:
           input      ^Pioneer_Anlage$:^input:
       Stefan:
         0:
         1:
         2:
           state      ^Stefan$:^state:
         3:
       ZWave_SENSOR_NOTIFICATION_23:
         0:
           luminance  ^ZWave_SENSOR_NOTIFICATION_23$:^luminance:
         1:
           luminance  ^ZWave_SENSOR_NOTIFICATION_23$:^luminance:
         3:
           luminance  ^ZWave_SENSOR_NOTIFICATION_23$:^luminance:
   attr:
     cmdState:
     wait:
     waitdel:
   condition:
     0          ::DOIF_time($hash,0,1,$wday,$hms) and ::ReadingValDoIf($hash,'ZWave_SENSOR_NOTIFICATION_23','luminance','','d')< 50
     1          ::DOIF_time($hash,2,3,$wday,$hms) and ::ReadingValDoIf($hash,'ZWave_SENSOR_NOTIFICATION_23','luminance','','d')< 50 and (::ReadingValDoIf($hash,'Pioneer_Anlage','input') eq "PS_4" or ::ReadingValDoIf($hash,'Pioneer_Anlage','input') eq "TV")
     2          ::DOIF_time_once($hash,4,$wday) and ::ReadingValDoIf($hash,'Stefan','state') eq "absent" and ::ReadingValDoIf($hash,'Christin','state') eq "absent"
     3          ::ReadingValDoIf($hash,'ZWave_SENSOR_NOTIFICATION_23','luminance','','d')> 51
   days:
   do:
     0:
       0          set HUEDevice2 on
     1:
       0          set HUEDevice2 off
     2:
       0          set HUEDevice2 off
     3:
       0          set HUEDevice2 off
     4:
   helper:
     DEVFILTER  ^global$|^ZWave_SENSOR_NOTIFICATION_23$|^Stefan$|^Pioneer_Anlage$|^Christin$
     NOTIFYDEV  global|ZWave_SENSOR_NOTIFICATION_23|Stefan|Pioneer_Anlage|Christin
     event      present,presence: present
     globalinit 1
     last_timer 5
     sleeptimer -1
     timerdev   ZWave_SENSOR_NOTIFICATION_23
     timerevent luminance: 6 Lux
     triggerDev Stefan
     timerevents:
       luminance: 6 Lux
     timereventsState:
       luminance: 6 Lux
     triggerEvents:
       present
       presence: present
     triggerEventsState:
       state: present
       presence: present
   internals:
   interval:
     0          -1
     1          0
     2          -1
     3          2
   intervalfunc:
   localtime:
     0          1622178000
     1          1622145300
     2          1622221200
     3          1622145300
     4          1622146500
   readings:
     all         ZWave_SENSOR_NOTIFICATION_23:luminance Pioneer_Anlage:input Stefan:state Christin:state
   realtime:
     0          07:00:00
     1          21:55:00
     2          19:00:00
     3          21:55:00
     4          22:15:00
   time:
     0          7:00
     1          21:55:00
     2          19:00:00
     3          21:55:00
     4          22:15:00
   timeCond:
     0          0
     1          0
     2          1
     3          1
     4          2
   timer:
     0          0
     1          0
     2          0
     3          0
     4          0
   timers:
     2           4
   trigger:
   triggertime:
     1622145300:
       localtime  1622145300
       hash:
     1622146500:
       localtime  1622146500
       hash:
     1622178000:
       localtime  1622178000
       hash:
     1622221200:
       localtime  1622221200
       hash:
   uiState:
   uiTable:
Attributes:
   room       Steckdosen

Sany

#9
Hallo Wasserwerk33,

evtl. hilft Dir ja DOIF_Readings: https://fhem.de/commandref_modular_DE.html#DOIF_DOIF_Readings

attr EsszimmerLicht DOIF_Readings esIstHell:([ZWave_SENSOR_NOTIFICATION_23:luminance:d]> 51),
esIstDunkel:([ZWave_SENSOR_NOTIFICATION_23:luminance:d]< 50)


Im DOIF (habe jetzt mal einfach die Version aus deinem letzten Post genommen)
([?7:00-21:55] and [$SELF:esIstDunkel]) (set HUEDevice2 on)

DOELSEIF

((([?19:00-21:55] and ([Pioneer_Anlage:input] eq "PS_4" or [Pioneer_Anlage:input] eq "TV") or ([22:15] and [?Stefan:state] eq "absent" and [?Christin:state] eq "absent") or [$SELF:esIstHell])))
(set HUEDevice2 off)


Das ist ungetestet nur mal aufgeschrieben! Es soll Dir nur veranschaulichen, wie es aussehen kann. Es verhindert, dass das DOIF jedesmal neu getriggert wird, wenn der Lichtsensor neue Daten liefert und diese z.B. immer größer 51 sind.

Viel Erfolg!

P.S. Sollte die Lampe, die wegen Dunkelheit eingeschaltet wurde, den Sensor so beleuchten, dass dieser wieder hell meldet hilft das alles nix. Da solltest Du per Eventmonitor oder Log mal sehr genau beobachten, welche Werte vom Lichtsensor kommen und die Schaltpunkte entsprechend anpassen. Evtl. geht es aber so gar nicht und Du müsstest das physisch lösen, dass der Sensor unabhängig vom geschalteten Licht wird. Das wird aber aus Deinen Angaben (zumindest mir) nicht ganz klar.
fhem als LXC auf Proxmox auf einem minix Z100 , weitere LXC mit ZigBee2MQTT, MariaDB und Grafana. Homematic, FS20, mySensors, MQTT2, Tasmota, Shelly, Z-Wave  ....

Frank_Huber

(([?19:00-21:55] and ([Pioneer_Anlage:input] eq "PS_4" or [Pioneer_Anlage:input] eq "TV")
könnte man noch vereinfachen zu
([?19:00-21:55] and [Pioneer_Anlage:input] =~ "PS_4|TV"

Wasserwerk33

Hi Leute,

Habe es nun ein paar Tage am laufen. Habe es mit dem UserReading versucht. Nun schalten sie garnicht mehr an. Habe nun in viele einzelne Doifs zerlegt. Klappt aber trotzdem nicht.

Habe dann noch einen dummy angelegt dieser wird von einem Doif getriggert der den dummy anschaltet. Das klappt soweit.
Denn dummy frage ich dann einfach über mein EsszimmerLicht ab. Aber es geht nur kurz aus wenn wir die Anlage auf TV umstellen um dann wieder anzugehen.



Internals:
   DEF        ([?7:00-23:00] and [Lichtsensor] eq "on") (set HUEDevice2 on)

DOELSE

(([?19:00-23:00] and [Pioneer_Anlage:input] =~ "PS_4|TV" and
[Lichtsensor:state] =~ "on"))
(set HUEDevice2 off)

DOELSEIF


([22:15] and [Residents:state] =~ "absent|gone")
(set HUEDevice2 off)

DOELSEIF

([Lichtsensor] eq "off")
(set HUEDevice2 off)
   FUUID      6085b12d-f33f-87a8-7f82-342a2fbae8249367
   MODEL      FHEM
   NAME       EsszimmerLicht
   NOTIFYDEV  global,Lichtsensor
   NR         112
   NTFY_ORDER 50-EsszimmerLicht
   STATE      cmd_1
   TYPE       DOIF
   VERSION    24434 2021-05-13 20:27:41
   READINGS:
     2021-06-01 22:59:24   cmd             1
     2021-06-01 22:59:24   cmd_event       EsszimmerLicht
     2021-06-01 22:59:24   cmd_nr          1
     2021-06-01 22:59:20   mode            enabled
     2021-06-01 22:59:24   state           cmd_1
     2021-06-01 23:00:00   timer_01_c01    02.06.2021 07:00:00
     2021-06-01 23:00:00   timer_02_c01    02.06.2021 23:00:00
   Regex:
     accu:
     collect:
     cond:
       Lichtsensor:
         0:
           &STATE     ^Lichtsensor$
   attr:
     cmdState:
     wait:
     waitdel:
   condition:
     0          ::DOIF_time($hash,0,1,$wday,$hms) and ::InternalDoIf($hash,'Lichtsensor','STATE') eq "on"
   days:
   do:
     0:
       0          set HUEDevice2 on
     1:
       0          ([?19:00-23:00] and [Pioneer_Anlage:input] =~ "PS_4|TV" and  [Lichtsensor:state] =~ "on")
       1          set HUEDevice2 off
   helper:
     DEVFILTER  ^global$|^Lichtsensor$
     NOTIFYDEV  global|Lichtsensor
     globalinit 1
     last_timer 2
     sleeptimer -1
     timerdev   
     timerevent
     timerevents
     timereventsState
     triggerDev
     DOIF_eventa:
       cmd_nr: 1
       cmd: 1
       cmd_event: EsszimmerLicht
       cmd_1
     DOIF_eventas:
       cmd_nr: 1
       cmd: 1
       cmd_event: EsszimmerLicht
       state: cmd_1
   internals:
     all         Lichtsensor:STATE
   interval:
     0          -1
     1          0
   intervalfunc:
   localtime:
     0          1622610000
     1          1622667600
   realtime:
     0          07:00:00
     1          23:00:00
   time:
     0          7:00
     1          23:00:00
   timeCond:
     0          0
     1          0
   timer:
     0          0
     1          0
   timers:
   triggertime:
     1622610000:
       localtime  1622610000
       hash:
     1622667600:
       localtime  1622667600
       hash:
   uiState:
   uiTable:
Attributes:
   room       Steckdosen


Hat jemand noch eine Idee

Danke für eure Hilfe

MadMax-FHEM

#12
Ich nutze ja DOIF nicht (wirklich) aber:

Mache wenn Bedingung1 Das erste da (1. DOIF)
Wenn nicht mache das zweite da (DOELSE)
Wenn dann aber: bis hierhin kommt das DOIF doch gar nicht mehr. (2. DOIF)

Nach DOELSE ist Schluss
UND: bei DOELSE gibt es keine Bedingung!
Das wird einfach gemacht, wenn ZUVOR nichts gepasst hat...

Und: durch noch mehr dummy (wo ist der/sind die?) oder userReadings (wo ist das?) die dann wieder irgendwas triggern oder irgendwo abgefragt werden etc.: das macht (für uns und dich) die Fehlersuche nicht einfach(er)...

Ich würde einfach mal GENAU überlegen, welche "triggernde Bedingung" denn eine "Prüfung" auslösen sollen, was GENAU DANN erfüllt/nicht erfüllt sein soll usw.
Das mal sauber hinschreiben und das "geschriebene Wort" mal auf "Unstimmigkeiten" prüfen...

Und dann einfach das Geschriebene in Logik gießen, also z.B. DOIF...
...wenn das mal sauber formuliert ist inkl. was TRIGGERN soll/muss und was "nur" erfüllt/nicht erfüllt sein soll ZU DIESEM ZEITPUNKT (des/der Trigger), dann sollte eine Formulierung als DOIF ja automatisch "rauspurzeln"...

Gruß, Joachim
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)