diff --git a/fhem/FHEM/98_Heating_Control.pm b/fhem/FHEM/98_Heating_Control.pm index dde4f3874..90aa21c64 100644 --- a/fhem/FHEM/98_Heating_Control.pm +++ b/fhem/FHEM/98_Heating_Control.pm @@ -132,18 +132,18 @@ Heating_Control_Define($$) $dayNumber{$day} = $idx; $idx++; } - my (@st, @days, $daylist, $time, $temp, $englisch); + my (@st, @days, $daylist, $time, $para, $englisch); for(my $i=0; $i<@switchingtimes; $i++) { @st = split(/\|/, $switchingtimes[$i]); if ( @st == 2) { $daylist = "1234567"; #jeden Tag/woche ist vordefiniert $time = $st[0]; - $temp = $st[1]; + $para = $st[1]; } elsif ( @st == 3) { $daylist = lc($st[0]); $time = $st[1]; - $temp = $st[2]; + $para = $st[2]; } my %hdays=(); @@ -188,12 +188,12 @@ Heating_Control_Define($$) return "invalid time in $name <$time> HH:MM" if(!($time =~ m/^[0-2][0-9]:[0-5][0-9]$/g)); - return "invalid temperature in $name <$temp> 99.9" - if(!($temp =~ m/^\d{1,2}(\.\d){0,1}$/g)); + #return "invalid temperature in $name <$para> 99.9" + # if(!($para =~ m/^\d{1,2}(\.\d){0,1}$/g)); for (my $d=0; $d<@days; $d++) { - #Log 3, "Switchingtime: $switchingtimes[$i] : $days[$d] -> $time -> $temp "; - $hash->{helper}{SWITCHINGTIME}{$days[$d]}{$time} = $temp; + #Log 3, "Switchingtime: $switchingtimes[$i] : $days[$d] -> $time -> $para "; + $hash->{helper}{SWITCHINGTIME}{$days[$d]}{$time} = $para; } } @@ -217,8 +217,8 @@ Heating_Control_Define($$) # Profile sortiert aufbauen for (my $d=1; $d<=7; $d++) { foreach my $st (sort (keys %{ $hash->{helper}{SWITCHINGTIME}{$d} })) { - my $temp = $hash->{helper}{SWITCHINGTIME}{$d}{$st}; - $hash->{"PROFILE ".($d).": ".$$rWochentage[$d-1]} .= sprintf("%s: %.1f%s, ", $st, $temp, $unit); + my $para = $hash->{helper}{SWITCHINGTIME}{$d}{$st}; + $hash->{"PROFILE ".($d).": ".$$rWochentage[$d-1]} .= sprintf("%s %s, ", $st, $para); } } @@ -307,8 +307,8 @@ Heating_Control_Update($) Log $loglevel, "NowSwitch: ".strftime('%d.%m.%Y %H:%M:%S',localtime($nowSwitch))." ; AktDesiredTemp: $AktDesiredTemp ; newDesTemperature: $newDesTemperature"; Log $loglevel, "NextSwitch=".strftime('%d.%m.%Y %H:%M:%S',localtime($nextSwitch)); - - if ($nowSwitch gt "" && $AktDesiredTemp != $newDesTemperature) { + + if ($nowSwitch gt "" && $AktDesiredTemp ne $newDesTemperature) { if (defined $hash->{helper}{CONDITION}) { $command = '{ fhem("set @ '.$hash->{helper}{DESIRED_TEMP_READING}.' %") if' . $hash->{helper}{CONDITION} . '}'; } elsif (defined $hash->{helper}{COMMAND}) { @@ -317,7 +317,7 @@ Heating_Control_Update($) $command = '{ fhem("set @ '.$hash->{helper}{DESIRED_TEMP_READING}.' %") }'; } } - + if ($command && AttrVal($hash->{NAME}, "disable", 0) == 0) { $command =~ s/@/$hash->{DEVICE}/g; $command =~ s/%/$newDesTemperature/g; @@ -330,8 +330,8 @@ Heating_Control_Update($) InternalTimer($nextSwitch, "Heating_Control_Update", $hash, 0); readingsBeginUpdate($hash); readingsBulkUpdate ($hash, "nextUpdate", strftime("%d.%m.%Y %H:%M:%S",localtime($nextSwitch))); - readingsBulkUpdate ($hash, "nextValue", $nextDesTemperature . $unit); - readingsBulkUpdate ($hash, "state", $newDesTemperature . $unit); + readingsBulkUpdate ($hash, "nextValue", $nextDesTemperature); + readingsBulkUpdate ($hash, "state", $newDesTemperature); readingsEndUpdate ($hash, defined($hash->{LOCAL} ? 0 : 1)); return 1; @@ -362,28 +362,34 @@ sub SortNumber { define <name> Heating_Control <device> <profile> <command>|<condition>

- to set a weekly profile for <device>, eg. a heating sink. You can define different switchingtimes for every day. - The new temperature is sent to the <device> automaticly with set <device> desired-temp <temp> - if the device is a heating thermostat (FHT8b, MAX). Have you defined a <condition> - and this condition is false if the switchingtime has reached, no command will executed.
+ to set a weekly profile for <device>, eg. a heating sink.
+ You can define different switchingtimes for every day.
+ + The new temperature is sent to the <device> automatically with

+ + set <device> (desired-temp|desiredTemerature) <temp>

+ + Because of the fhem-type of structures, a structures of heating sinks is sent "desired-temp": + Use an explicit command if you have structures of MAX heating thermostats.
+ If you have defined a <condition> and this condition is false if the switchingtime has reached, no command will executed.
A other case is to define an own perl command with <command>.

The following parameter are defined: -

-