<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:70.85pt 70.85pt 56.7pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=DE>Guten Tag zusammen,<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>Ich bin auf einen für mich nicht nachvollziehbaren Effekt bzgl. des Gesamtverbrauchs meines per S0 angebundenen Gaszählers gestoßen.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>Ich habe alte Daten vor dem 1.12.19 aus der Datenbank (volkszaehler.data) gelöscht, da die Werte vor diesem Zeitpunkt nicht zuverlässig und komplett waren. Die Aggregate-Tabelle habe ich für diesen Kanal neu aufgebaut.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>Damit musste ich natürlich einen anderen Wert für die initialconsumption eintragen. Ich habe mich da etwas gespielt, bis ich den exakten Wert hatte und…<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>SET</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>@<b>CHANNEL</b></span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>=</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:purple'>10</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:blue'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>SELECT</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:olive'>channel_id</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>AS</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:olive'>Kanal</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>,(<b>SELECT</b></span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>VALUE</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>FROM</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:olive'>`volkszaehler`</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>.</span><span style='font-size:10.0pt;font-family:"Courier New";color:olive'>`properties`<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>WHERE</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:olive'>`entity_id`</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>=</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>@<b>CHANNEL</b></span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>AND</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:olive'>`pkey`</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>=</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:green'>'title'</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>)</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>AS</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>Name</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:navy'>ROUND</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>(</span><b><span style='font-size:10.0pt;font-family:"Courier New";color:navy'>sum</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>(<b>VALUE</b>/</span><span style='font-size:10.0pt;font-family:"Courier New";color:purple'>100</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>)+(<b>SELECT</b></span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>VALUE</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>FROM</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:olive'>`volkszaehler`</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>.</span><span style='font-size:10.0pt;font-family:"Courier New";color:olive'>`properties`<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>WHERE</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:olive'>`entity_id`</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>=</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>@<b>CHANNEL</b></span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>AND</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:olive'>`pkey`</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>=</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:green'>'initialconsumption'</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>),</span><span style='font-size:10.0pt;font-family:"Courier New";color:purple'>2</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>)</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>AS</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:olive'>Zählerstand<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>FROM</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:olive'>`volkszaehler`</span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>.</span><span style='font-size:10.0pt;font-family:"Courier New";color:olive'>`data`<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>WHERE</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:olive'>`channel_id`</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>=</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>@<b>CHANNEL</b></span><span style='font-size:10.0pt;font-family:"Courier New";color:black'> <o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=DE>…bis diese Abfrage gepasst hat. Wenn ich anstelle der Data-Tabelle die minütlichen oder stündlichen Zahlen aus der Aggregate-Tabelle nehme, bekomme ich dasselbe Ergebnis der aktuelle Zählerstand ist 7028.75 (m³) – was exakt korrekt ist.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>Das Frontend zeigt aber unbeirrbar 7023 m³. Habe ich hier irgendetwas nicht bedacht? Reboot des Raspi, Neustart des Browsers etc haben mich nicht weitergebracht.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>Danke für jeden Input – die Code der Middleware übersteigt leider meine Fähigkeiten… ich weiss leider nicht wie der Gesamtverbrauch errechnet wird und wo die Diskrepanz her kommt.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>Alex aus Bremerhaven<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p></div></body></html>