<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=utf-8"><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;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:"Segoe UI Symbol";
panose-1:2 11 5 2 4 2 4 2 2 3;}
/* 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;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
p.HTMLVorformatiert, li.HTMLVorformatiert, div.HTMLVorformatiert
{mso-style-name:"HTML Vorformatiert";
mso-style-link:"HTML Vorformatiert Zchn";
margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.HTMLVorformatiertZchn
{mso-style-name:"HTML Vorformatiert Zchn";
mso-style-priority:99;
mso-style-link:"HTML Vorformatiert";
font-family:"Courier New";}
span.EmailStyle22
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle23
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle24
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle25
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle26
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle27
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle28
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle29
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle30
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@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 style='color:#1F497D'>Hallo Ralf,<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>Wenn Du keine Aggregation benutzt ist gegen diese Art des Aufräumens m.E. nichts einzuwenden. Allerdings muss ich an dieser Stelle auch nochmal klarstellen, dass ich keiner der VZ-Entwickler bin, sondern nur Benutzer mit recht guten Unix-Kenntnissen, aber eher rudimentären Datenbank- und Programmierkenntnissen. Also auf Deine eigene Verantwortung.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>Bzgl. der Aggregation – schau doch nochmal ob eine Tabelle volkszaehler.aggregate existiert, und falls ja, welchen Inhalt sie hat. <o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>Du hattest glaube ich geschrieben, dass es um eine Handvoll Sensoren geht, die alle 5 Minuten loggen, oder habe ich da was falsches in Erinnerung?<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>Diese paar Einträge der letzten 24 Stunden einmal täglich auszuwerten und selektiv zu löschen sollte die Datenbank locker abkönnen. Wenn Du alle Anfragen in einem SQL-Skript zusammenfasst, werden sie ohnehin seriell abgearbeitet. <o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>Mehrere Abfragen machen aber nur dann Sinn, wenn Du wie in Deinem letzten Beispiel unterschiedliche Grenzwerte setzen willst.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>Mehrere gleichartige Sensoren könntest Du auch einfach mittels <o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>DELETE</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>FROM</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:olive'>`volkszaehler`</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>.</span><span style='font-size:9.0pt;font-family:"Courier New";color:olive'>`data`</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>WHERE</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>(</span><span style='font-size:9.0pt;font-family:"Courier New";color:olive'>`channel_id`</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>IN</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> (</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>x,y,z</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>))<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>AND</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:maroon'>timestamp</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>></span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>(</span><b><span style='font-size:9.0pt;font-family:"Courier New";color:navy'>unix_timestamp</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>(</span><b><span style='font-size:9.0pt;font-family:"Courier New";color:navy'>current_timestamp</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>)-</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>24</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>*</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>60</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>*</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>60</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>)*</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>1000<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'> AND</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>(<b>VALUE</b></span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'><-</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>5</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>or</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>VALUE</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>></span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>40</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>);<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>zusammenfassen. Das wäre dann für die DB noch weniger Last.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>Gruss,<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>Alex<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>PS: In Deinem Beispiel hast Du jetzt nach dem where eine Klammer zuviel.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span lang=DE style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=DE style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> volkszaehler-users [mailto:volks</span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>zaehler-users-bounces@demo.volkszaehler.org] <b>On Behalf Of </b>Ralf Wismann<br><b>Sent:</b> Tuesday, January 28, 2020 10:53 AM<br><b>To:</b> 'volkszaehler.org - users'<br><b>Subject:</b> Re: [vz-users] 1-Wire Messwerte Filtern/Löschen<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=DE>Hallo Alex,<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>vielen Dank! Habe mir ein Testsystem aufgebaut auf Basis eines Backups. Das laufende System stammt aus Januar 2018.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>Die crontabs unter dem user pi ist leer bzw. ist noch anzulegen. Entsprechend wird derzeit keine Aggregation durchgeführt.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>Allgemein ist mir die Lösung per SQL schon ganz recht, da sie für mich recht greifbar ist da die SQL Datenbank des Volkszählers eh per Microsoft Query in Excel ausgelesen wird. Somit ist der Wiedereinstieg recht flott wieder aufgefrischt und die Handhabung „bekannter“.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>Bzgl. der verschieden Kanäle sollten 2 oder mehr Befehle funktionieren, da Microsoft Query auch mehrere Anfrage absetzt….allerdings nur SELECT/lesend.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>Was ich gerne machen würde z.B. für Innentemperatur und Heizungvorlauf:<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:9.0pt;font-family:"Courier New";color:blue'>DELETE</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>FROM</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:olive'>`volkszaehler`</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>.</span><span style='font-size:9.0pt;font-family:"Courier New";color:olive'>`data`</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>WHERE</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>((</span><span style='font-size:9.0pt;font-family:"Courier New";color:olive'>`channel_id`</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>=</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>11</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>)</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>AND</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:maroon'>timestamp</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>></span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>(</span><b><span style='font-size:9.0pt;font-family:"Courier New";color:navy'>unix_timestamp</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>(</span><b><span style='font-size:9.0pt;font-family:"Courier New";color:navy'>current_timestamp</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>)-</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>24</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>*</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>60</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>*</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>60</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>)*</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>1000<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>AND</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>(<b>VALUE</b></span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'><-</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>5</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>or</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>VALUE</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>></span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>40</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>);<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:9.0pt;font-family:"Courier New";color:blue'>DELETE</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>FROM</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:olive'>`volkszaehler`</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>.</span><span style='font-size:9.0pt;font-family:"Courier New";color:olive'>`data`</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>WHERE</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>((</span><span style='font-size:9.0pt;font-family:"Courier New";color:olive'>`channel_id`</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>=</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>12</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>)</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>AND</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:maroon'>timestamp</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>></span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>(</span><b><span style='font-size:9.0pt;font-family:"Courier New";color:navy'>unix_timestamp</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>(</span><b><span style='font-size:9.0pt;font-family:"Courier New";color:navy'>current_timestamp</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>)-</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>24</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>*</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>60</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>*</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>60</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>)*</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>1000<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>AND</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>(<b>VALUE</b></span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'><15</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>or</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>VALUE</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>></span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>60</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>);<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>Wenn es unproblematisch ist, warum dann nicht alle 8 Temperaturen im jetzigen System so „bereinigen/prüfen“?<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 und Viele Grüße<o:p></o:p></span></p><p class=MsoNormal><span lang=DE>Ralf<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><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span lang=DE>Von:</span></b><span lang=DE> volkszaehler-users <volkszaehler-users-bounces@demo.volkszaehler.org> <b>Im Auftrag von </b>rgb@nord-com.net<br><b>Gesendet:</b> Montag, 27. Januar 2020 11:01<br><b>An:</b> 'volkszaehler.org - users' <volkszaehler-users@demo.volkszaehler.org><br><b>Betreff:</b> Re: [vz-users] 1-Wire Messwerte Filtern/Löschen<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Hallo Ralf,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>Bzgl. Aggregation schaue mal in die crontabs… standardmässig steht in der crontab des Benutzers pi in etwa so etwas drin:<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'>pi@avz:~:(3)> crontab -l | grep aggregate<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'>*/10 * * * * php /var/www/volkszaehler.org/bin/aggregate run -m delta -l minute >/dev/null<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'>1 * * * * php /var/www/volkszaehler.org/bin/aggregate run -m delta -l hour >/dev/null<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'>0 1 * * * php /var/www/volkszaehler.org/bin/aggregate run -m delta -l day >/dev/null<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>Dann hast Du die Aggregation aktiviert. Bzgl. mehrerer Kanäle/Sensoren – die kannst Du mit einem Befehl abfragen/löschen:<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>DELETE</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>FROM</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:olive'>`volkszaehler`</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>.</span><span style='font-size:9.0pt;font-family:"Courier New";color:olive'>`data`</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>WHERE</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>((</span><span style='font-size:9.0pt;font-family:"Courier New";color:olive'>`channel_id`</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>=</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>x</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>)</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>OR</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>(`</span><span style='font-size:9.0pt;font-family:"Courier New";color:olive'>channel_id`</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>=</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>y</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>))</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>AND</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:maroon'>timestamp</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>></span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>(</span><b><span style='font-size:9.0pt;font-family:"Courier New";color:navy'>unix_timestamp</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>(</span><b><span style='font-size:9.0pt;font-family:"Courier New";color:navy'>current_timestamp</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>)-</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>7</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>*</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>24</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>*</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>60</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>*</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>60</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>)*</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>1000<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>AND</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>(<b>VALUE</b></span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'><-</span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>5</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>or</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>VALUE</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>></span><span style='font-size:9.0pt;font-family:"Courier New";color:purple'>40</span><span style='font-size:9.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'><span lang=DE style='color:#1F497D'>Die channel_id stehen in der entities Tabelle.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>SELECT</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>*</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>FROM</span></b><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:olive'>`volkszaehler`</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>.</span><span style='font-size:9.0pt;font-family:"Courier New";color:olive'>`entities`</span><span style='font-size:9.0pt;font-family:"Courier New";color:black'> </span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'>;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New";color:blue'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=DE style='color:#1F497D'>Diese zeigt u.a. die Zuordnung von UUID und (channel_)id. Probiere die Abfragen aber auf jeden Fall aus, bevor Du ans Löschen gehst, dazu das „DELETE FROM“ durch ein „SELECT * FROM“ ersetzen, dann siehst Du genau die Zeilen, die Du ansonsten löschen würdest.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=DE style='color:#1F497D'>Diese Zuordnung hättest Du automatisch, wenn Du die Abfragen über die Middleware machst, ich glaube das wäre wirklich der sauberere Weg, zumal wenn Du Dir mit SQL nicht sicher bist.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=DE style='color:#1F497D'>Gruss,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=DE style='color:#1F497D'>Alex</span><span lang=DE style='font-size:10.0pt;color:blue'><o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span lang=DE style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=DE style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> volkszaehler-users [<a href="mailto:volkszaehler-users-bounces@demo.volkszaehler.org">mailto:volkszaehler-users-bounces@demo.volkszaehler.org</a>] <b>On Behalf Of </b>Ralf Wismann<br><b>Sent:</b> Monday, </span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>January 27, 2020 10:18 AM<br><b>To:</b> 'volkszaehler.org - users'<br><b>Subject:</b> Re: [vz-users] 1-Wire Messwerte Filtern/Löschen<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=DE>Hallo<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>vielen Dank Alex und Thomas!<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>Muss mir erst noch ein Backup/Testsystem aufsetzen und dann lass ich es mal laufen.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>Bzgl. Aggregation bin ich mir unsicher. In der vzlogger.conf ist hinterlegt, dass die Temperaturen alle 10 Minuten gemessen werden. Eine weitere/zusätzliche Verdichtung der Daten ist von mir nicht aktiviert. Somit nicht vorhanden? Du meinst z.B. dieses vzcompress oder so ähnlich wie es im Wiki steht?<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>Noch eine Frage vom Einsteiger dazu: Ich habe ja mehrere Temperaturen und darunter machen 2,3 schon mal diese Probleme. Also würde ich jetzt mehre DELETE Befehle in das SQL Script einfügen wollen.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE>Die Zeitspanne der Daten wollte ich möglichst „sinnvoll“ zum Zyklus des Crontab wählen, nichtsdestotrotz glaube ich, dass eine SQL-Abfrage/Befehl noch nicht fertig sein könnte, wenn der zweite Befehl ausgeführt wird. Gibt das irgendwelche Probleme (Überlast, undefinierte Ergebnis, Verworfene Befehle/Daten, etc.) oder kann eine/die Datenbank das handeln?<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>Vielen Dank<o:p></o:p></span></p><p class=MsoNormal><span lang=DE>Ralf<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>P.S.: Stelle mit Freude fest, dass die Wichtigkeit der Schreib/Zitierweise in der Mailingliste an Priorität verloren hat. Das war für mich als Outlook-Nutzer immer ein großer künstlicher Krampf es so hinzubiegen. Hoffe auch so können wir uns gut Verständigen. Danke! <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><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><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span lang=DE>Von:</span></b><span lang=DE> volkszaehler-users <<a href="mailto:volkszaehler-users-bounces@demo.volkszaehler.org">volkszaehler-users-bounces@demo.volkszaehler.org</a>> <b>Im Auftrag von </b><a href="mailto:rgb@nord-com.net">rgb@nord-com.net</a><br><b>Gesendet:</b> Sonntag, 26. Januar 2020 22:50<br><b>An:</b> 'volkszaehler.org - users' <<a href="mailto:volkszaehler-users@demo.volkszaehler.org">volkszaehler-users@demo.volkszaehler.org</a>><br><b>Betreff:</b> Re: [vz-users] 1-Wire Messwerte Filtern/Löschen<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Hallo Ralf,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>die Abfrage müsste so aussehen<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><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'>DELETE</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'>`data`</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'>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:purple'>xxxxxx<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'>AND</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:maroon'>timestamp</span></b><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'>(</span><b><span style='font-size:10.0pt;font-family:"Courier New";color:navy'>unix_timestamp</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'>current_timestamp</span></b><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'>7</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'>24</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'>60</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'>60</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'>1000<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'>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:blue'>(<b>VALUE</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:purple'>5</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'>or</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'>VALUE</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'>></span><span style='font-size:10.0pt;font-family:"Courier New";color:purple'>40</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><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>Und das SQL Script darf dann nur den SQL Code enthalten aber nicht den Aufruf – sprich Du speicherst nur z.B. den o.g. Code in eine Datei und trägst in die Crontab dann folgendes ein:<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>mysql –ubenutzername -ppasswort volkszaehler < /path/to/sql.script<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>Ich würde für die DB auch nicht den Root-Account verwenden, der Standard User „vz“ (Password „demo“ falls es nicht geändert wurde) sollte reichen…<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>Aber: Ich sehe da ein weiteres Problem – wenn bei dem genannten Kanal die Datenaggregation aktiviert ist, hast Du die falschen Werte da schon mit drin bevor Du sie löschen kannst. Und da dabei verschiedene Werte miteinander verrechnet werden, lässt sich das dann auch nicht mehr so leicht per Schema s.o. entfernen.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>Vielleicht kann das die Middleware-Anfrage, die Andreas empfohlen hat… ich weiss es nicht? Auf jeden Fall kannst Du auch Middleware Aufrufe z.B. über wget oder curl automatisch laufen lassen.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>Ansonsten bliebe Dir nur – entweder die Aggregation für den betroffenen Kanal ausschalten oder sie nach dem Lauf des Skriptes neu aufbauen – sinnvollerweise nur wenn auch wirklich falsche Werte aufgetreten sind. Sprich vor dem DELETE nochmal einen SELECT laufen lassen und den Rückgabewert abfragen.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>Gruss,<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'>Alex<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> volkszaehler-users [</span><span lang=DE><a href="mailto:volkszaehler-users-bounces@demo.volkszaehler.org"><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>mailto:volkszaehler-users-bounces@demo.volkszaehler.org</span></a></span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>] <b>On Behalf Of </b>USER VZ<br><b>Sent:</b> Sunday, January 26, 2020 6:40 PM<br><b>To:</b> volkszaehler.org - users<br><b>Subject:</b> Re: [vz-users] 1-Wire Messwerte Filtern/Löschen<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Der SQL- Befehl wird nicht funktionieren. <o:p></o:p></p><div><p class=MsoNormal>Die Abfrage nach Value muss mit ODER verknüpft werden. Z.b.:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>DELETE FROM `volkszaehler` WHERE and channel_id = 12 AND timestamp< (unix_timestamp(current_timestamp)-7*24*60*60)*1000 AND (value >-5 OR value <40)</span><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Ob der mysql Syntax stimmt kann ich sagen, aber die Richtung würde ich auch gehen.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Thomas <o:p></o:p></p><div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Mail: <span lang=DE><a href="mailto:thomas@thhoe.de"><span lang=EN-US>thomas@thhoe.de</span></a></span><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>Am 26.01.2020 um 16:28 schrieb Ralf Wismann <<span lang=DE><a href="mailto:ralf.wismann@gmx.de"><span lang=EN-US>ralf.wismann@gmx.de</span></a></span>>:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p><p class=MsoNormal>Hallo<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal style='text-indent:35.4pt'>Am Sonntag, 26. Januar 2020 15:04 schrieb Anrears Götz:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:35.4pt'>„Die Middleware kann DELETE auch übers Api, dabei lässt sich auch ein Wertfilter angeben. Benutzung lässt sich auf der ML recherchieren. „<o:p></o:p></p><div><p class=MsoNormal>Danke Andreas. Schau ich mir auch gerne an. Durch den manuellen Eingriff scheint mir das hier weniger gut, da es nicht mein Volkszähler ist und der Besitzer nicht selber an der Datenbank arbeiten möchte. Ich habe / möchte auch nicht unbedingt manuell dort regelmäßig aktiv sein <span style='font-family:"Segoe UI Symbol","sans-serif"'>😉</span><o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal style='text-indent:35.4pt'>Am 26.01.2020 um 14:25 schrieb Rupert Schöttler <<span lang=DE><a href="mailto:rupert.schoettler@gmx.de"><span lang=EN-US>rupert.schoettler@gmx.de</span></a></span>>:<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal style='margin-left:35.4pt'>„Dein vergleichsweise einfaches Fehlerbild, nämlich 85°C = Fehler, kann man einfach auf der Datenbank reparieren: <o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal style='margin-left:35.4pt'>DELETE FROM `data` WHERE (channel_id IN (<Kanalliste>)) AND (value = 85). Diesen Befehl gelegentlich in phpMyAdmin absetzen oder z.B. 1x tgl. per cron laufen lassen und ausgeputzt ist's. Aber Achtung mit der Syntax und den Kanalnummern: Was weg ist ist weg! ;-)“<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>Danke Rupert. Hatte ich vermutet, wenn es keine Standardfehlerkorrekturoption gibt.<o:p></o:p></p><p class=MsoNormal>Da ich so etwas noch nicht gemacht habe. Bitte um kurzen Quercheck.<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>Also ich lege ein Bash-Script an „reinigung.sh“<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>Tippe dort rein:<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>#!/bin/bash</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>mysql --user=root -praspberry</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>DELETE FROM `volkszaehler` WHERE and channel_id = 12 AND timestamp< (unix_timestamp(current_timestamp)-7*24*60*60)*1000 AND value >-5 AND value <40;</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>Dies zB soll Werte für eine Innenraumtemperatur (Kanal 12) kleiner -5Grad and Größer 40 Grad der letzten 7 Tage.</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>Dieses Bash Script lasse ich Täglich um 3h laufen mit cron:</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>00 3 * * * root /verzeichnis/script >/dev/null 2>&1</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>Geht das in die Richtung?</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>Danke und Grüße</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>Ralf</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'> </span><o:p></o:p></p></div></div></blockquote></div></div></div></div></div></body></html>