mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-06 00:26:35 +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:
parent
4b19e2434d
commit
8bf0ddf176
@ -600,6 +600,26 @@ sub HP1000_CGI() {
|
|||||||
readingsBulkUpdate( $hash, "uvIndex", $webArgs->{UVI} );
|
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)
|
# solarradiation in W/m2 (convert from lux)
|
||||||
if ( defined( $webArgs->{light} ) ) {
|
if ( defined( $webArgs->{light} ) ) {
|
||||||
$webArgs->{solarradiation} = HP1000_lux2wpsm( $webArgs->{light} );
|
$webArgs->{solarradiation} = HP1000_lux2wpsm( $webArgs->{light} );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user