2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 16:59:18 +00:00

76_SMAPortal: contrib 1.1.0

git-svn-id: https://svn.fhem.de/fhem/trunk@18834 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2019-03-09 11:11:53 +00:00
parent bad5fe23e8
commit 8c9e153686

View File

@ -522,17 +522,11 @@ sub SMAPortal_ParseData($) {
my $dl = AttrVal($name, "detailLevel", 1);
SMAPortal_delread($hash, $dl+1);
readingsBeginUpdate($hash);
readingsBulkUpdate($hash, "L1_FeedIn", 0);
readingsBulkUpdate($hash, "L1_GridConsumption", 0);
readingsBulkUpdate($hash, "L1_PV", 0);
readingsEndUpdate($hash, 0);
readingsBeginUpdate($hash);
my ($FeedIn_done,$GridConsumption_done,$PV_done) = (0,0,0);
for my $k (keys %$livedata_content) {
my $new_val = "";
if (defined $livedata_content->{$k}) {
Log3 $name, 4, "$name - livedata content \"$k\": ".($livedata_content->{$k});
if (($livedata_content->{$k} =~ m/ARRAY/i) || ($livedata_content->{$k} =~ m/HASH/i)) {
@ -554,10 +548,17 @@ sub SMAPortal_ParseData($) {
if ($new_val && $k !~ /__type/i) {
Log3 $name, 4, "$name -> $k - $new_val";
readingsBulkUpdate($hash, "L1_$k", $new_val);
$FeedIn_done = 1 if($k =~ /^FeedIn$/);
$GridConsumption_done = 1 if($k =~ /^GridConsumption$/);
$PV_done = 1 if($k =~ /^PV$/);
}
}
}
readingsBulkUpdate($hash, "L1_FeedIn", 0) if(!$FeedIn_done);
readingsBulkUpdate($hash, "L1_GridConsumption", 0) if(!$GridConsumption_done);
readingsBulkUpdate($hash, "L1_PV", 0) if(!$PV_done);
readingsEndUpdate($hash, 1);
if ($forecast_content && $forecast_content !~ m/undefined/i) {