Hauptmenü

DOIF kleiner als und

Begonnen von neyzen, 06 November 2019, 20:26:36

Vorheriges Thema - Nächstes Thema

neyzen

Hallo,

ich habe Readings, die Uhrzeiten im Format HH:MM beinhalten.

Diese sind im Device "KalanZamaniHesapla"
Internals:
   COMMAND    set KalanZamaniHesapla active
   DEF        +*00:01:00 set KalanZamaniHesapla active
   FUUID      5dbca8a0-f33f-2b39-14f5-68731780bc88ae11
   NAME       KalanZamaniHesapla
   NR         153
   NTM        20:14:01
   PERIODIC   yes
   RELATIVE   yes
   REP        -1
   STATE      Next: 20:14:01
   TIMESPEC   00:01:00
   TRIGGERTIME 1573067641.56956
   TRIGGERTIME_FMT 2019-11-06 20:14:01
   TYPE       at
   READINGS:
     2019-11-06 20:13:01   Aksama          20:50
     2019-11-06 20:13:01   AksamaHesap     20:50:59
     2019-11-06 20:13:01   Ikindiye        18:22
     2019-11-06 20:13:01   IkindiyeHesap   18:22:59
     2019-11-06 20:13:01   Oeglene         15:58
     2019-11-06 20:13:01   OegleneHesap    15:58:59
     2019-11-06 20:13:01   Sabaha          09:13
     2019-11-06 20:13:01   SabahaHesap     09:13:59
     2019-11-06 20:13:01   Yatsiya         22:10
     2019-11-06 20:13:01   YatsiyaHesap    22:10:59
     2019-11-06 20:13:01   state           Next: 20:14:01
Attributes:
   room       Namaz
   userReadings SabahaHesap {abstime2rel(ReadingsVal("Namaz","01_Morgengebet",0))},
OegleneHesap  {abstime2rel(ReadingsVal("Namaz","03_Mittagsgebet",0))},
IkindiyeHesap  {abstime2rel(ReadingsVal("Namaz","04_Nachmittagsgebet",0))},
AksamaHesap {abstime2rel(ReadingsVal("Namaz","05_Abendgebet",0))},
YatsiyaHesap {abstime2rel(ReadingsVal("Namaz","06_Nachtgebet",0))},

Sabaha {ReadingsVal("KalanZamaniHesapla","SabahaHesap","00:00:00")=~/^(\d{1,2}):(\d\d):(\d\d)$/?"$1:$2":ReadingsVal("KalanZamaniHesapla","SabahaHesap","00:00:00")},
Oeglene {ReadingsVal("KalanZamaniHesapla","OegleneHesap","00:00:00")=~/^(\d{1,2}):(\d\d):(\d\d)$/?"$1:$2":ReadingsVal("KalanZamaniHesapla","OegleneHesap","00:00:00")},
Ikindiye {ReadingsVal("KalanZamaniHesapla","IkindiyeHesap","00:00:00")=~/^(\d{1,2}):(\d\d):(\d\d)$/?"$1:$2":ReadingsVal("KalanZamaniHesapla","IkindiyeHesap","00:00:00")},
Aksama {ReadingsVal("KalanZamaniHesapla","AksamaHesap","00:00:00")=~/^(\d{1,2}):(\d\d):(\d\d)$/?"$1:$2":ReadingsVal("KalanZamaniHesapla","AksamaHesap","00:00:00")},
Yatsiya {ReadingsVal("KalanZamaniHesapla","YatsiyaHesap","00:00:00")=~/^(\d{1,2}):(\d\d):(\d\d)$/?"$1:$2":ReadingsVal("KalanZamaniHesapla","YatsiyaHesap","00:00:00")}


Die Readings Sabaha,Oeglene,Ikindiye,Aksama,Yatsiya sind verbleibende Zeiten für bis zu einem Termin. Diese 5 Uhrzeiten (Restuhrzeit) gibt es jeden Tag und sind jeden Tag etwas anders.
Ich möchte mit einem DOIF immer die kleinste Restzeit im Tablet UI darstellen.
Also er soll immer die 5 Restzeiten untereinander vergleichen und immer die kleinste ausgeben.

