2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-05 18:16:44 +00:00

50_HP1000.pm: add uvCondition

git-svn-id: https://svn.fhem.de/fhem/trunk@12353 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2016-10-16 19:01:42 +00:00
parent 4b19e2434d
commit 8bf0ddf176

View File

@ -600,6 +600,26 @@ sub HP1000_CGI() {
readingsBulkUpdate( $hash, "uvIndex", $webArgs->{UVI} );
}
# uvCondition
if ( defined( $webArgs->{UVI} ) ) {
my $condition = "low";
if ($webArgs->{UVI} > 11) {
$condition = "extreme";
}
elsif ($webArgs->{UVI} > 8) {
$condition = "veryhigh";
}
elsif ($webArgs->{UVI} > 6) {
$condition = "high";
}
elsif ($webArgs->{UVI} > 3) {
$condition = "moderate";
}
readingsBulkUpdateIfChanged( $hash, "uvCondition", $condition );
}
# solarradiation in W/m2 (convert from lux)
if ( defined( $webArgs->{light} ) ) {
$webArgs->{solarradiation} = HP1000_lux2wpsm( $webArgs->{light} );