<div dir="auto">Sorry, stimmt natürlich nicht. Trotzdem würde ich das die Middleware erledigen lassen, die nutzt dafür aggregierte Daten und kann das deutlich schneller.<div dir="auto"><br></div><div dir="auto">Grüße</div><div dir="auto">Frank</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Frank Richter <<a href="mailto:frank.richter83@gmail.com">frank.richter83@gmail.com</a>> schrieb am So., 29. März 2020, 18:11:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Die SQL-Abfrage hilft nur bei einem Zählerstand-Kanal. Bei Impulsen müssen sämtliche Impulse aufsummiert werden, um den Gesamtverbrauch zu erhalten.<div dir="auto"><br></div><div dir="auto">Grüße</div><div dir="auto">Frank</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Tobias Lehr <<a href="mailto:tobias.lehr@me.com" target="_blank" rel="noreferrer">tobias.lehr@me.com</a>> schrieb am So., 29. März 2020, 18:06:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hm also dann habe ich da falsch herum gedacht. Das hieße ich müsste die precision auf 8 stellen und bei maxPrecision für alle anderen werte dann die entsprechende Zahl vorgeben? Etwas kompliziert. mal testen.<div><br></div><div>Die Datenbankabfrage habe ich jetzt auch hinbekommen, es lag an zwei doppelten Leerzeichen. Hab mir die korrekte Syntax jetzt mal abgespeichert, nur für den Fall.</div><div><br></div><div>Gruß Tobias<br><div><blockquote type="cite"><div>Am 29.03.2020 um 17:43 schrieb <a href="mailto:rgb@nord-com.net" rel="noreferrer noreferrer" target="_blank">rgb@nord-com.net</a>:</div><br><div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="DE" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Hmm, bei mir funkioniert es…<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="DE" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">pi@avz:~:(1)> mysql -uvz -pyourpassword<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Welcome to the MariaDB monitor. Commands end with ; or \g.<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Your MariaDB connection id is 76<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Server version: 10.3.13-MariaDB-1 Raspbian testing-staging<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">MariaDB [(none)]> SELECT id FROM `volkszaehler`.`entities`<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> -> WHERE UUID = 'b12dfd80-111c-11ea-8e1a-c9616b442377' INTO @CHANNEL;<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Query OK, 1 row affected (0.002 sec)<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">MariaDB [(none)]> SELECT channel_id AS Kanal,(SELECT VALUE FROM `volkszaehler`.`properties`<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> -> WHERE `entity_id` = @CHANNEL AND `pkey` = 'title') AS Name,<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> -> ROUND(sum(VALUE/100)+(SELECT VALUE FROM `volkszaehler`.`properties`<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> -> WHERE `entity_id` = @CHANNEL AND `pkey` = 'initialconsumption'),2) AS Zählerstand<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> -> FROM `volkszaehler`.`data`<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> -> WHERE `channel_id` = @CHANNEL ;<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="DE" style="font-size:11pt;font-family:'Courier New';color:rgb(31,73,125)">+-------+-------------+--------------+<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="DE" style="font-size:11pt;font-family:'Courier New';color:rgb(31,73,125)">| Kanal | Name | Zählerstand |<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="DE" style="font-size:11pt;font-family:'Courier New';color:rgb(31,73,125)">+-------+-------------+--------------+<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="DE" style="font-size:11pt;font-family:'Courier New';color:rgb(31,73,125)">| 10 | Zähler Gas | 7346.64 |<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="DE" style="font-size:11pt;font-family:'Courier New';color:rgb(31,73,125)">+-------+-------------+--------------+<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="DE" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">1 row in set (1.501 sec)<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="DE" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="DE" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">MariaDB [(none)]><u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="DE" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div><div style="border-style:none none none solid;border-left-color:blue;border-left-width:1.5pt;padding:0in 0in 0in 4pt"><div><div style="border-style:solid none none;border-top-color:rgb(181,196,223);border-top-width:1pt;padding:3pt 0in 0in"><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><b><span style="font-size:10pt;font-family:Tahoma,sans-serif">From:</span></b><span style="font-size:10pt;font-family:Tahoma,sans-serif"><span> </span>volkszaehler-users [<a href="mailto:volkszaehler-users-bounces@demo.volkszaehler.org" rel="noreferrer noreferrer" target="_blank">mailto:volkszaehler-users-bounces@demo.volkszaehler.org</a>]<span> </span><b>On Behalf Of<span> </span></b>Tobias Lehr<br><b>Sent:</b><span> </span>Sunday, March 29, 2020 5:34 PM<br><b>To:</b><span> </span><a href="http://volkszaehler.org" rel="noreferrer noreferrer" target="_blank">volkszaehler.org</a> - users<br><b>Subject:</b><span> </span>Re: [vz-users] Gesamtverbrauch Gaszähler mit Nachkommastellen<u></u><u></u></span></div></div></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u> <u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">Vielen Dank für die Anregungen, ABER…<u></u><u></u></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u> <u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">precision in der options.js habe ich gefunden, aber noch nicht so genau verstanden. Standardmäßig ist precision ja auf 2 eingestellt. Ich habe jetzt aber verschiedene Nachkommastellen. Temperaturen sind alle mit 1 NAchkommastelle, es sei denn diese wäre 0, dann haben sie keine nachkommastellen.<u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u> <u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">Alle Werte mit 3 Stellen, haben gar keine Nachkommastellen. Werte kleiner 1 haben 1, 2 oder 3 Nachkommastellen. <u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u> <u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">Die Werte unter Gesamt sind immer ohne, die haben aber auch 5 oder 6 Stellen.<u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u> <u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">ich habe jetzt precision auf 8 hochgenommen, weil mein Gaszähler 5 Stellen vor dem Komma hat. Das funktioniert, dann hat der Gaszähler gesamt 3 Nachkommastellen, allerdings sehr unschön daran, Werte mit nur einer Stelle vor dem Komma haben dann plötzlich 7 NAchkommastellen.<u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u> <u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">Also habe ich versucht eine Ausnahme einzufügen wie bei der für °C, das funktioniert aber nicht, ich vermute es liegt an der hochgestellten 3 in m3.<u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u> <u></u></div></div><div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:8.5pt;font-family:Menlo,serif">maxPrecision:[<u></u><u></u></span></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:8.5pt;font-family:Menlo,serif"> { <span> </span><b><span style="color:rgb(83,48,225)">// override precision for certain units</span></b><u></u><u></u></span></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:8.5pt;font-family:Menlo,serif"> <span> </span><b><span style="color:rgb(175,173,36)">'°C'</span></b>: 1<u></u><u></u></span></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:8.5pt;font-family:Menlo,serif"> },{<u></u><u></u></span></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:8.5pt;font-family:Menlo,serif"> <span> </span><b><span style="color:rgb(175,173,36)">'m³'</span></b>: 8<u></u><u></u></span></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:8.5pt;font-family:Menlo,serif"> }<u></u><u></u></span></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:8.5pt;font-family:Menlo,serif"> ],<u></u><u></u></span></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><br><br><u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">so habe ich versucht es zu erweitern. die hochgestellt 3 habe ich mir einfach reinkopiert. Aber auch die Angabe m3 oder m^3 funktionieren nicht.<u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><br><br><u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><br><br><u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">Zu der SQL Abfrage, ich würde zwar gerne den Wert fest im Frontend angezeigt bekommen aber so eine Abfrage kann ja hilfreich oder zumindest lehrreich sein. Ich muss dazu sagen ich bin absoluter Laie was SQL angeht.<u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><br><br><u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">Wo muss ich die absetzen? In mysql direkt? phpmyAdmin habe ich nicht installiert. Habe ich probiert, aber bekomme einen Fehler wenn ich folgendes eingebe, also per copy&paste.<u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><br><br><u></u><u></u></div></div><div><blockquote style="margin-top:5pt;margin-bottom:5pt" type="cite"><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">SELECT id FROM `volkszaehler`.`entities` <br> WHERE UUID = 'b12dfd80-111c-11ea-8e1a-c9616b442377' INTO @CHANNEL;<u></u><u></u></div></blockquote><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><br><br><u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">Der Fehler lautet: <span style="font-size:8.5pt;font-family:Menlo,serif">ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UUID = '01e03ee0-3241-11e9-991f-856a034c5015' INTO @CHANNEL' at line 2</span><u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u> <u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:8.5pt;font-family:Menlo,serif">ich habe selbstverständlich die UUID auf die meines Gaszählers geändert.</span><u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u> <u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:8.5pt;font-family:Menlo,serif">Gruß Tobias</span><u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><br><br><u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><br><br><u></u><u></u></div></div><div><blockquote style="margin-top:5pt;margin-bottom:5pt" type="cite"><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">Am 29.03.2020 um 16:23 schrieb<span> </span><a href="mailto:rgb@nord-com.net" style="color:purple;text-decoration:underline" rel="noreferrer noreferrer" target="_blank">rgb@nord-com.net</a>:<u></u><u></u></div></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u> <u></u></div><div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">Hallo,<br><br>Folgende SQL-Abfrage könnte als Vorlage für die Berechnung des genauen Verbrauches dienen... müsstest Du für Deine Gegebenheiten entsprechend anpassen...<br><br>SELECT id FROM `volkszaehler`.`entities`<span> </span><br> WHERE UUID = 'b12dfd80-111c-11ea-8e1a-c9616b442377' INTO @CHANNEL;<br><br>SELECT channel_id AS Kanal,(SELECT VALUE FROM `volkszaehler`.`properties`<span> </span><br> WHERE `entity_id` = @CHANNEL AND `pkey` = 'title') AS Name,<br><span> <span> </span></span>ROUND(sum(VALUE/100)+(SELECT VALUE FROM `volkszaehler`.`properties`<span> </span><br> WHERE `entity_id` = @CHANNEL AND `pkey` = 'initialconsumption'),2) AS Zählerstand<br>FROM `volkszaehler`.`data`<span> </span><br>WHERE `channel_id` = @CHANNEL ;<br><br>Gruss,<br>Alex<br><br><br><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">-----Original Message-----<br>From: volkszaehler-users [mailto:<a href="mailto:volkszaehler-users-" rel="noreferrer noreferrer" target="_blank">volkszaehler-users-</a><br><a href="mailto:bounces@demo.volkszaehler.org" style="color:purple;text-decoration:underline" rel="noreferrer noreferrer" target="_blank">bounces@demo.volkszaehler.org</a>] On Behalf Of Tobias Lehr<br>Sent: Sunday, March 29, 2020 3:25 PM<br>To: volkszaehler-users<br>Subject: [vz-users] Gesamtverbrauch Gaszähler mit Nachkommastellen<br><br>Hallo,<br><br>ich logge meinen Gasverbrauch per S0 in den Volkszaehler. Die Werte für<br>min., max., aktuell und Verbrauch werden mit Nachkommastellen<br>angezeigt. Der Gesamtverbrauch wird aber nur mit ganzer Zahl angezeigt.<br>Mein Gaszähler hat aber 3 Nachkommastellen und mein Gasversorger<br>möchte den Zählerstand mit Nachkommastellen angegeben haben. Und da<br>ich gerade den Zählerstand für die Abrechnung angeben musste, wollte ich<br>wissen ob man den Gesamtverbrauch, der ja der Zählerstand ist, auch mit<br>Nachkommastellen anzeigen lassen kann. Ich habe da was in Erinnerung das<br>es eventuell durch Änderung der options.js Datei gehen könnte. Aber ich<br>habe leider überhaupt keine Idee wie. Liege ich da richtig? Und könnte mir<br>da jemand Unterstützung geben.<br><br>Gruß Tobias</div></div></div></blockquote></div></div></div></div></div></blockquote></div><br></div></div></blockquote></div>
</blockquote></div>