diff --git a/fhem/CHANGED b/fhem/CHANGED index 2f6e87a88..f28211307 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: 30_pilight_temp add attributes offsetTemp and offsetHumidity to correct temperature and humidity - changed: PRESENCE/collectord: new collectord-1.5.deb package released - changed: YAMAHA_BD: added HTTP request queue, send only one request at the same time. This increases command reliability and response behaviour of diff --git a/fhem/FHEM/30_pilight_temp.pm b/fhem/FHEM/30_pilight_temp.pm index 61262ec04..10c33aaee 100644 --- a/fhem/FHEM/30_pilight_temp.pm +++ b/fhem/FHEM/30_pilight_temp.pm @@ -1,5 +1,5 @@ ############################################## -# $Id: 30_pilight_temp.pm 0.16 2015-09-06 Risiko $ +# $Id: 30_pilight_temp.pm 0.17 2015-11-29 Risiko $ # # Usage # @@ -15,6 +15,7 @@ # V 0.14 2015-05-30 - FIX: StateFn # V 0.15 2015-08-30 - NEW: support pressure, windavg, winddir, windgust # V 0.16 2015-09-06 - FIX: pressure, windavg, winddir, windgust from weather stations without temperature +# V 0.17 2015-11-29 - NEW: offsetTemp and offsetHumidity to correct temperature and humidity ############################################## package main; @@ -36,7 +37,7 @@ sub pilight_temp_Initialize($) $hash->{Match} = "^PITEMP"; $hash->{ParseFn} = "pilight_temp_Parse"; $hash->{StateFn} = "pilight_temp_State"; - $hash->{AttrList} = "corrTemp corrHumidity ".$readingFnAttributes; + $hash->{AttrList} = "corrTemp corrHumidity offsetTemp offsetHumidity ".$readingFnAttributes; } ##################################### @@ -104,6 +105,9 @@ sub pilight_temp_Parse($$) my $corrTemp = AttrVal($chash->{NAME}, "corrTemp",1); my $corrHumidity = AttrVal($chash->{NAME}, "corrHumidity",1); + my $tempOffset = AttrVal($chash->{NAME}, "offsetTemp",0); + my $humidityOffset = AttrVal($chash->{NAME}, "offsetHumidity",0); + readingsBeginUpdate($chash); foreach my $arg (@args){ @@ -112,10 +116,10 @@ sub pilight_temp_Parse($$) my($feature,$value) = split(":",$arg); switch($feature) { case m/temperature/ { - $value = $value * $corrTemp; + $value = $value * $corrTemp + $tempOffset; readingsBulkUpdate($chash,"state",$value); } - case m/humidity/ { $value = $value * $corrHumidity;} + case m/humidity/ { $value = $value * $corrHumidity + $humidityOffset;} } readingsBulkUpdate($chash,$feature,$value); } @@ -193,9 +197,19 @@ sub pilight_temp_Parse($$)