Also habe ich folgendes DOIF geschrieben, aber dieser funktioniert nicht. Habe ich irgendwo einen Klammerfehler?

Internals:
   DEF        ([[KalanZamaniHesapla:Sabaha]] < [[KalanZamaniHesapla:Oeglene]] and [[KalanZamaniHesapla:Sabaha]] < [[KalanZamaniHesapla:Ikindiye]] and  [[KalanZamaniHesapla:Sabaha]] < [[KalanZamaniHesapla:Aksama]] and  [[KalanZamaniHesapla:Sabaha]] < [[KalanZamaniHesapla:Yatsiya]]) (set  NamazaKalanZaman {(ReadingsVal("KalanZamaniHesapla","Sabaha","18:00"))}) (set HangiNamaz Sabaha)

DOELSEIF ([[KalanZamaniHesapla:Oeglene]] < [[KalanZamaniHesapla:Sabaha]] and  [[KalanZamaniHesapla:Oeglene]] < [[KalanZamaniHesapla:Ikindiye]] and  [[KalanZamaniHesapla:Oeglene]] < [[KalanZamaniHesapla:Aksama]] and  [[KalanZamaniHesapla:Oeglene]] < [[KalanZamaniHesapla:Yatsiya]]) (set  NamazaKalanZaman {(ReadingsVal("KalanZamaniHesapla","Oeglene","18:00"))}) (set HangiNamaz Öglene)

DOELSEIF ([[KalanZamaniHesapla:Ikindiye]] < [[KalanZamaniHesapla:Oeglene]] and  [[KalanZamaniHesapla:Ikindiye]] < [[KalanZamaniHesapla:Sabaha]] and [[KalanZamaniHesapla:Ikindiye]] < [[KalanZamaniHesapla:Aksama]] and  [[KalanZamaniHesapla:Ikindiye]] < [[KalanZamaniHesapla:Yatsiya]]) (set  NamazaKalanZaman {(ReadingsVal("KalanZamaniHesapla","Ikindiye","18:00"))}) (set HangiNamaz Ikindiye)

DOELSEIF ([[KalanZamaniHesapla:Aksama]] < [[KalanZamaniHesapla:Oeglene]] and  [[KalanZamaniHesapla:Aksama]] < [[KalanZamaniHesapla:Ikindiye]] and  [[KalanZamaniHesapla:Aksama]] < [[KalanZamaniHesapla:Sabaha]] and  [[KalanZamaniHesapla:Aksama]] < [[KalanZamaniHesapla:Yatsiya]]) (set  NamazaKalanZaman {(ReadingsVal("KalanZamaniHesapla","Aksama","18:00"))}) (set HangiNamaz Aksama)

DOELSEIF ([[KalanZamaniHesapla:Yatsiya]] < [[KalanZamaniHesapla:Oeglene]] and  [[KalanZamaniHesapla:Yatsiya]] < [[KalanZamaniHesapla:Ikindiye]] and  [[KalanZamaniHesapla:Yatsiya]] < [[KalanZamaniHesapla:Aksama]] and  [[KalanZamaniHesapla:Yatsiya]] < [[KalanZamaniHesapla:Sabaha]]) (set  NamazaKalanZaman {(ReadingsVal("KalanZamaniHesapla","Yatsiya","18:00"))}) (set HangiNamaz Yatsiya)


Damian

Denkfehler:

...[[KalanZamaniHesapla:Sabaha]] < [[KalanZamaniHesapla:Oeglene]]...

kannst du nicht vergleichen, da diese Funktionen (Zeittrigger) nur true/false liefern und keine Zeit.

[KalanZamaniHesapla:Sabaha] < [KalanZamaniHesapla:Oeglene]

könnte eher klappen.
Programmierte FHEM-Module: DOIF-FHEM, DOIF-Perl, DOIF-uiTable, THRESHOLD, FHEM-Befehl: IF

neyzen

#2
mit

Internals:
   DEF        ([KalanZamaniHesapla:Sabaha] < [KalanZamaniHesapla:Oeglene] and [KalanZamaniHesapla:Sabaha] < [KalanZamaniHesapla:Ikindiye] and  [KalanZamaniHesapla:Sabaha] < [KalanZamaniHesapla:Aksama] and  [KalanZamaniHesapla:Sabaha] < [KalanZamaniHesapla:Yatsiya]) (set  NamazaKalanZaman {(ReadingsVal("KalanZamaniHesapla","Sabaha","18:00"))}) (set HangiNamaz Sabaha)

DOELSEIF ([KalanZamaniHesapla:Oeglene] < [KalanZamaniHesapla:Sabaha] and  [KalanZamaniHesapla:Oeglene] < [KalanZamaniHesapla:Ikindiye] and  [KalanZamaniHesapla:Oeglene] < [KalanZamaniHesapla:Aksama] and  [KalanZamaniHesapla:Oeglene] < [KalanZamaniHesapla:Yatsiya]) (set  NamazaKalanZaman {(ReadingsVal("KalanZamaniHesapla","Oeglene","18:00"))}) (set HangiNamaz Öglene)

DOELSEIF ([KalanZamaniHesapla:Ikindiye] < [KalanZamaniHesapla:Oeglene] and  [KalanZamaniHesapla:Ikindiye] < [KalanZamaniHesapla:Sabaha] and [KalanZamaniHesapla:Ikindiye] < [KalanZamaniHesapla:Aksama] and  [KalanZamaniHesapla:Ikindiye] < [KalanZamaniHesapla:Yatsiya]) (set  NamazaKalanZaman {(ReadingsVal("KalanZamaniHesapla","Ikindiye","18:00"))}) (set HangiNamaz Ikindiye)

DOELSEIF ([KalanZamaniHesapla:Aksama] < [KalanZamaniHesapla:Oeglene] and  [KalanZamaniHesapla:Aksama] < [KalanZamaniHesapla:Ikindiye] and  [KalanZamaniHesapla:Aksama] < [KalanZamaniHesapla:Sabaha] and  [KalanZamaniHesapla:Aksama] < [KalanZamaniHesapla:Yatsiya]) (set  NamazaKalanZaman {(ReadingsVal("KalanZamaniHesapla","Aksama","18:00"))}) (set HangiNamaz Aksama)

DOELSEIF ([KalanZamaniHesapla:Yatsiya] < [KalanZamaniHesapla:Oeglene] and  [KalanZamaniHesapla:Yatsiya] < [KalanZamaniHesapla:Ikindiye] and  [KalanZamaniHesapla:Yatsiya] < [KalanZamaniHesapla:Aksama] and  [KalanZamaniHesapla:Yatsiya] < [KalanZamaniHesapla:Sabaha]) (set  NamazaKalanZaman {(ReadingsVal("KalanZamaniHesapla","Yatsiya","18:00"))}) (set HangiNamaz Yatsiya)



bekomme ich folgendes

