[Gelöst] DOIF Problem Beleuchtung

Begonnen von Starsurfer, 12 Januar 2019, 08:41:02

Vorheriges Thema - Nächstes Thema

Starsurfer

Moin,
ich habe hier zwei DOIFs, ein DOIF soll das Licht Morgens/Abends Einschalten und ein DOIF was das Licht über einen Bewegungsmelder einschaltet.
Beide DOIFs funktionieren einzeln, aber nicht zusammen.

Hier mal ein List der DOIFS:
Internals:
   DEF        (([5:50-8:30|8] or [7:00-8:30|7] or [15:00-22:10|8] or [15:00-22:30|7]) and [myTwilight:twilight_weather] < 58)

  (set EG_Beleuchtung on)
DOELSE
  (set EG_Beleuchtung off)
   MODEL      FHEM
   NAME       doif_EG_Beleuchtung
   NR         241
   NTFY_ORDER 50-doif_EG_Beleuchtung
   STATE      cmd_2
   TYPE       DOIF
   READINGS:
     2019-01-12 08:28:29   Device          myTwilight
     2019-01-12 08:28:29   cmd             2
     2019-01-12 08:28:29   cmd_event       myTwilight
     2019-01-12 08:28:29   cmd_nr          2
     2019-01-12 08:28:29   e_myTwilight_twilight_weather 59.7
     2019-01-11 21:14:33   mode            enabled
     2019-01-12 08:28:29   state           cmd_2
     2019-01-11 21:14:33   timer_01_c01    12.01.2019 05:50:00|8
     2019-01-11 21:14:33   timer_02_c01    12.01.2019 08:30:00|8
     2019-01-11 21:14:33   timer_03_c01    12.01.2019 07:00:00|7
     2019-01-11 21:14:33   timer_04_c01    12.01.2019 08:30:00|7
     2019-01-11 22:10:00   timer_05_c01    12.01.2019 15:00:00|8
     2019-01-11 22:10:00   timer_06_c01    12.01.2019 22:10:00|8
     2019-01-11 22:30:00   timer_07_c01    12.01.2019 15:00:00|7
     2019-01-11 22:30:00   timer_08_c01    12.01.2019 22:30:00|7
   Regex:
   attr:
     cmdState:
     wait:
     waitdel:
   condition:
     0          (::DOIF_time($hash,0,1,$wday,$hms,"8") or ::DOIF_time($hash,2,3,$wday,$hms,"7") or ::DOIF_time($hash,4,5,$wday,$hms,"8") or ::DOIF_time($hash,6,7,$wday,$hms,"7")) and ::ReadingValDoIf($hash,'myTwilight','twilight_weather') < 58
   days:
     0          8
     1          8
     2          7
     3          7
     4          8
     5          8
     6          7
     7          7
   devices:
     0           myTwilight
     all         myTwilight
   do:
     0:
       0          set EG_Beleuchtung on
     1:
       0          set EG_Beleuchtung off
   helper:
     event      azimuth: 125.5,elevation: -1.24,twilight: 59.7,twilight_weather: 59.7,compasspoint: east-southeast
     globalinit 1
     last_timer 8
     sleeptimer -1
     timerdev   myTwilight
     timerevent azimuth: 125.5,elevation: -1.24,twilight: 59.7,twilight_weather: 59.7,compasspoint: east-southeast
     triggerDev myTwilight
     DOIF_eventas:
       cmd_nr: 2
       cmd: 2
       cmd_event: myTwilight
       state: cmd_2
     timerevents:
       azimuth: 125.5
       elevation: -1.24
       twilight: 59.7
       twilight_weather: 59.7
       compasspoint: east-southeast
     timereventsState:
       azimuth: 125.5
       elevation: -1.24
       twilight: 59.7
       twilight_weather: 59.7
       compasspoint: east-southeast
     triggerEvents:
       azimuth: 125.5
       elevation: -1.24
       twilight: 59.7
       twilight_weather: 59.7
       compasspoint: east-southeast
     triggerEventsState:
       azimuth: 125.5
       elevation: -1.24
       twilight: 59.7
       twilight_weather: 59.7
       compasspoint: east-southeast
   internals:
   interval:
     0          -1
     1          0
     2          -1
     3          2
     4          -1
     5          4
     6          -1
     7          6
   intervalfunc:
   intervaltimer:
   itimer:
   localtime:
     0          1547268600
     1          1547278200
     2          1547272800
     3          1547278200
     4          1547301600
     5          1547327400
     6          1547301600
     7          1547328600
   readings:
     0           myTwilight:twilight_weather
     all         myTwilight:twilight_weather
   realtime:
     0          05:50:00
     1          08:30:00
     2          07:00:00
     3          08:30:00
     4          15:00:00
     5          22:10:00
     6          15:00:00
     7          22:30:00
   time:
     0          5:50
     1          8:30
     2          7:00
     3          8:30
     4          15:00:00
     5          22:10:00
     6          15:00:00
     7          22:30:00
   timeCond:
     0          0
     1          0
     2          0
     3          0
     4          0
     5          0
     6          0
     7          0
   timer:
     0          0
     1          0
     2          0
     3          0
     4          0
     5          0
     6          0
     7          0
   timers:
     0           0  1  2  3  4  5  6  7
   trigger:
   triggertime:
     1547278200:
       localtime  1547278200
       hash:
     1547301600:
       localtime  1547301600
       hash:
     1547327400:
       localtime  1547327400
       hash:
     1547328600:
       localtime  1547328600
       hash:
   uiState:
   uiTable:
