Hat das DOIF wieder oder immernoch ein Problem?

Begonnen von misux, 28 April 2018, 22:41:06

Vorheriges Thema - Nächstes Thema

misux

weil ich das gerade getestet habe... oder irgendwas mit dem reset falsch gemacht habe.
Also:

Fall heute: um 20.20Uhr ist ([Tageslicht_indoor]) auf Nacht umgesprungen und der Timer 900sek hat gestartet. Währen der Timer noch lief und ca 10min noch vor sich hatte, habe ich den TV eingeschaltet ([TVTime:state] ist auf ON umgesprungen) UND der Timer wurde leider nicht resettet und die Lichter (set WZBodenLed on, set WZEZ_WZFLed on) wurden leider eingeschaltet was nicht passieren dürfte weil ja  [TVTime:state] ON war...


Das ist das List vom Zustand direkt nach [Tageslicht_indoor] Nacht und [TVTime:state] ON.

Internals:
   DEF        ([Tageslicht_indoor] eq "Nacht" and [?TVTime:state] eq "off" and [?15:00-22:00]) (set WZBodenLed on, set WZEZ_WZFLed on)
DOELSEIF
([?Tageslicht_indoor] eq "Nacht" and [TVTime:state] eq "off" and [?15:00-22:00]) (set WZBodenLed on, set WZEZ_WZFLed on)
DOELSEIF
([TVTime:state] eq "off" and [22:00-05:00] and [?PartyTime:state] eq "off")
(set WZEZ_WZFLed on-for-timer 600) (set WZBodenLed on-for-timer 900)
DOELSEIF
([?TVTime:state] eq "off" and [?22:00-05:00] and [PartyTime:state] eq "off") (set WZBodenLed off) (set WZEZ_WZFLed off)
   MODEL      FHEM
   NAME       DOIFWzEzBeleuchtung
   NR         108
   NTFY_ORDER 50-DOIFWzEzBeleuchtung
   STATE      cmd_3
   TYPE       DOIF
   READINGS:
     2018-04-29 20:21:40   Device          TVTime
     2018-04-28 22:25:14   cmd             3.2
     2018-04-28 22:25:14   cmd_event       TVTime
     2018-04-28 22:25:14   cmd_nr          3
     2018-04-28 22:25:14   cmd_seqnr       2
     2018-04-26 16:34:48   e_PartyTime_state off
     2018-04-29 20:21:40   e_TVTime_state  on
     2018-04-29 20:20:49   e_Tageslicht_indoor_STATE Nacht
     2018-04-22 09:21:18   mode            enabled
     2018-04-28 22:25:14   state           cmd_3
     2018-04-28 22:00:00   timer_01_c01    29.04.2018 15:00:00
     2018-04-28 22:00:00   timer_02_c01    29.04.2018 22:00:00
     2018-04-28 22:00:00   timer_03_c02    29.04.2018 15:00:00
     2018-04-28 22:00:00   timer_04_c02    29.04.2018 22:00:00
     2018-04-29 05:00:00   timer_05_c03    29.04.2018 22:00:00
     2018-04-29 05:00:00   timer_06_c03    30.04.2018 05:00:00
     2018-04-29 05:00:00   timer_07_c04    29.04.2018 22:00:00
     2018-04-29 05:00:00   timer_08_c04    30.04.2018 05:00:00
     2018-04-29 20:20:49   wait_timer      29.04.2018 20:35:49 cmd_1 Tageslicht_indoor
   Regex:
   condition:
     0          InternalDoIf($hash,'Tageslicht_indoor','STATE') eq "Nacht" and ReadingValDoIf($hash,'TVTime','state') eq "off" and DOIF_time($hash,0,1,$wday,$hms)
     1          InternalDoIf($hash,'Tageslicht_indoor','STATE') eq "Nacht" and ReadingValDoIf($hash,'TVTime','state') eq "off" and DOIF_time($hash,2,3,$wday,$hms)
     2          ReadingValDoIf($hash,'TVTime','state') eq "off" and DOIF_time($hash,4,5,$wday,$hms) and ReadingValDoIf($hash,'PartyTime','state') eq "off"
     3          ReadingValDoIf($hash,'TVTime','state') eq "off" and DOIF_time($hash,6,7,$wday,$hms) and ReadingValDoIf($hash,'PartyTime','state') eq "off"
   days:
   devices:
     0           Tageslicht_indoor
     1           TVTime
     2           TVTime
     3           PartyTime
     all         Tageslicht_indoor TVTime PartyTime
   do:
     0:
       0          set WZBodenLed on, set WZEZ_WZFLed on
     1:
       0          set WZBodenLed on, set WZEZ_WZFLed on
     2:
       0          set WZEZ_WZFLed on-for-timer 600
       1          set WZBodenLed on-for-timer 900
     3:
       0          set WZBodenLed off
       1          set WZEZ_WZFLed off
     4:
   helper:
     DOIF_Readings_events
     DOIF_eventas
     event      on
     globalinit 1
     last_timer 8
     sleepdevice Tageslicht_indoor
     sleepsubtimer 0
     sleeptimer 0
     timerdev   Tageslicht_indoor
     timerevent Nacht
     triggerDev TVTime
     timerevents:
       Nacht
     timereventsState:
       state: Nacht
     triggerEvents:
       on
     triggerEventsState:
       state: on
   internals:
     0           Tageslicht_indoor:STATE
     1           Tageslicht_indoor:STATE
     all         Tageslicht_indoor:STATE
   interval:
     0          -1
     1          0
     2          -1
     3          2
     4          -1
     5          4
     6          -1
     7          6
   itimer:
   localtime:
     0          1525006800
     1          1525032000
     2          1525006800
     3          1525032000
     4          1525032000
     5          1525057200
     6          1525032000
     7          1525057200
   perlblock:
   readings:
     1           TVTime:state
     2           TVTime:state
     3           PartyTime:state
     all         TVTime:state PartyTime:state
   realtime:
     0          15:00:00
     1          22:00:00
     2          15:00:00
     3          22:00:00
     4          22:00:00
     5          05:00:00
     6          22:00:00
     7          05:00:00
   time:
     0          15:00:00
     1          22:00:00
     2          15:00:00
     3          22:00:00
     4          22:00:00
     5          05:00:00
     6          22:00:00
     7          05:00:00
   timeCond:
     0          0
     1          0
     2          1
     3          1
     4          2
     5          2
     6          3
     7          3
   timer:
     0          0
     1          0
     2          0
     3          0
     4          0
     5          0
     6          0
     7          0
   timers:
     2           4  5
   trigger:
   triggertime:
     1525032000:
       localtime  1525032000
       hash:
     1525057200:
       localtime  1525057200
       hash:
   uiState:
   uiTable:
