diff --git a/PV_Visu/module.html b/PV_Visu/module.html
index 7dddb06..2b86a3b 100644
--- a/PV_Visu/module.html
+++ b/PV_Visu/module.html
@@ -49,7 +49,7 @@
document.getElementById('barGridText').innerText = data.consGrid + '%';
// Set detailed values below
document.getElementById('prodValues').innerText =
- 'Eigenverbrauch: ' + data.prodCons/100*data.value.prod + ' kWh, ' +
+ 'Eigenverbrauch: ' + data.consPV/100*data.value.cons + ' kWh, ' +
'Einspeisung: ' + data.value.feed + ' kWh';
document.getElementById('consValues').innerText =
'PV-Anteil: ' + data.consPV/100*data.value.cons + ' kWh, ' +
diff --git a/PV_Visu/module.php b/PV_Visu/module.php
index 2761cb9..a8c4b3c 100644
--- a/PV_Visu/module.php
+++ b/PV_Visu/module.php
@@ -77,9 +77,9 @@ class PV_Visu extends IPSModule
$grid = $this->GetDailyTotal($this->ReadPropertyInteger('VarGrid'), $start, $end);
$prodCons = $prod > 0 ? (($cons-$grid) / $prod) * 100 : 0;
- $prodFeed = $prod > 0 ? ($feed / $prod) * 100 : 0;
+ $prodFeed = $prod > 0 ? 100 - $prodCons : 0;
$consPV = $cons > 0 ? min($prod, ($cons-$grid)) / $cons * 100 : 0;
- $consGrid = $cons > 0 ? ($grid / $cons) * 100 : 0;
+ $consGrid = $cons > 0 ? 100 - $consPV : 0;
$data = [
'prodCons' => round($prodCons, 1),
@@ -95,7 +95,6 @@ class PV_Visu extends IPSModule
];
$json = json_encode($data);
- IPS_LogMessage("TEST", print_r($data));
$this->UpdateVisualizationValue($json);
}