2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

76_SolarForecast.pm: contrib 0.55.1

git-svn-id: https://svn.fhem.de/fhem/trunk@24928 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2021-09-06 18:32:18 +00:00
parent 0593f51787
commit a2b737f0dd

View File

@ -5123,6 +5123,8 @@ END0
my $consumer_start = 0;
my $consumer_distance = 100;
my $currentPower;
if ($consumercount % 2) {
$consumer_start = 250 - ($consumer_distance * (($consumercount -1) / 2));
}
@ -5137,7 +5139,13 @@ END0
my $color;
my $calias = ConsumerVal ($hash, $c0, "alias", ""); # Name des Consumerdevices
my $cicon = ConsumerVal ($hash, $c0, "icon", ""); # Icon des Consumerdevices
$cicon = "file_unknown" if (!$cicon);
$currentPower = ReadingsNum ($name, "consumer${c0}_currentPower", 0);
if (!$cicon) {
$color = $currentPower ? '@darkorange' : '@grey';
$cicon = 'light_light_dim_100'.$color;
}
($cicon,$color) = split '@', $cicon;
$color = $color ? '@'.$color : '';
@ -5191,7 +5199,7 @@ END3
for my $c1 (@consumers) {
my $power = ConsumerVal ($hash, $c1, "power", 0);
my $currentPower = ReadingsNum ($name, "consumer${c1}_currentPower", 0);
$currentPower = ReadingsNum ($name, "consumer${c1}_currentPower", 0);
my $p = $currentPower;
$p = (($currentPower / $power) * 100) if ($power > 0);