diff --git a/fhem/FHEM/90_at.pm b/fhem/FHEM/90_at.pm index eb09e1ec9..0001b5f56 100755 --- a/fhem/FHEM/90_at.pm +++ b/fhem/FHEM/90_at.pm @@ -550,10 +550,12 @@ EOF
  • disabledForIntervals HH:MM-HH:MM HH:MM-HH-MM...
    - Space separated list of HH:MM tupels. If the current time is between - the two time specifications, the current device is disabled. Instead of - HH:MM you can also specify HH or HH:MM:SS. To specify an interval - spawning midnight, you have to specify two intervals, e.g.: + Space separated list of HH:MM or D@HH:MM tupels. If the current time is + between the two time specifications, the current device is disabled. + Instead of HH:MM you can also specify HH or HH:MM:SS. D is the day of + the week, with 0 indicating Sunday and 3 indicating Wednesday. To + specify an interval spawning midnight, you have to specify two + intervals, e.g.: @@ -735,11 +737,12 @@ EOF
  • disabledForIntervals HH:MM-HH:MM HH:MM-HH-MM...
    Das Argument ist eine Leerzeichengetrennte Liste von Minuszeichen- - getrennten HH:MM Paaren. Falls die aktuelle Uhrzeit zwischen diesen - Werten fällt, dann wird die Ausführung, wie beim disable, - ausgesetzt. Statt HH:MM kann man auch HH oder HH:MM:SS angeben. - Um einen Intervall um Mitternacht zu spezifizieren, muss man zwei - einzelne angeben, z.Bsp.: + getrennten HH:MM oder D@HH:MM Paaren. Falls die aktuelle Uhrzeit + zwischen diesen Werten fällt, dann wird die Ausführung, wie + beim disable, ausgesetzt. Statt HH:MM kann man auch HH oder HH:MM:SS + angeben. D ist der Tag der Woche, mit 0 als Sonntag and 3 als + Mittwoch. Um einen Intervall um Mitternacht zu spezifizieren, muss man + zwei einzelne angeben, z.Bsp.: diff --git a/fhem/fhem.pl b/fhem/fhem.pl index f2c9cbe5f..a86a4fc78 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -777,10 +777,14 @@ IsDisabled($) my $dfi = $attr{$devname}{disabledForIntervals}; if(defined($dfi)) { my ($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isdst) = localtime; - my $hms = sprintf("%02d:%02d:%02d", $hour, $min, $sec); + my $dhms = sprintf("%s\@%02d:%02d:%02d", $wday, $hour, $min, $sec); foreach my $ft (split(" ", $dfi)) { my ($from, $to) = split("-", $ft); - return 2 if($from && $to && $from le $hms && $hms le $to); + if($from && $to) { + $from = "$wday\@$from" if(index($from,"@") < 0); + $to = "$wday\@$to" if(index($to, "@") < 0); + return 2 if($from le $dhms && $dhms le $to); + } } }