59_HCS: Use default thresholds for eco mode, when thresholds are found undefined. Put these defaults into the modules documentation.

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@15873 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
hjr 2018-01-13 17:12:09 +00:00
parent 3ddfdc0ba2
commit c513fc7747

View File

@ -293,7 +293,7 @@ HCS_Set($@) {
my $ecoModeOld = ReadingsVal($name,"eco","off"); my $ecoModeOld = ReadingsVal($name,"eco","off");
if($ecoModeNew ne $ecoModeOld) { if($ecoModeNew ne $ecoModeOld) {
readingsSingleUpdate($hash, "eco",$ecoModeNew,1); readingsSingleUpdate($hash, "eco",$ecoModeNew,1);
$str = "eco mode changed from $ecoModeOld to $ecoModeNew"; $str = "switch eco mode $ecoModeNew";
Log3 $name, 1, "$type $name $str"; Log3 $name, 1, "$type $name $str";
return $str; return $str;
} else { } else {
@ -672,12 +672,17 @@ HCS_getValues($$) {
my $ecoTempOff = AttrVal($name,"ecoTemperatureOff",undef); my $ecoTempOff = AttrVal($name,"ecoTemperatureOff",undef);
my $ecoState = ReadingsVal($name,"eco","off"); my $ecoState = ReadingsVal($name,"eco","off");
if($ecoState eq "on" && (!$ecoTempOn || !$ecoTempOff)) { if ( $ecoState eq "on" ) {
Log3 $name, 1, "$type $name missing attribute 'ecoTemperatureOn'. Please define this attribute first." if ( !$ecoTempOn ) {
if(!$ecoTempOn); $attr{$name}{deviceCmdOn} = $defaults{deviceCmdOn};
Log3 $name, 1, "$type $name missing attribute 'ecoTemperatureOff'. Please define this attribute first." $ecoTempOn = $defaults{deviceCmdOn};
if(!$ecoTempOff); Log3 $name, 1, "$type $name set attribute 'ecoTemperatureOn' to default $defaults{deviceCmdOn}."
} elsif($ecoState eq "on") { }
if ( !$ecoTempOff ) {
$attr{$name}{deviceCmdOff} = $defaults{deviceCmdOff};
$ecoTempOff = $defaults{deviceCmdOff};
Log3 $name, 1, "$type $name set attribute 'ecoTemperatureOff' to default $defaults{deviceCmdOff}."
}
foreach my $d (sort keys %{$hash->{helper}{device}}) { foreach my $d (sort keys %{$hash->{helper}{device}}) {
my $ignore = $hash->{helper}{device}{$d}{ignored}; my $ignore = $hash->{helper}{device}{$d}{ignored};
my $exclude = $hash->{helper}{device}{$d}{excluded}; my $exclude = $hash->{helper}{device}{$d}{excluded};
@ -800,15 +805,15 @@ HCS_getValues($$) {
Example: Example:
<ul> <ul>
Threshold temperature economic mode on: 15&deg; Celsius<br> Threshold temperature economic mode on: 16&deg; Celsius<br>
Threshold temperature economic mode off: 25&deg; Celsius<br> Threshold temperature economic mode off: 17&deg; Celsius<br>
<br> <br>
HCS activates the defined device until the measured temperature of one ore more HCS activates the defined device until the measured temperature of one ore more
thermostats is lower or equal than 15&deg; Celsius. If a measured temperature of one thermostats is lower or equal than 16&deg; Celsius. If a measured temperature of one
or more thermostats is higher or equal than 25&deg; Celsius, HCS switch of the defined or more thermostats is higher or equal than 17&deg; Celsius, HCS switch of the defined
device (if none of the measured temperatures of all thermostats is lower or equal as device (if none of the measured temperatures of all thermostats is lower or equal as
15&deg; Celsius). 16&deg; Celsius).
</ul> </ul>
<br> <br>