Hauptmenü

Zeitschaltuhr mit DOIF

Begonnen von Home_Fhem, 02 Dezember 2017, 09:23:25

Vorheriges Thema - Nächstes Thema

en-trust

Heute zum Samstag um 10:00 war die Beleuchtung immernoch an, obwohl twilight:light auf 6 stand und die Uhrzeit auch außerhalb der definition lag.

Internals:
   CFGFN      ./FHEM/fhem_multimedia.cfg
   DEF        ([Modus_RL] eq "XMas" and ([6:30-9:00] or [13:00-22:00]) and [twilight:light] < 5) (set Weihnachtsbeleuchtung on)
DOELSEIF ([Modus_RL] eq "XMas" and [22:00]) (set Weihnachtsbeleuchtung off)
   NAME       XMasLights.Auto
   NR         765
   NTFY_ORDER 50-XMasLights.Auto
   STATE      cmd_1
   TYPE       DOIF
   READINGS:
     2017-12-16 10:30:42   Device          twilight
     2017-12-16 06:30:01   cmd             1
     2017-12-16 06:30:01   cmd_event       timer_1
     2017-12-16 06:30:01   cmd_nr          1
     2017-12-16 10:30:42   e_twilight_light 6
     2017-12-16 06:30:01   state           cmd_1
     2017-12-16 09:00:00   timer_01_c01    17.12.2017 06:30:00
     2017-12-16 09:00:00   timer_02_c01    17.12.2017 09:00:00
     2017-12-16 08:30:17   timer_03_c01    16.12.2017 13:00:00
     2017-12-16 08:30:17   timer_04_c01    16.12.2017 22:00:00
     2017-12-16 08:30:17   timer_05_c02    16.12.2017 22:00:00
   condition:
     0          InternalDoIf($hash,'Modus_RL','STATE') eq "XMas" and (DOIF_time($hash,0,1,$wday,$hms) or DOIF_time($hash,2,3,$wday,$hms)) and ReadingValDoIf($hash,'twilight','light') < 5
     1          InternalDoIf($hash,'Modus_RL','STATE') eq "XMas" and DOIF_time_once($hash,4,$wday)
   days:
   devices:
     0           Modus_RL twilight
     1           Modus_RL
     all         Modus_RL twilight
   do:
     0:
       0          set Weihnachtsbeleuchtung on
     1:
       0          set Weihnachtsbeleuchtung off
     2:
   helper:
     event      azimuth: 152.47,elevation: 10.74,twilight: 100,twilight_weather: 100,compasspoint: southeast
     globalinit 1
     last_timer 5
     sleeptimer -1
     timerdev   twilight
     timerevent azimuth: 130.44,elevation: 0.52,twilight: 69.6,twilight_weather: 55.1,compasspoint: east-southeast
     triggerDev twilight
     timerevents:
       azimuth: 130.44
       elevation: 0.52
       twilight: 69.6
       twilight_weather: 55.1
       compasspoint: east-southeast
     timereventsState:
       azimuth: 130.44
       elevation: 0.52
       twilight: 69.6
       twilight_weather: 55.1
       compasspoint: east-southeast
     triggerEvents:
       azimuth: 152.47
       elevation: 10.74
       twilight: 100
       twilight_weather: 100
       compasspoint: southeast
     triggerEventsState:
       azimuth: 152.47
       elevation: 10.74
       twilight: 100
       twilight_weather: 100
       compasspoint: southeast
   internals:
     0           Modus_RL:STATE
     1           Modus_RL:STATE
     all         Modus_RL:STATE
   interval:
     0          -1
     1          0
     2          -1
     3          2
   itimer:
   localtime:
     0          1513488600
     1          1513497600
     2          1513425600
     3          1513458000
     4          1513458000
   readings:
     0           twilight:light
     all         twilight:light
   realtime:
     0          06:30:00
     1          09:00:00
     2          13:00:00
     3          22:00:00
     4          22:00:00
   regexp:
     0:
     1:
     all:
   state:
     STATE:
   time:
     0          6:30
     1          9:00
     2          13:00:00
     3          22:00:00
     4          22:00:00
   timeCond:
     0          0
     1          0
     2          0
     3          0
     4          1
   timer:
     0          0
     1          0
     2          0
     3          0
     4          0
   timers:
     0           0  1  2  3
     1           4
   trigger:
   triggertime:
     1513425600:
       localtime  1513425600
       hash:
     1513458000:
       localtime  1513458000
       hash:
     1513488600:
       localtime  1513488600
       hash:
     1513497600:
       localtime  1513497600
       hash:
Attributes:
   group      Zeitschaltuhr
   room       Automation


Was kann es jetzt sein ?

amenomade

DOELSEIF ([Modus_RL] eq "XMas" and [22:00]) (set Weihnachtsbeleuchtung off)

Nur um 22:00 geht es aus.
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

en-trust

Müsste ich jetzt jede einzelne uhrzeit mit on/Off abfragen oder kann ich das zusammenfassen. Am besten wäre das es bei twilight egal ob uhrzeit an bleibt.

amenomade

Prinzipiell: so lange eine Bedingung wahr bleibt, wird nichts weiteres getan. Wenn die Bedingung nicht mehr wahr ist, dann werden evtl. auch die anderen bewertet.

Ich würde einfach dein DOELSEIF durch ein DOELSE ersetzen.

([Modus_RL] eq "XMas" and ([6:30-9:00] or [13:00-22:00]) and [twilight:light] < 5) (set Weihnachtsbeleuchtung on)
DOELSE (set Weihnachtsbeleuchtung off)


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

en-trust

#19
würde das auch funktionieren ?

define XMasLights.Auto DOIF ([Modus_RL] eq "XMas" and [6:30-9:00] and [twilight:light] < 5) (set Weihnachtsbeleuchtung on) \
DOELSEIF ([Modus_RL] eq "XMas" and [13:00-22:00] and [twilight:light] < 5) (set Weihnachtsbeleuchtung on) \
DOELSEIF ([Modus_RL] eq "XMas" and [twilight:light] < 5) (set Weihnachtsbeleuchtung on) \
DOELSE (set Weihnachtsbeleuchtung off)
attr XMasLights.Auto group Zeitschaltuhr
attr XMasLights.Auto room Automation

amenomade

Ja, es würde funktionieren. Aber auf Grund der 3. Bedingung, sind die 2 ersten jetzt unnötig. Es würde dann reichen:([Modus_RL] eq "XMas" and [twilight:light] < 5) (set Weihnachtsbeleuchtung on) \
DOELSE (set Weihnachtsbeleuchtung off)

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