diff --git a/CHANGED b/CHANGED index 32a79880d..e471f5f2f 100644 --- a/CHANGED +++ b/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: 59_WUup: added attribute unit_solarradiation - bugfix: 38_netatmo: removed heating home/room autocreate - feature: 46_SmartPi: exchange commandref, add NotifyFn - new: 00_MQTT2_SERVER / 10_MQTT2_DEVICE diff --git a/FHEM/59_WUup.pm b/FHEM/59_WUup.pm index e3465c35a..aac71d146 100644 --- a/FHEM/59_WUup.pm +++ b/FHEM/59_WUup.pm @@ -32,7 +32,7 @@ use Time::HiRes qw(gettimeofday); use HttpUtils; use UConv; -my $version = "0.9.8"; +my $version = "0.9.9"; # Declare functions sub WUup_Initialize($); @@ -62,6 +62,7 @@ sub WUup_Initialize($) { . "disabledForIntervals " . "interval " . "unit_windspeed:km/h,m/s " + . "unit_solarradiation:W/m²,lux " . "round " . "wubaromin wudailyrainin wudewptf wuhumidity wurainin wusoilmoisture " . "wusoiltempf wusolarradiation wutempf wuUV wuwinddir wuwinddir_avg2m " @@ -96,6 +97,8 @@ sub WUup_Define($$$) { $attr{$name}{room} = "Weather" if ( !defined( $attr{$name}{room} ) ); $attr{$name}{unit_windspeed} = "km/h" if ( !defined( $attr{$name}{unit_windspeed} ) ); + $attr{$name}{unit_solarradiation} = "lux" + if ( !defined( $attr{$name}{unit_solarradiation} ) ); $attr{$name}{round} = 4 if ( !defined( $attr{$name}{round} ) ); RemoveInternalTimer($hash); @@ -230,6 +233,9 @@ sub WUup_send($) { $attr{$name}{unit_windspeed} = "km/h" if ( !defined( $attr{$name}{unit_windspeed} ) ); + $attr{$name}{unit_solarradiation} = "lux" + if ( !defined( $attr{$name}{unit_solarradiation} ) ); + $attr{$name}{round} = 4 if ( !defined( $attr{$name}{round} ) ); my ( $data, $d, $r, $o ); @@ -265,7 +271,14 @@ sub WUup_send($) { $value = UConv::mm2in( $value, $rnd ); } elsif ( $key eq "solarradiation" ) { - $value = ( $value / 126.7 ); + + if ( $attr{$name}{unit_solarradiation} eq "lux" ) { + Log3 $name, 5, "WUup ($name) - solarradiation unit is lux"; + $value = ( $value / 126.7 ); + } + else { + Log3 $name, 5, "WUup ($name) - solarradiation unit is W/m²"; + } } $data .= "&$key=$value"; } @@ -355,6 +368,7 @@ sub WUup_receive($) { # 2018-03-19 solarradiation calculated from lux to W/m² (thanks to dieter114) # 2018-04-10 added attribute round # 2018-04-13 added AqPM2.5 and AqPM10 +# 2018-08-15 added attribute unit_solarradiation # ################################################################################ @@ -408,6 +422,7 @@ sub WUup_receive($) {
  • disable - disables the module
  • disabledForIntervals
  • unit_windspeed - change the units of your windspeed readings (m/s or km/h)
  • +
  • unit_solarradiation - change the units of your solarradiation readings (lux or W/m²)
  • round - round values to this number of decimals for calculation (default 4)
  • wu.... - Attribute name corresponding to parameter name from api. @@ -419,8 +434,7 @@ sub WUup_receive($) { network as parameter "tempf" (which indicates current temperature)
    Units get converted to angloamerican system automatically - (°C -> °F; km/h(m/s) -> mph; mm -> in; hPa -> inHg)
    - Solarradiation takes readings in lux and converts them to W/m²

    + (°C -> °F; km/h(m/s) -> mph; mm -> in; hPa -> inHg)

    The following information is supported: