From b35c437101132350fe5fd1e6e80b855250a7bf26 Mon Sep 17 00:00:00 2001 From: dietmar63 <> Date: Wed, 30 Sep 2015 18:57:59 +0000 Subject: [PATCH] 98_WeekdayTimer, 98_Heating_Control: a new Version of the functionality of "overtaking timer" and the blocking by a windowSensor(Heating_Control) git-svn-id: https://svn.fhem.de/fhem/trunk@9335 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_WeekdayTimer.pm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/fhem/FHEM/98_WeekdayTimer.pm b/fhem/FHEM/98_WeekdayTimer.pm index b2fbfbf83..11ed97b1d 100644 --- a/fhem/FHEM/98_WeekdayTimer.pm +++ b/fhem/FHEM/98_WeekdayTimer.pm @@ -153,8 +153,9 @@ sub WeekdayTimer_Define($$) { $hash->{TYPE} = $type; $hash->{NAME} = $name; $hash->{DEVICE} = $device; + $hash->{STILLDONETIME} = 0; $hash->{SWITCHINGTIMES} = \@switchingtimes; - $attr{$name}{verbose} = 4 if (!defined $attr{$name}{verbose} && $name =~ m/^tst.*/ ); + $attr{$name}{verbose} = 5 if (!defined $attr{$name}{verbose} && $name =~ m/^tst.*/ ); #$attr{$name}{verbose} = 4; $modules{$hash->{TYPE}}{defptr}{$hash->{NAME}} = $hash; @@ -585,8 +586,15 @@ sub WeekdayTimer_Update($) { # Schaltparameter ermitteln my $tage = $hash->{profil}{$idx}{TAGE}; my $time = $hash->{profil}{$idx}{TIME}; + my $epoch = $hash->{profil}{$idx}{EPOCH}; my $newParam = $hash->{profil}{$idx}{PARA}; - + + if ($hash->{STILLDONETIME} > $epoch ) { + Log3 $hash, 3, "[$name] Timer $time overwritten by " . FmtDateTime($hash->{STILLDONETIME}); + return; + } + $hash->{STILLDONETIME} = $epoch; + # Fenserkontakte abfragen - wenn einer im Status closed, dann Schaltung um 60 Sekunden verzögern if (WeekdayTimer_FensterOffen($hash, $newParam, $idx)) { readingsSingleUpdate ($hash, "state", "open window", 1); @@ -599,12 +607,6 @@ sub WeekdayTimer_Update($) { my ($indx, $aktTime, $aktParameter, $nextTime, $nextParameter) = WeekdayTimer_searchAktNext($hash, time()+5); - #if ($newParam ne $aktParameter ) { - # #Log3 $hash, 3, "[$name]*Update - $newParam overwritten by $aktParameter (" . FmtDateTime($aktTime). ")"; - # Log3 $hash, 3, "[$name] Update - $newParam overwritten by $aktParameter (" . FmtDateTime($aktTime). ")" if($activeTimer); - # $newParam = $aktParameter; - #} - # ggf. Device schalten WeekdayTimer_Device_Schalten($hash, $newParam, $tage) if($activeTimer);