READINGS:
     2019-11-06 20:55:01   Device          KalanZamaniHesapla
     2019-11-06 20:55:01   cmd             1.2
     2019-11-06 20:55:01   cmd_event       KalanZamaniHesapla
     2019-11-06 20:55:01   cmd_nr          1
     2019-11-06 20:55:01   cmd_seqnr       2
     2019-11-06 20:55:01   e_KalanZamaniHesapla_Aksama 20:08
     2019-11-06 20:55:01   e_KalanZamaniHesapla_Ikindiye 17:40
     2019-11-06 20:55:01   e_KalanZamaniHesapla_Oeglene 15:16
     2019-11-06 20:55:01   e_KalanZamaniHesapla_Sabaha 08:31
     2019-11-06 20:55:01   e_KalanZamaniHesapla_Yatsiya 21:28
     2019-11-06 20:46:07   mode            enabled
     2019-11-06 20:55:01   state           cmd_1
     2019-11-06 20:55:01   warning         condition c01: Argument "08:31" isn't numeric in numeric lt (<)

   Regex:
     accu:
     cond:
       KalanZamaniHesapla:
         0:
           Aksama     ^KalanZamaniHesapla$:^Aksama:
           Ikindiye   ^KalanZamaniHesapla$:^Ikindiye:
           Oeglene    ^KalanZamaniHesapla$:^Oeglene:
           Sabaha     ^KalanZamaniHesapla$:^Sabaha:
           Yatsiya    ^KalanZamaniHesapla$:^Yatsiya:
         1:
           Aksama     ^KalanZamaniHesapla$:^Aksama:
           Ikindiye   ^KalanZamaniHesapla$:^Ikindiye:
           Oeglene    ^KalanZamaniHesapla$:^Oeglene:
           Sabaha     ^KalanZamaniHesapla$:^Sabaha:
           Yatsiya    ^KalanZamaniHesapla$:^Yatsiya:
         2:
           Aksama     ^KalanZamaniHesapla$:^Aksama:
           Ikindiye   ^KalanZamaniHesapla$:^Ikindiye:
           Oeglene    ^KalanZamaniHesapla$:^Oeglene:
           Sabaha     ^KalanZamaniHesapla$:^Sabaha:
           Yatsiya    ^KalanZamaniHesapla$:^Yatsiya:
         3:
           Aksama     ^KalanZamaniHesapla$:^Aksama:
           Ikindiye   ^KalanZamaniHesapla$:^Ikindiye:
           Oeglene    ^KalanZamaniHesapla$:^Oeglene:
           Sabaha     ^KalanZamaniHesapla$:^Sabaha:
           Yatsiya    ^KalanZamaniHesapla$:^Yatsiya:
         4:
           Aksama     ^KalanZamaniHesapla$:^Aksama:
           Ikindiye   ^KalanZamaniHesapla$:^Ikindiye:
           Oeglene    ^KalanZamaniHesapla$:^Oeglene:
           Sabaha     ^KalanZamaniHesapla$:^Sabaha:
           Yatsiya    ^KalanZamaniHesapla$:^Yatsiya:
   attr:
     cmdState:
     wait:
     waitdel:
   condition:
     0          ::ReadingValDoIf($hash,'KalanZamaniHesapla','Sabaha') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Oeglene') and ::ReadingValDoIf($hash,'KalanZamaniHesapla','Sabaha') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Ikindiye') and  ::ReadingValDoIf($hash,'KalanZamaniHesapla','Sabaha') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Aksama') and  ::ReadingValDoIf($hash,'KalanZamaniHesapla','Sabaha') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Yatsiya')
     1          ::ReadingValDoIf($hash,'KalanZamaniHesapla','Oeglene') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Sabaha') and  ::ReadingValDoIf($hash,'KalanZamaniHesapla','Oeglene') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Ikindiye') and  ::ReadingValDoIf($hash,'KalanZamaniHesapla','Oeglene') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Aksama') and  ::ReadingValDoIf($hash,'KalanZamaniHesapla','Oeglene') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Yatsiya')
     2          ::ReadingValDoIf($hash,'KalanZamaniHesapla','Ikindiye') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Oeglene') and  ::ReadingValDoIf($hash,'KalanZamaniHesapla','Ikindiye') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Sabaha') and ::ReadingValDoIf($hash,'KalanZamaniHesapla','Ikindiye') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Aksama') and  ::ReadingValDoIf($hash,'KalanZamaniHesapla','Ikindiye') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Yatsiya')
     3          ::ReadingValDoIf($hash,'KalanZamaniHesapla','Aksama') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Oeglene') and  ::ReadingValDoIf($hash,'KalanZamaniHesapla','Aksama') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Ikindiye') and  ::ReadingValDoIf($hash,'KalanZamaniHesapla','Aksama') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Sabaha') and  ::ReadingValDoIf($hash,'KalanZamaniHesapla','Aksama') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Yatsiya')
     4          ::ReadingValDoIf($hash,'KalanZamaniHesapla','Yatsiya') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Oeglene') and  ::ReadingValDoIf($hash,'KalanZamaniHesapla','Yatsiya') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Ikindiye') and  ::ReadingValDoIf($hash,'KalanZamaniHesapla','Yatsiya') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Aksama') and  ::ReadingValDoIf($hash,'KalanZamaniHesapla','Yatsiya') < ::ReadingValDoIf($hash,'KalanZamaniHesapla','Sabaha')
   do:
     0:
       0          set  NamazaKalanZaman {(ReadingsVal("KalanZamaniHesapla","Sabaha","18:00"))}
       1          set HangiNamaz Sabaha
     1:
       0          set  NamazaKalanZaman {(ReadingsVal("KalanZamaniHesapla","Oeglene","18:00"))}
       1          set HangiNamaz Öglene
     2:
       0          set  NamazaKalanZaman {(ReadingsVal("KalanZamaniHesapla","Ikindiye","18:00"))}
       1          set HangiNamaz Ikindiye
     3:
       0          set  NamazaKalanZaman {(ReadingsVal("KalanZamaniHesapla","Aksama","18:00"))}
       1          set HangiNamaz Aksama
     4:
       0          set  NamazaKalanZaman {(ReadingsVal("KalanZamaniHesapla","Yatsiya","18:00"))}
       1          set HangiNamaz Yatsiya
     5:
   helper:
     DEVFILTER  ^global$|^KalanZamaniHesapla$
     NOTIFYDEV  global|KalanZamaniHesapla
     event      Next: 20:56:01,SabahaHesap: 08:31:59,OegleneHesap: 15:16:59,IkindiyeHesap: 17:40:59,AksamaHesap: 20:08:59,YatsiyaHesap: 21:28:59,Sabaha: 08:31,Oeglene: 15:16,Ikindiye: 17:40,Aksama: 20:08,Yatsiya: 21:28
     globalinit 1
     last_timer 0
     sleeptimer -1
     timerdev   KalanZamaniHesapla
     timerevent Next: 20:56:01,SabahaHesap: 08:31:59,OegleneHesap: 15:16:59,IkindiyeHesap: 17:40:59,AksamaHesap: 20:08:59,YatsiyaHesap: 21:28:59,Sabaha: 08:31,Oeglene: 15:16,Ikindiye: 17:40,Aksama: 20:08,Yatsiya: 21:28
     triggerDev KalanZamaniHesapla
     DOIF_eventa:
       cmd_nr: 1
       cmd_seqnr: 2
       cmd_event: KalanZamaniHesapla
       cmd_1
     DOIF_eventas:
       cmd_nr: 1
       cmd_seqnr: 2
       cmd_event: KalanZamaniHesapla
       state: cmd_1
     timerevents:
       Next: 20:56:01
       SabahaHesap: 08:31:59
       OegleneHesap: 15:16:59
       IkindiyeHesap: 17:40:59
       AksamaHesap: 20:08:59
       YatsiyaHesap: 21:28:59
       Sabaha: 08:31
       Oeglene: 15:16
       Ikindiye: 17:40
       Aksama: 20:08
       Yatsiya: 21:28
     timereventsState:
       state: Next: 20:56:01
       SabahaHesap: 08:31:59
       OegleneHesap: 15:16:59
       IkindiyeHesap: 17:40:59
       AksamaHesap: 20:08:59
       YatsiyaHesap: 21:28:59
       Sabaha: 08:31
       Oeglene: 15:16
       Ikindiye: 17:40
       Aksama: 20:08
       Yatsiya: 21:28
     triggerEvents:
       Next: 20:56:01
       SabahaHesap: 08:31:59
       OegleneHesap: 15:16:59
       IkindiyeHesap: 17:40:59
       AksamaHesap: 20:08:59
       YatsiyaHesap: 21:28:59
       Sabaha: 08:31
       Oeglene: 15:16
       Ikindiye: 17:40
       Aksama: 20:08
       Yatsiya: 21:28
     triggerEventsState:
       state: Next: 20:56:01
       SabahaHesap: 08:31:59
       OegleneHesap: 15:16:59
       IkindiyeHesap: 17:40:59
       AksamaHesap: 20:08:59
       YatsiyaHesap: 21:28:59
       Sabaha: 08:31
       Oeglene: 15:16
       Ikindiye: 17:40
       Aksama: 20:08
       Yatsiya: 21:28
   internals:
   readings:
     all         KalanZamaniHesapla:Sabaha KalanZamaniHesapla:Oeglene KalanZamaniHesapla:Ikindiye KalanZamaniHesapla:Aksama KalanZamaniHesapla:Yatsiya
   trigger:
   uiState:
   uiTable:
Attributes:
   do         always
   room       Namaz


Jetzt springt er auf cmd1,mal abwarten was morgen passiert.
was ist mit dieser Warnung,kann ich die ignorieren?

Damian

klar, Strings mit lt vergleichen.
Programmierte FHEM-Module: DOIF-FHEM, DOIF-Perl, DOIF-uiTable, THRESHOLD, FHEM-Befehl: IF