diff --git a/fhem/FHEM/98_Heating_Control.pm b/fhem/FHEM/98_Heating_Control.pm index bd83318a9..5229df715 100644 --- a/fhem/FHEM/98_Heating_Control.pm +++ b/fhem/FHEM/98_Heating_Control.pm @@ -41,6 +41,7 @@ Heating_Control_Initialize($) $hash->{DefFn} = "Heating_Control_Define"; $hash->{UndefFn} = "Heating_Control_Undef"; $hash->{GetFn} = "Heating_Control_Get"; + $hash->{UpdFn} = "Heating_Control_Update"; $hash->{AttrList}= "disable:0,1 loglevel:0,1,2,3,4,5 ". $readingFnAttributes; } @@ -71,7 +72,6 @@ Heating_Control_Define($$) { my ($hash, $def) = @_; - RemoveInternalTimer($hash); my @a = split("[ \t]+", $def); return "Usage: define Heating_Control " @@ -224,6 +224,7 @@ Heating_Control_Define($$) } } + RemoveInternalTimer($hash); my $now = time(); InternalTimer ($now+30, "Heating_Control_Update", $hash, 0); @@ -283,8 +284,8 @@ Heating_Control_Update($) $newDesTemperature = $hash->{helper}{SWITCHINGTIME}{$days[$d]}{$st}; $nowSwitch = $now; } else { - $nextSwitch = $next; $nextDesTemperature = $hash->{helper}{SWITCHINGTIME}{$days[$d]}{$st}; + $nextSwitch = $next; last; } } @@ -320,6 +321,7 @@ Heating_Control_Update($) Log GetLogLevel($name,3), $ret if($ret); } + RemoveInternalTimer($hash); InternalTimer($nextSwitch, "Heating_Control_Update", $hash, 0); readingsBeginUpdate($hash); @@ -330,6 +332,18 @@ Heating_Control_Update($) return 1; } +# +sub Heating_Control_SetAllTemps() { # {Heating_Control_SetAllTemps()} + + foreach my $hc ( sort keys %{$modules{Heating_Control}{defptr}} ) { + my $hash = $modules{Heating_Control}{defptr}{$hc}; + + if($hash->{helper}{CONDITION}) { + next if (!(eval ($hash->{helper}{CONDITION}))) ; + } + Heating_Control_Update($hash); + } +} sub SortNumber { if($a < $b)