Attributes:
   DbLogExclude .*
   do         always
   room       HUEDevice,Zeitschaltuhren
 

Internals:
   DEF        (([Bewegungsmelder_Kueche:state] eq "motion" and [MiGateway:state] eq "off" and [Bewegungsmelder_Kueche_Lichtlevel:lux] < 40 and [22:10-05:50] and [myTwilight:twilight_weather] < 40))
(set MiGateway on; set MiGateway pct 50; set HUEDevice1 on)
DOELSEIF
(([Bewegungsmelder_Kueche:state] eq "nomotion"))
(set MiGateway off; set HUEDevice1 off)
   MODEL      FHEM
   NAME       di_Kueche_Licht
   NR         371
   NTFY_ORDER 50-di_Kueche_Licht
   STATE      cmd_2
   TYPE       DOIF
   READINGS:
     2019-01-12 08:28:43   Device          MiGateway
     2019-01-12 08:26:23   cmd             2
     2019-01-12 08:26:23   cmd_event       Bewegungsmelder_Kueche
     2019-01-12 08:26:23   cmd_nr          2
     2019-01-12 08:04:00   e_Bewegungsmelder_Kueche_Lichtlevel_lux 30
     2019-01-12 08:27:52   e_Bewegungsmelder_Kueche_state motion
     2019-01-12 08:28:29   e_myTwilight_twilight_weather 59.7
     2019-01-11 20:47:58   mode            enabled
     2019-01-12 08:26:23   state           cmd_2
     2019-01-12 05:50:00   timer_01_c01    12.01.2019 22:10:00
     2019-01-12 05:50:00   timer_02_c01    13.01.2019 05:50:00
     2019-01-12 08:26:23   wait_timer      no timer
   Regex:
   attr:
     cmdState:
     wait:
       0:
         0
       1:
         80
     waitdel:
   condition:
     0          (::ReadingValDoIf($hash,'Bewegungsmelder_Kueche','state') eq "motion" and ::ReadingValDoIf($hash,'MiGateway','state') eq "off" and ::ReadingValDoIf($hash,'Bewegungsmelder_Kueche_Lichtlevel','lux') < 40 and ::DOIF_time($hash,0,1,$wday,$hms) and ::ReadingValDoIf($hash,'myTwilight','twilight_weather') < 40)
     1          (::ReadingValDoIf($hash,'Bewegungsmelder_Kueche','state') eq "nomotion")
   days:
   devices:
     0           Bewegungsmelder_Kueche MiGateway Bewegungsmelder_Kueche_Lichtlevel myTwilight
     1           Bewegungsmelder_Kueche
     all         Bewegungsmelder_Kueche MiGateway Bewegungsmelder_Kueche_Lichtlevel myTwilight
   do:
     0:
       0          set MiGateway on; set MiGateway pct 50; set HUEDevice1 on
     1:
       0          set MiGateway off; set HUEDevice1 off
     2:
   helper:
     event      token: vC1quwwfNfeqleKd
     globalinit 1
     last_timer 2
     sleepdevice Bewegungsmelder_Kueche
     sleepsubtimer -1
     sleeptimer -1
     timerdev   Bewegungsmelder_Kueche
     timerevent nomotion
     triggerDev MiGateway
     DOIF_eventas:
       cmd_nr: 2
       cmd: 2
       cmd_event: Bewegungsmelder_Kueche
       state: cmd_2
     timerevents:
       nomotion
     timereventsState:
       state: nomotion
     triggerEvents:
       token: vC1quwwfNfeqleKd
     triggerEventsState:
       token: vC1quwwfNfeqleKd
   internals:
   interval:
     0          -1
     1          0
   intervalfunc:
   intervaltimer:
   itimer:
   localtime:
     0          1547327400
     1          1547355000
   readings:
     0           Bewegungsmelder_Kueche:state MiGateway:state Bewegungsmelder_Kueche_Lichtlevel:lux myTwilight:twilight_weather
     1           Bewegungsmelder_Kueche:state
     all         Bewegungsmelder_Kueche:state MiGateway:state Bewegungsmelder_Kueche_Lichtlevel:lux myTwilight:twilight_weather
   realtime:
     0          22:10:00
     1          05:50:00
   time:
     0          22:10:00
     1          05:50:00
   timeCond:
     0          0
     1          0
   timer:
     0          0
     1          0
   timers:
     0           0  1
   trigger:
   triggertime:
     1547327400:
       localtime  1547327400
       hash:
     1547355000:
       localtime  1547355000
       hash:
   uiState:
   uiTable:
Attributes:
   DbLogExclude .*
   do         resetwait
   room       Zeitschaltuhren
   wait       0:80


Jetzt mein Problem, das Zeitgesteuerte DOIF soll die Lampe in der Küche und Flur in der oben angegebenen Zeit einschalten. Das Funktioniert, zumindest für die Flur Lampe, Die Lampe in der Küche, welche Nachts auch über Bewegungsmelder angehen soll, wechselt aber fröhlich den Status An/Aus. Ich denke das daß das DOIF EG_Beleuchtung die Lampe anschaltet und das DOIF Bewegungsmelder_Kueche die Lampe wieder ausschaltet.

Hat jemand vielleicht einen Tip für mich wie ich die Lampe in der Küche für beide DOIFs verwenden kann?
FHEM Server: Fujitsu Esprimo q920 + LaCrosseGateway + HM-MOD-RPI-PCB WLAN + ConBee
HomeMatic HM-CC-RT-DN - Sonoff Tasmota
LaCrosse TX29DTH - Innr SP120 - Osram Smart+ Plug
Arduino Mega - MQTT - Pluggit 300
https://www.diy-robot-lawn-mower.com

Ellert

Du könntest den nomotion-Zweig verriegeln mit ...and [doif_EG_Beleuchtung] eq "cmd_2" nur wenn das Licht geplant aus ist, kann der BW ausschalten.

Starsurfer

OK danke, werde ich morgen mal testen, wenn ich wieder zu Hause bin.
FHEM Server: Fujitsu Esprimo q920 + LaCrosseGateway + HM-MOD-RPI-PCB WLAN + ConBee
HomeMatic HM-CC-RT-DN - Sonoff Tasmota
LaCrosse TX29DTH - Innr SP120 - Osram Smart+ Plug
Arduino Mega - MQTT - Pluggit 300
https://www.diy-robot-lawn-mower.com

Starsurfer

So gerade getestet und scheint jetzt zu funktionieren wie es soll.
Danke
FHEM Server: Fujitsu Esprimo q920 + LaCrosseGateway + HM-MOD-RPI-PCB WLAN + ConBee
HomeMatic HM-CC-RT-DN - Sonoff Tasmota
LaCrosse TX29DTH - Innr SP120 - Osram Smart+ Plug
Arduino Mega - MQTT - Pluggit 300
https://www.diy-robot-lawn-mower.com