Attributes:
   do         resetwait
   room       2 DOIF
   wait       900


Ich habe ja das do resetwait im Attr drin... wie sage ich es ihm das er den Timer resetten soll wenn TVTime auf ON springt während der Timer gerade läuft...?  :-[

Damian

Zitat von: misux am 29 April 2018, 20:44:49
weil ich das gerade getestet habe... oder irgendwas mit dem reset falsch gemacht habe.
Also:

Fall heute: um 20.20Uhr ist ([Tageslicht_indoor]) auf Nacht umgesprungen und der Timer 900sek hat gestartet. Währen der Timer noch lief und ca 10min noch vor sich hatte, habe ich den TV eingeschaltet ([TVTime:state] ist auf ON umgesprungen) UND der Timer wurde leider nicht resettet und die Lichter (set WZBodenLed on, set WZEZ_WZFLed on) wurden leider eingeschaltet was nicht passieren dürfte weil ja  [TVTime:state] ON war...


Das ist das List vom Zustand direkt nach [Tageslicht_indoor] Nacht und [TVTime:state] ON.

Internals:
   DEF        ([Tageslicht_indoor] eq "Nacht" and [?TVTime:state] eq "off" and [?15:00-22:00]) (set WZBodenLed on, set WZEZ_WZFLed on)
DOELSEIF
([?Tageslicht_indoor] eq "Nacht" and [TVTime:state] eq "off" and [?15:00-22:00]) (set WZBodenLed on, set WZEZ_WZFLed on)
DOELSEIF
([TVTime:state] eq "off" and [22:00-05:00] and [?PartyTime:state] eq "off")
(set WZEZ_WZFLed on-for-timer 600) (set WZBodenLed on-for-timer 900)
DOELSEIF
([?TVTime:state] eq "off" and [?22:00-05:00] and [PartyTime:state] eq "off") (set WZBodenLed off) (set WZEZ_WZFLed off)
   MODEL      FHEM
   NAME       DOIFWzEzBeleuchtung
   NR         108
   NTFY_ORDER 50-DOIFWzEzBeleuchtung
   STATE      cmd_3
   TYPE       DOIF
   READINGS:
     2018-04-29 20:21:40   Device          TVTime
     2018-04-28 22:25:14   cmd             3.2
     2018-04-28 22:25:14   cmd_event       TVTime
     2018-04-28 22:25:14   cmd_nr          3
     2018-04-28 22:25:14   cmd_seqnr       2
     2018-04-26 16:34:48   e_PartyTime_state off
     2018-04-29 20:21:40   e_TVTime_state  on
     2018-04-29 20:20:49   e_Tageslicht_indoor_STATE Nacht
     2018-04-22 09:21:18   mode            enabled
     2018-04-28 22:25:14   state           cmd_3
     2018-04-28 22:00:00   timer_01_c01    29.04.2018 15:00:00
     2018-04-28 22:00:00   timer_02_c01    29.04.2018 22:00:00
     2018-04-28 22:00:00   timer_03_c02    29.04.2018 15:00:00
     2018-04-28 22:00:00   timer_04_c02    29.04.2018 22:00:00
     2018-04-29 05:00:00   timer_05_c03    29.04.2018 22:00:00
     2018-04-29 05:00:00   timer_06_c03    30.04.2018 05:00:00
     2018-04-29 05:00:00   timer_07_c04    29.04.2018 22:00:00
     2018-04-29 05:00:00   timer_08_c04    30.04.2018 05:00:00
     2018-04-29 20:20:49   wait_timer      29.04.2018 20:35:49 cmd_1 Tageslicht_indoor
   Regex:
   condition:
     0          InternalDoIf($hash,'Tageslicht_indoor','STATE') eq "Nacht" and ReadingValDoIf($hash,'TVTime','state') eq "off" and DOIF_time($hash,0,1,$wday,$hms)
     1          InternalDoIf($hash,'Tageslicht_indoor','STATE') eq "Nacht" and ReadingValDoIf($hash,'TVTime','state') eq "off" and DOIF_time($hash,2,3,$wday,$hms)
     2          ReadingValDoIf($hash,'TVTime','state') eq "off" and DOIF_time($hash,4,5,$wday,$hms) and ReadingValDoIf($hash,'PartyTime','state') eq "off"
     3          ReadingValDoIf($hash,'TVTime','state') eq "off" and DOIF_time($hash,6,7,$wday,$hms) and ReadingValDoIf($hash,'PartyTime','state') eq "off"
   days:
   devices:
     0           Tageslicht_indoor
     1           TVTime
     2           TVTime
     3           PartyTime
     all         Tageslicht_indoor TVTime PartyTime
   do:
     0:
       0          set WZBodenLed on, set WZEZ_WZFLed on
     1:
       0          set WZBodenLed on, set WZEZ_WZFLed on
     2:
       0          set WZEZ_WZFLed on-for-timer 600
       1          set WZBodenLed on-for-timer 900
     3:
       0          set WZBodenLed off
       1          set WZEZ_WZFLed off
     4:
   helper:
     DOIF_Readings_events
     DOIF_eventas
     event      on
     globalinit 1
     last_timer 8
     sleepdevice Tageslicht_indoor
     sleepsubtimer 0
     sleeptimer 0
     timerdev   Tageslicht_indoor
     timerevent Nacht
     triggerDev TVTime
     timerevents:
       Nacht
     timereventsState:
       state: Nacht
     triggerEvents:
       on
     triggerEventsState:
       state: on
   internals:
     0           Tageslicht_indoor:STATE
     1           Tageslicht_indoor:STATE
     all         Tageslicht_indoor:STATE
   interval:
     0          -1
     1          0
     2          -1
     3          2
     4          -1
     5          4
     6          -1
     7          6
   itimer:
   localtime:
     0          1525006800
     1          1525032000
     2          1525006800
     3          1525032000
     4          1525032000
     5          1525057200
     6          1525032000
     7          1525057200
   perlblock:
   readings:
     1           TVTime:state
     2           TVTime:state
     3           PartyTime:state
     all         TVTime:state PartyTime:state
   realtime:
     0          15:00:00
     1          22:00:00
     2          15:00:00
     3          22:00:00
     4          22:00:00
     5          05:00:00
     6          22:00:00
     7          05:00:00
   time:
     0          15:00:00
     1          22:00:00
     2          15:00:00
     3          22:00:00
     4          22:00:00
     5          05:00:00
     6          22:00:00
     7          05:00:00
   timeCond:
     0          0
     1          0
     2          1
     3          1
     4          2
     5          2
     6          3
     7          3
   timer:
     0          0
     1          0
     2          0
     3          0
     4          0
     5          0
     6          0
     7          0
   timers:
     2           4  5
   trigger:
   triggertime:
     1525032000:
       localtime  1525032000
       hash:
     1525057200:
       localtime  1525057200
       hash:
   uiState:
   uiTable:
Attributes:
   do         resetwait
   room       2 DOIF
   wait       900


Ich habe ja das do resetwait im Attr drin... wie sage ich es ihm das er den Timer resetten soll wenn TVTime auf ON springt während der Timer gerade läuft...?  :-[

Wie schon geschrieben: Du brauchst einen Zweig der auf dein Ereignis reagiert und damit den Zustand des Moduls verändert:

z. B.:

DOELSEIF ([TVTime:"on"])

Ausführungscode brauchst du dazu nicht, Hauptsache der Zustand des Moduls ändert sich.
Programmierte FHEM-Module: DOIF-FHEM, DOIF-Perl, DOIF-uiTable, THRESHOLD, FHEM-Befehl: IF

misux

 ???
Aha, okay... das habe ich wirklich nicht wirklich verstanden aber ich denke jetzt vermute ich weis was du meinst...

Habe das DOIF im Prinzip nur mit deinem Code am Ende ergänzt... Hoffe das funktioniert.... Sehe ich dann denke ich morgen wieder.

Vielen Dank schon mal!

Hier der ergänzte Code:

([Tageslicht_indoor] eq "Nacht" and [?TVTime:state] eq "off" and [?15:00-22:00]) (set WZBodenLed on, set WZEZ_WZFLed on)
DOELSEIF
([?Tageslicht_indoor] eq "Nacht" and [TVTime:state] eq "off" and [?15:00-22:00]) (set WZBodenLed on, set WZEZ_WZFLed on)
DOELSEIF
([TVTime:state] eq "off" and [22:00-05:00] and [?PartyTime:state] eq "off")
(set WZEZ_WZFLed on-for-timer 600) (set WZBodenLed on-for-timer 900)
DOELSEIF
([?TVTime:state] eq "off" and [?22:00-05:00] and [PartyTime:state] eq "off") (set WZBodenLed off) (set WZEZ_WZFLed off)
DOELSEIF
([TVTime:"on"])