From 7628fcaa185ff18fc7f4245b92403056f6218257 Mon Sep 17 00:00:00 2001
From: mahowi <>
Date: Mon, 19 Mar 2018 19:26:54 +0000
Subject: [PATCH] =?UTF-8?q?59=5FWUup:=20V0.9.6,=20calculate=20solarradiati?=
=?UTF-8?q?on=20from=20lux=20to=20W/m=C2=B2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
git-svn-id: https://svn.fhem.de/fhem/trunk@16447 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/CHANGED | 1 +
fhem/FHEM/59_WUup.pm | 12 +++++++++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/fhem/CHANGED b/fhem/CHANGED
index df5f7fe03..7c8ed8150 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: 59_WUup: V0.9.6, calculate solarradiation from lux to W/m²
- feature: 73_AMADCommBridge: fix Commandref, add allowfrom support
- bugfix: 74_XiaomiBTLESens: Backslash found where operator expected
- bugfix: 98_TRAFFIC: v1.3.7, fixed special characters and updateschedule
diff --git a/fhem/FHEM/59_WUup.pm b/fhem/FHEM/59_WUup.pm
index d59e01722..7429c50dd 100644
--- a/fhem/FHEM/59_WUup.pm
+++ b/fhem/FHEM/59_WUup.pm
@@ -32,7 +32,7 @@ use Time::HiRes qw(gettimeofday);
use HttpUtils;
use UConv;
-my $version = "0.9.5";
+my $version = "0.9.6";
# Declare functions
sub WUup_Initialize($);
@@ -258,6 +258,9 @@ sub WUup_send($) {
elsif ( $key =~ /.*rainin$/ ) {
$value = UConv::mm2in( $value, 4 );
}
+ elsif ( $key eq "solarradiation" ) {
+ $value = ( $value / 126.7 );
+ }
$data .= "&$key=$value";
}
@@ -343,6 +346,7 @@ sub WUup_receive($) {
# timeout raised to 6s, fixed state error (thanks to mumpitzstuff)
# 2017-10-16 fixed attributes
# 2017-10-19 added set-command "update"
+# 2018-03-19 solarradiation calculated from lux to W/m² (thanks to dieter114)
#
################################################################################
@@ -406,7 +410,8 @@ 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)
+ (°C -> °F; km/h(m/s) -> mph; mm -> in; hPa -> inHg)
+ Solarradiation takes readings in lux and converts them to W/m²
The following information is supported: