Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. [gelöst] Regenmenge täglich speichern

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    [gelöst] Regenmenge täglich speichern

    This topic has been deleted. Only users with topic management privileges can see it.
    • mcBirne
      mcBirne @mcBirne last edited by

      Wie kann ich nun die Daten zu einem festen Zeitpunkt in eine Spalte einer Tabelle schreiben?

      wendy2702 1 Reply Last reply Reply Quote 0
      • wendy2702
        wendy2702 @mcBirne last edited by

        @mcbirne Welchen Adapter nutzt du denn jetzt zum loggen?

        mcBirne 1 Reply Last reply Reply Quote 0
        • mcBirne
          mcBirne @wendy2702 last edited by

          @wendy2702 Ich habe jetzt den SQL Adapter mit einer Mysql Datenbank eingerichtet. Ich würde die Werte gerne in eine definierte Tabelle eintragen. Also mit Spalten (Zeit / Regenmenge pro Tag / min Temp / max Temp) So, dass ich Später eine Zeile für jeden Tag habe.

          wendy2702 1 Reply Last reply Reply Quote 0
          • wendy2702
            wendy2702 @mcBirne last edited by

            @mcbirne Gibt hier verschiedene Tabellen vorlagen im Forum, für Regenmenge habe ich auf Anhieb nichts im Gedächtnis aber man kann die ein oder andere ja an seine Bedürfnisse anpassen oder du schaust die Grafana mal an ob das eventuell deine Anforderungen erfüllt.

            mcBirne 1 Reply Last reply Reply Quote 0
            • mcBirne
              mcBirne @wendy2702 last edited by

              @wendy2702 Aktuell schreibe die Werte mit _ getrennt in eine Variable. So habe ich sie alle in der DB. Dann kann ich sie später in Excel auseinandernehmen. Das ist zwar nicht schön, aber funktioniert erstmal. Grafana schaue ich mir mal an. Aber das ist ja eher zur grafischen Darstellung.
              Am liebsten würde ich per Blockly Werte in die DB in eine bestimmte Tabelle schreiben. Aber das geht scheinbar nicht

              mcBirne 1 Reply Last reply Reply Quote 0
              • mcBirne
                mcBirne @mcBirne last edited by

                @mcbirne Es wäre schon ausreichend, wenn die Werte in der DB gespeichert werden und die ID ein Wort ist. Leider sind das nur Zahlen. So hat man in der Tabelle eine Zahl (ist das der Zeitstempel?) die ID (wieder eine Zahl) und dann den Wert.

                liv-in-sky 1 Reply Last reply Reply Quote 0
                • liv-in-sky
                  liv-in-sky @mcBirne last edited by liv-in-sky

                  @mcbirne

                  wenn du die werte z.b. jede 30 minuten in eine liste(array) schreibst und dieses array in einen dp speicherst. kannst du um 0:00 das array auswerten(höchste und niedrigste temp). diese auswertung schreibst du dann einmal als json - format in einen dp. es gibt sog. json widgets, die dir dann eine tabelle anzeigen können

                  am monatsende kannst du dann das tägl. json auswerten, alles löschen und wieder von vorne anfangen - so hast du dann eine monat. auswertung welche du wieder in einen dp als json schreibst.

                  du brachst dazu kein history. deine daten liegen einfach in dp. das reicht für eine tabelle. history brauchst du für grafik-anzeige (man könnte aber auch eine tabelle aus der history erzeugen - das geht aber nur mit javascript )

                  du kannst das "fast" alles mit blockly machen - das erzeugen des jsons-formats benötigt eine klitzekleines javascript modul - das ist schnell erstellt

                  trigger alle z.b 30 min.

                  • dp mit letztem array auslesen
                  • blockly, welches die werte ausliest
                  • das nächste ist dann, dass wieder-speichern in das array(liste)
                  • dann array in dp schreiben

                  trigger2 um 23:59

                  • auswertung des array - eine schleife über das array und die temps ausfiltern
                  • datum auslesen
                  • regenmenge auslesen
                  • das ganze in ein json schreiben und dieses in dp

                  habe mal von mir etwas verändert - du musst einen dp als type feld (myarr) einrichten und einen vom typ text(myjson). diese dann im script angleichen. auch die datenpunkte für die temp musst du im script angleichen (mit deiner quelle)

                  zum test habe ich alle 20 sekunden die messung notiert und alle 3 minuten wird der "tag" beendet - die regenmenge habe ich nicht integriert, müßte noch rein (ich weiß nicht, ob es täglich einen wert gibt, oder ob er hochgezählt und immer wieder upgedatet wird, ...)

                  sieht dann so aus:

                  Image 2.png

                  das script:

                  <xml xmlns="https://developers.google.com/blockly/xml">
                   <variables>
                     <variable id="!qI%V7A*sBp50O4*@ouS">x</variable>
                     <variable id="8oq-+SkTYWw:o+`Y*h?~">y</variable>
                     <variable id="!skB|F1]Z.Z9l`H9EbTC">myarr</variable>
                     <variable type="timeout" id="timeout">timeout</variable>
                     <variable id="qfe9Z~ER#OqM6W:#XNPA">myelements</variable>
                     <variable id="K?ma?fv!bxf0zpe.ik*^">myarr2</variable>
                     <variable id=",}TAmTg~SD)$AiH(yF-d">myjson</variable>
                   </variables>
                   <block type="schedule" id="Oml%)D`p/y#x|/IjbErt" x="88" y="-238">
                     <field name="SCHEDULE">*/20 * * * * *</field>
                     <statement name="STATEMENT">
                       <block type="variables_set" id="/oQWgxaI=@PbVrLo%wHm">
                         <field name="VAR" id="!skB|F1]Z.Z9l`H9EbTC">myarr</field>
                         <value name="VALUE">
                           <block type="get_value" id="{26gJl+t^^)Gdl(tROvW">
                             <field name="ATTR">val</field>
                             <field name="OID">0_userdata.0.wetterdaten.myArr</field>
                           </block>
                         </value>
                         <next>
                           <block type="controls_if" id="@*1+0[0bp{$C}waM5Po+">
                             <mutation else="1"></mutation>
                             <value name="IF0">
                               <block type="logic_compare" id="wwI,7AZ8wi^$D{Zb:e4b">
                                 <field name="OP">LT</field>
                                 <value name="A">
                                   <block type="lists_length" id="W{EpV7eO},;O2]-fTC5{">
                                     <value name="VALUE">
                                       <block type="variables_get" id=".ifUgBrf=0E*qQI@nRYP">
                                         <field name="VAR" id="!skB|F1]Z.Z9l`H9EbTC">myarr</field>
                                       </block>
                                     </value>
                                   </block>
                                 </value>
                                 <value name="B">
                                   <block type="math_number" id="?~HL)i.Wa2`;D+P6go6g">
                                     <field name="NUM">1</field>
                                   </block>
                                 </value>
                               </block>
                             </value>
                             <statement name="DO0">
                               <block type="variables_set" id="B*}8LtqJV7dhEL,|i@MC">
                                 <field name="VAR" id="!skB|F1]Z.Z9l`H9EbTC">myarr</field>
                                 <value name="VALUE">
                                   <block type="lists_create_with" id="/xBDuM0E5cvV*h}#USxG">
                                     <mutation items="0"></mutation>
                                   </block>
                                 </value>
                               </block>
                             </statement>
                             <statement name="ELSE">
                               <block type="variables_set" id="%121CWDDy`?PvUS++b8?">
                                 <field name="VAR" id="!skB|F1]Z.Z9l`H9EbTC">myarr</field>
                                 <value name="VALUE">
                                   <block type="get_value" id="IQi7.%~vDypBMGc,pynJ">
                                     <field name="ATTR">val</field>
                                     <field name="OID">0_userdata.0.wetterdaten.myArr</field>
                                   </block>
                                 </value>
                               </block>
                             </statement>
                             <next>
                               <block type="variables_set" id="A2B#:Mli0^M]Um+8O)3s">
                                 <field name="VAR" id="qfe9Z~ER#OqM6W:#XNPA">myelements</field>
                                 <value name="VALUE">
                                   <block type="lists_create_with" id="*8J`R9DA6CKZm^hSO+wV">
                                     <mutation items="0"></mutation>
                                   </block>
                                 </value>
                                 <next>
                                   <block type="lists_setIndex" id="EPncO1ZSKM0GR}xHrLU?">
                                     <mutation at="false"></mutation>
                                     <field name="MODE">SET</field>
                                     <field name="WHERE">FIRST</field>
                                     <value name="LIST">
                                       <block type="variables_get" id="?P8zcdfBWzH:JBDB36^h">
                                         <field name="VAR" id="qfe9Z~ER#OqM6W:#XNPA">myelements</field>
                                       </block>
                                     </value>
                                     <value name="TO">
                                       <block type="get_value" id="!uDqnNcz7umCT#c(bEPw">
                                         <field name="ATTR">val</field>
                                         <field name="OID">alias.0.Allgemein.Aussentemperatur.Temperatur</field>
                                       </block>
                                     </value>
                                     <next>
                                       <block type="comment" id="-5o?K3gd7_qjzU1@p{;_">
                                         <field name="COMMENT">hier regenmenge</field>
                                         <next>
                                           <block type="lists_setIndex" id="cC9}6pMUg/`Ofv=GxTov">
                                             <mutation at="true"></mutation>
                                             <field name="MODE">SET</field>
                                             <field name="WHERE">FROM_START</field>
                                             <value name="LIST">
                                               <block type="variables_get" id="gr(tl+z,NF.olWoU4O0S">
                                                 <field name="VAR" id="qfe9Z~ER#OqM6W:#XNPA">myelements</field>
                                               </block>
                                             </value>
                                             <value name="AT">
                                               <block type="math_number" id="|R*~h}O|FNH.e%}fNts)">
                                                 <field name="NUM">2</field>
                                               </block>
                                             </value>
                                             <value name="TO">
                                               <block type="get_value" id=",*5q!H2utY4)79KGUR:}">
                                                 <field name="ATTR">val</field>
                                                 <field name="OID">alias.0.Allgemein.Aussentemperatur.Temperatur</field>
                                               </block>
                                             </value>
                                             <next>
                                               <block type="lists_setIndex" id="Vt;^A^D*1%NZ^e~5gw4Q">
                                                 <mutation at="true"></mutation>
                                                 <field name="MODE">SET</field>
                                                 <field name="WHERE">FROM_START</field>
                                                 <value name="LIST">
                                                   <block type="variables_get" id="eryWh%1HnpP{@OZvGec0">
                                                     <field name="VAR" id="qfe9Z~ER#OqM6W:#XNPA">myelements</field>
                                                   </block>
                                                 </value>
                                                 <value name="AT">
                                                   <block type="math_number" id="No_;:#-*p+9nYqG?Zj;t">
                                                     <field name="NUM">3</field>
                                                   </block>
                                                 </value>
                                                 <value name="TO">
                                                   <block type="convert_from_date" id="=|NbxGgGFQy7tq?0NY$F">
                                                     <mutation xmlns="http://www.w3.org/1999/xhtml" format="true" language="false"></mutation>
                                                     <field name="OPTION">custom</field>
                                                     <field name="FORMAT">SS:mm:ss</field>
                                                     <value name="VALUE">
                                                       <block type="time_get" id="YTD*#AIq.~oDuT5~AH?l">
                                                         <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                         <field name="OPTION">object</field>
                                                       </block>
                                                     </value>
                                                   </block>
                                                 </value>
                                                 <next>
                                                   <block type="lists_setIndex" id="BTRs}i/8)gq^ExM9fZ_v">
                                                     <mutation at="false"></mutation>
                                                     <field name="MODE">INSERT</field>
                                                     <field name="WHERE">LAST</field>
                                                     <value name="LIST">
                                                       <block type="variables_get" id="(D_h@!8)+8pMJrIk$EP|">
                                                         <field name="VAR" id="!skB|F1]Z.Z9l`H9EbTC">myarr</field>
                                                       </block>
                                                     </value>
                                                     <value name="TO">
                                                       <block type="variables_get" id="b)f8m*`cP$Oa1R8[ke+E">
                                                         <field name="VAR" id="qfe9Z~ER#OqM6W:#XNPA">myelements</field>
                                                       </block>
                                                     </value>
                                                     <next>
                                                       <block type="control" id="K^0u-hA}~$%b]uT9+/kk">
                                                         <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                         <field name="OID">0_userdata.0.wetterdaten.myArr</field>
                                                         <field name="WITH_DELAY">FALSE</field>
                                                         <value name="VALUE">
                                                           <block type="variables_get" id="P=dA{F@vZsf`M;]vBsK_">
                                                             <field name="VAR" id="!skB|F1]Z.Z9l`H9EbTC">myarr</field>
                                                           </block>
                                                         </value>
                                                       </block>
                                                     </next>
                                                   </block>
                                                 </next>
                                               </block>
                                             </next>
                                           </block>
                                         </next>
                                       </block>
                                     </next>
                                   </block>
                                 </next>
                               </block>
                             </next>
                           </block>
                         </next>
                       </block>
                     </statement>
                     <next>
                       <block type="schedule" id="Y)HhRwdj^xzfpcR:Mu~m">
                         <field name="SCHEDULE">*/3 * * * *</field>
                         <statement name="STATEMENT">
                           <block type="timeouts_settimeout" id="^``d8TmgLH1s(5M`bW/7">
                             <field name="NAME">timeout</field>
                             <field name="DELAY">6</field>
                             <field name="UNIT">sec</field>
                             <statement name="STATEMENT">
                               <block type="variables_set" id="O0QJI_Yd^J+6h2u(86%}">
                                 <field name="VAR" id="K?ma?fv!bxf0zpe.ik*^">myarr2</field>
                                 <value name="VALUE">
                                   <block type="get_value" id="`JOs68k58vLqh$EsEr*{">
                                     <field name="ATTR">val</field>
                                     <field name="OID">0_userdata.0.wetterdaten.myArr</field>
                                   </block>
                                 </value>
                                 <next>
                                   <block type="controls_if" id="1roM!S3,;A0Fz2)7c#%q">
                                     <mutation else="1"></mutation>
                                     <value name="IF0">
                                       <block type="logic_operation" id="s=eYZ*8[;w@xNm#Hs:B`" inline="false">
                                         <field name="OP">OR</field>
                                         <value name="A">
                                           <block type="logic_compare" id=")P%O+www0o}/eN#%ydo-">
                                             <field name="OP">EQ</field>
                                             <value name="A">
                                               <block type="get_value" id="1)u17aP.U|2[9;Qv/#Jl">
                                                 <field name="ATTR">val</field>
                                                 <field name="OID">0_userdata.0.wetterdaten.myjson</field>
                                               </block>
                                             </value>
                                             <value name="B">
                                               <block type="logic_null" id="?%zXy57d^/xlke,!ik-}"></block>
                                             </value>
                                           </block>
                                         </value>
                                         <value name="B">
                                           <block type="logic_compare" id="c~wq1g9`wGeE*0~Y}{e3">
                                             <field name="OP">EQ</field>
                                             <value name="A">
                                               <block type="get_value" id="EA)j2{e|O/l.+.M63w,V">
                                                 <field name="ATTR">val</field>
                                                 <field name="OID">0_userdata.0.wetterdaten.myjson</field>
                                               </block>
                                             </value>
                                             <value name="B">
                                               <block type="text" id="/2?`df24lw8IgA^yYmAi">
                                                 <field name="TEXT"></field>
                                               </block>
                                             </value>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                     <statement name="DO0">
                                       <block type="debug" id="SY$#.xeOIzKPdHc$76Ew">
                                         <field name="Severity">log</field>
                                         <value name="TEXT">
                                           <shadow type="text" id="t6q{V@`Y^Cx1u.qd^j)i">
                                             <field name="TEXT">test</field>
                                           </shadow>
                                           <block type="text" id="W_Z)bP,A:V+lMjomQw(M">
                                             <field name="TEXT">is null</field>
                                           </block>
                                         </value>
                                         <next>
                                           <block type="variables_set" id="!IQc}l9;{#IkEPi#a{)$">
                                             <field name="VAR" id=",}TAmTg~SD)$AiH(yF-d">myjson</field>
                                             <value name="VALUE">
                                               <block type="lists_create_with" id=".KRm4To1AoALX}_S=A@[">
                                                 <mutation items="0"></mutation>
                                               </block>
                                             </value>
                                           </block>
                                         </next>
                                       </block>
                                     </statement>
                                     <statement name="ELSE">
                                       <block type="variables_set" id="p{eUH`FC3Zx~AB!aJy5]">
                                         <field name="VAR" id=",}TAmTg~SD)$AiH(yF-d">myjson</field>
                                         <value name="VALUE">
                                           <block type="convert_json2object" id="_7I5/pZdY:D_{55+cHTT">
                                             <value name="VALUE">
                                               <block type="get_value" id="fK`6Jx!VRm@!;4SC~/1s">
                                                 <field name="ATTR">val</field>
                                                 <field name="OID">0_userdata.0.wetterdaten.myjson</field>
                                               </block>
                                             </value>
                                           </block>
                                         </value>
                                       </block>
                                     </statement>
                                     <next>
                                       <block type="control" id="n4.m}Zo@taPB8WOA^Rj(">
                                         <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                         <field name="OID">0_userdata.0.wetterdaten.myjson</field>
                                         <field name="WITH_DELAY">FALSE</field>
                                         <value name="VALUE">
                                           <block type="procedures_callcustomreturn" id=".:AGH_ry0p5v2r)qLz8r">
                                             <mutation name="etwas tun">
                                               <arg name="x"></arg>
                                               <arg name="y"></arg>
                                             </mutation>
                                             <value name="ARG0">
                                               <block type="variables_get" id="uWP,.`^=2fO,,1jqwL6f">
                                                 <field name="VAR" id=",}TAmTg~SD)$AiH(yF-d">myjson</field>
                                               </block>
                                             </value>
                                             <value name="ARG1">
                                               <block type="variables_get" id="qMF5|!JdVK|F70k2Dn+G">
                                                 <field name="VAR" id="K?ma?fv!bxf0zpe.ik*^">myarr2</field>
                                               </block>
                                             </value>
                                           </block>
                                         </value>
                                         <next>
                                           <block type="variables_set" id="IMDiAZR(f[bSbng5l0Dd">
                                             <field name="VAR" id="K?ma?fv!bxf0zpe.ik*^">myarr2</field>
                                             <value name="VALUE">
                                               <block type="lists_create_with" id="QgW*)m6atjp^0}X#_Av=">
                                                 <mutation items="0"></mutation>
                                               </block>
                                             </value>
                                             <next>
                                               <block type="control" id="]3MTM4Xl-nrG.EMb)8s{">
                                                 <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                 <field name="OID">0_userdata.0.wetterdaten.myArr</field>
                                                 <field name="WITH_DELAY">FALSE</field>
                                                 <value name="VALUE">
                                                   <block type="variables_get" id="^Pk)h|*XCDU]_|~A,BV3">
                                                     <field name="VAR" id="K?ma?fv!bxf0zpe.ik*^">myarr2</field>
                                                   </block>
                                                 </value>
                                               </block>
                                             </next>
                                           </block>
                                         </next>
                                       </block>
                                     </next>
                                   </block>
                                 </next>
                               </block>
                             </statement>
                           </block>
                         </statement>
                       </block>
                     </next>
                   </block>
                   <block type="procedures_defcustomreturn" id="=%|y`3l-p6J[7ttM0,t[" x="938" y="338">
                     <mutation statements="false">
                       <arg name="x" varid="!qI%V7A*sBp50O4*@ouS"></arg>
                       <arg name="y" varid="8oq-+SkTYWw:o+`Y*h?~"></arg>
                     </mutation>
                     <field name="NAME">etwas tun</field>
                     <field name="SCRIPT">DQoNCmxldCB0ZW1waGlnaD1OdW1iZXIoeVswXVswXSk7bG9nKCJhbmZhbmc6ICIrdGVtcGhpZ2gpDQpsZXQgdGVtcGxvdz1OdW1iZXIoeVswXVswXSk7DQpsZXQgZGF0ZTE7IGxldCBkYXRlMjsNCmZvcihsZXQgaT0wOyBpPHkubGVuZ3RoO2krKyl7IA0KDQppZiAoTnVtYmVyKHlbaV1bMF0pPj10ZW1waGlnaCkge3RlbXBoaWdoPU51bWJlcih5W2ldWzBdKTtkYXRlMT15W2ldWzJdOyAvKmxvZygiaGlnaDogIitkYXRlMSt0ZW1waGlnaCkqL30gZWxzZXtpZiAoaT09MCkge3RlbXBoaWdoPU51bWJlcih5W2ldWzBdKTtkYXRlMT15W2ldWzJdfX0NCmlmIChOdW1iZXIoeVtpXVswXSk8PXRlbXBsb3cpICB7dGVtcGxvdz1OdW1iZXIoeVtpXVswXSk7ZGF0ZTI9eVtpXVsyXTsvKmxvZygibG93OiAiK2RhdGUyK3RlbXBsb3cpKi99ICBlbHNle2lmIChpPT0wKSB7dGVtcGxvdz1OdW1iZXIoeVtpXVswXSk7ZGF0ZTI9eVtpXVsyXX19DQogICAgIA0KfQ0KDQp4LnB1c2goew0KICAgICJEQVRVTSI6IGZvcm1hdERhdGUoZ2V0RGF0ZU9iamVjdCgobmV3IERhdGUoKS5nZXRUaW1lKCkpKSwgIlRULk1NLkpKSkoiKSwNCiAgICAiWmVpdC1Ib2NoIjogZGF0ZTEsDQogICAgIlRlbXBIaWdoIjp0ZW1waGlnaCwNCiAgICAiWmVpdFRpZWYiOmRhdGUyLA0KICAgICJUZW1wTG93Ijp0ZW1wbG93DQogICAgDQp9KQ0KcmV0dXJuIEpTT04uc3RyaW5naWZ5KHgpOw==</field>
                     <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
                   </block>
                  </xml>
                  

                  das widget ist das json widget vom inventwo adapter (muss installiert sein)

                  1 Reply Last reply Reply Quote 0
                  • mcBirne
                    mcBirne last edited by

                    super, das werde ich mal testen. Vielen Dank!

                    liv-in-sky 1 Reply Last reply Reply Quote 0
                    • liv-in-sky
                      liv-in-sky @mcBirne last edited by liv-in-sky

                      @mcbirne

                      habe noch ein paar dinge im script geändert

                      • du kannst definieren, wieviele werte(tage) die tabelle anzeigen soll
                      • der aktuelle tageswert wird jetzt auch angezeigt
                      • die neusten werte stehen oben in der tabelle
                      • damit man das ganze auf längere zeit beobachten kann, habe ich eine sql tabelle eingerichtet - das script schreibt die täglichen werte um mitternacht in die sql datenbank (evtl sollte man da noch andere felder einfügen, damit man besser/leichter auswerten kann)

                      Image 4.png

                      Image 6.png

                      Image 5.png

                      <xml xmlns="https://developers.google.com/blockly/xml">
                       <variables>
                         <variable id="!qI%V7A*sBp50O4*@ouS">x</variable>
                         <variable id="8oq-+SkTYWw:o+`Y*h?~">y</variable>
                         <variable id=".[(J:]gC5u@_x#z^W`IY">wievielTageinVIS</variable>
                         <variable id="NnxetBELY~t%0JkoZu9N">willSQL</variable>
                         <variable id="!skB|F1]Z.Z9l`H9EbTC">myarr</variable>
                         <variable type="timeout" id="timeout">timeout</variable>
                         <variable id="qfe9Z~ER#OqM6W:#XNPA">myelements</variable>
                         <variable id="K?ma?fv!bxf0zpe.ik*^">myarr2</variable>
                         <variable id=",}TAmTg~SD)$AiH(yF-d">myjson</variable>
                         <variable id="d3]Hk8WL;7ucLDX6HO8%">sqltext</variable>
                       </variables>
                       <block type="comment" id="|VDTB^`XMNEz^TaKcqd$" x="88" y="-338">
                         <field name="COMMENT">wieviele zeilen/tage in vis</field>
                         <next>
                           <block type="variables_set" id="hzJ!Bi3G2`Il*.gC^yEr">
                             <field name="VAR" id=".[(J:]gC5u@_x#z^W`IY">wievielTageinVIS</field>
                             <value name="VALUE">
                               <block type="math_number" id="[e6%bR0[iV9A60Hcd1?0">
                                 <field name="NUM">10</field>
                               </block>
                             </value>
                             <next>
                               <block type="comment" id="{]UTER}_)ViZ_{nVHR|P">
                                 <field name="COMMENT">schreibt bei true in sql</field>
                                 <next>
                                   <block type="variables_set" id=":a?dh1JuTT`.^5W^#QLk">
                                     <field name="VAR" id="NnxetBELY~t%0JkoZu9N">willSQL</field>
                                     <value name="VALUE">
                                       <block type="logic_boolean" id="}UERlU7amphVms!@.ymh">
                                         <field name="BOOL">FALSE</field>
                                       </block>
                                     </value>
                                     <next>
                                       <block type="schedule" id="Oml%)D`p/y#x|/IjbErt">
                                         <field name="SCHEDULE">*/20 * * * *</field>
                                         <statement name="STATEMENT">
                                           <block type="comment" id="9gs[}:4Cx/Y#/4`3o[FB">
                                             <field name="COMMENT">füllt tagesdaten</field>
                                             <next>
                                               <block type="variables_set" id="/oQWgxaI=@PbVrLo%wHm">
                                                 <field name="VAR" id="!skB|F1]Z.Z9l`H9EbTC">myarr</field>
                                                 <value name="VALUE">
                                                   <block type="get_value" id="{26gJl+t^^)Gdl(tROvW">
                                                     <field name="ATTR">val</field>
                                                     <field name="OID">0_userdata.0.wetterdaten.myArr</field>
                                                   </block>
                                                 </value>
                                                 <next>
                                                   <block type="controls_if" id="@*1+0[0bp{$C}waM5Po+">
                                                     <mutation else="1"></mutation>
                                                     <value name="IF0">
                                                       <block type="logic_compare" id="wwI,7AZ8wi^$D{Zb:e4b">
                                                         <field name="OP">LT</field>
                                                         <value name="A">
                                                           <block type="lists_length" id="W{EpV7eO},;O2]-fTC5{">
                                                             <value name="VALUE">
                                                               <block type="variables_get" id=".ifUgBrf=0E*qQI@nRYP">
                                                                 <field name="VAR" id="!skB|F1]Z.Z9l`H9EbTC">myarr</field>
                                                               </block>
                                                             </value>
                                                           </block>
                                                         </value>
                                                         <value name="B">
                                                           <block type="math_number" id="?~HL)i.Wa2`;D+P6go6g">
                                                             <field name="NUM">1</field>
                                                           </block>
                                                         </value>
                                                       </block>
                                                     </value>
                                                     <statement name="DO0">
                                                       <block type="variables_set" id="B*}8LtqJV7dhEL,|i@MC">
                                                         <field name="VAR" id="!skB|F1]Z.Z9l`H9EbTC">myarr</field>
                                                         <value name="VALUE">
                                                           <block type="lists_create_with" id="/xBDuM0E5cvV*h}#USxG">
                                                             <mutation items="0"></mutation>
                                                           </block>
                                                         </value>
                                                       </block>
                                                     </statement>
                                                     <statement name="ELSE">
                                                       <block type="variables_set" id="%121CWDDy`?PvUS++b8?">
                                                         <field name="VAR" id="!skB|F1]Z.Z9l`H9EbTC">myarr</field>
                                                         <value name="VALUE">
                                                           <block type="get_value" id="IQi7.%~vDypBMGc,pynJ">
                                                             <field name="ATTR">val</field>
                                                             <field name="OID">0_userdata.0.wetterdaten.myArr</field>
                                                           </block>
                                                         </value>
                                                       </block>
                                                     </statement>
                                                     <next>
                                                       <block type="variables_set" id="A2B#:Mli0^M]Um+8O)3s">
                                                         <field name="VAR" id="qfe9Z~ER#OqM6W:#XNPA">myelements</field>
                                                         <value name="VALUE">
                                                           <block type="lists_create_with" id="*8J`R9DA6CKZm^hSO+wV">
                                                             <mutation items="0"></mutation>
                                                           </block>
                                                         </value>
                                                         <next>
                                                           <block type="lists_setIndex" id="EPncO1ZSKM0GR}xHrLU?">
                                                             <mutation at="false"></mutation>
                                                             <field name="MODE">SET</field>
                                                             <field name="WHERE">FIRST</field>
                                                             <value name="LIST">
                                                               <block type="variables_get" id="?P8zcdfBWzH:JBDB36^h">
                                                                 <field name="VAR" id="qfe9Z~ER#OqM6W:#XNPA">myelements</field>
                                                               </block>
                                                             </value>
                                                             <value name="TO">
                                                               <block type="get_value" id="!uDqnNcz7umCT#c(bEPw">
                                                                 <field name="ATTR">val</field>
                                                                 <field name="OID">alias.0.Allgemein.Aussentemperatur.Temperatur</field>
                                                               </block>
                                                             </value>
                                                             <next>
                                                               <block type="comment" id="-5o?K3gd7_qjzU1@p{;_">
                                                                 <field name="COMMENT">hier regenmenge</field>
                                                                 <next>
                                                                   <block type="lists_setIndex" id="cC9}6pMUg/`Ofv=GxTov">
                                                                     <mutation at="true"></mutation>
                                                                     <field name="MODE">SET</field>
                                                                     <field name="WHERE">FROM_START</field>
                                                                     <value name="LIST">
                                                                       <block type="variables_get" id="gr(tl+z,NF.olWoU4O0S">
                                                                         <field name="VAR" id="qfe9Z~ER#OqM6W:#XNPA">myelements</field>
                                                                       </block>
                                                                     </value>
                                                                     <value name="AT">
                                                                       <block type="math_number" id="|R*~h}O|FNH.e%}fNts)">
                                                                         <field name="NUM">2</field>
                                                                       </block>
                                                                     </value>
                                                                     <value name="TO">
                                                                       <block type="get_value" id=",*5q!H2utY4)79KGUR:}">
                                                                         <field name="ATTR">val</field>
                                                                         <field name="OID">alias.0.Allgemein.Aussentemperatur.Temperatur</field>
                                                                       </block>
                                                                     </value>
                                                                     <next>
                                                                       <block type="lists_setIndex" id="Vt;^A^D*1%NZ^e~5gw4Q">
                                                                         <mutation at="true"></mutation>
                                                                         <field name="MODE">SET</field>
                                                                         <field name="WHERE">FROM_START</field>
                                                                         <value name="LIST">
                                                                           <block type="variables_get" id="eryWh%1HnpP{@OZvGec0">
                                                                             <field name="VAR" id="qfe9Z~ER#OqM6W:#XNPA">myelements</field>
                                                                           </block>
                                                                         </value>
                                                                         <value name="AT">
                                                                           <block type="math_number" id="No_;:#-*p+9nYqG?Zj;t">
                                                                             <field name="NUM">3</field>
                                                                           </block>
                                                                         </value>
                                                                         <value name="TO">
                                                                           <block type="convert_from_date" id="=|NbxGgGFQy7tq?0NY$F">
                                                                             <mutation xmlns="http://www.w3.org/1999/xhtml" format="true" language="false"></mutation>
                                                                             <field name="OPTION">custom</field>
                                                                             <field name="FORMAT">SS:mm</field>
                                                                             <value name="VALUE">
                                                                               <block type="time_get" id="YTD*#AIq.~oDuT5~AH?l">
                                                                                 <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                                                 <field name="OPTION">object</field>
                                                                               </block>
                                                                             </value>
                                                                           </block>
                                                                         </value>
                                                                         <next>
                                                                           <block type="lists_setIndex" id="BTRs}i/8)gq^ExM9fZ_v">
                                                                             <mutation at="false"></mutation>
                                                                             <field name="MODE">INSERT</field>
                                                                             <field name="WHERE">LAST</field>
                                                                             <value name="LIST">
                                                                               <block type="variables_get" id="(D_h@!8)+8pMJrIk$EP|">
                                                                                 <field name="VAR" id="!skB|F1]Z.Z9l`H9EbTC">myarr</field>
                                                                               </block>
                                                                             </value>
                                                                             <value name="TO">
                                                                               <block type="variables_get" id="b)f8m*`cP$Oa1R8[ke+E">
                                                                                 <field name="VAR" id="qfe9Z~ER#OqM6W:#XNPA">myelements</field>
                                                                               </block>
                                                                             </value>
                                                                             <next>
                                                                               <block type="control" id="K^0u-hA}~$%b]uT9+/kk">
                                                                                 <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                 <field name="OID">0_userdata.0.wetterdaten.myArr</field>
                                                                                 <field name="WITH_DELAY">FALSE</field>
                                                                                 <value name="VALUE">
                                                                                   <block type="variables_get" id="P=dA{F@vZsf`M;]vBsK_">
                                                                                     <field name="VAR" id="!skB|F1]Z.Z9l`H9EbTC">myarr</field>
                                                                                   </block>
                                                                                 </value>
                                                                               </block>
                                                                             </next>
                                                                           </block>
                                                                         </next>
                                                                       </block>
                                                                     </next>
                                                                   </block>
                                                                 </next>
                                                               </block>
                                                             </next>
                                                           </block>
                                                         </next>
                                                       </block>
                                                     </next>
                                                   </block>
                                                 </next>
                                               </block>
                                             </next>
                                           </block>
                                         </statement>
                                         <next>
                                           <block type="schedule" id="Y)HhRwdj^xzfpcR:Mu~m">
                                             <field name="SCHEDULE">0,20,40 * * * *</field>
                                             <statement name="STATEMENT">
                                               <block type="comment" id="4Y$Pmcq}hZa)UPLrL?ZH">
                                                 <field name="COMMENT">zeigt tagesdaten an</field>
                                                 <next>
                                                   <block type="timeouts_settimeout" id="^``d8TmgLH1s(5M`bW/7">
                                                     <field name="NAME">timeout</field>
                                                     <field name="DELAY">6</field>
                                                     <field name="UNIT">sec</field>
                                                     <statement name="STATEMENT">
                                                       <block type="variables_set" id="O0QJI_Yd^J+6h2u(86%}">
                                                         <field name="VAR" id="K?ma?fv!bxf0zpe.ik*^">myarr2</field>
                                                         <value name="VALUE">
                                                           <block type="get_value" id="`JOs68k58vLqh$EsEr*{">
                                                             <field name="ATTR">val</field>
                                                             <field name="OID">0_userdata.0.wetterdaten.myArr</field>
                                                           </block>
                                                         </value>
                                                         <next>
                                                           <block type="controls_if" id="1roM!S3,;A0Fz2)7c#%q">
                                                             <mutation else="1"></mutation>
                                                             <value name="IF0">
                                                               <block type="logic_operation" id="s=eYZ*8[;w@xNm#Hs:B`" inline="false">
                                                                 <field name="OP">OR</field>
                                                                 <value name="A">
                                                                   <block type="logic_compare" id=")P%O+www0o}/eN#%ydo-">
                                                                     <field name="OP">EQ</field>
                                                                     <value name="A">
                                                                       <block type="get_value" id="1)u17aP.U|2[9;Qv/#Jl">
                                                                         <field name="ATTR">val</field>
                                                                         <field name="OID">0_userdata.0.wetterdaten.myjson</field>
                                                                       </block>
                                                                     </value>
                                                                     <value name="B">
                                                                       <block type="logic_null" id="?%zXy57d^/xlke,!ik-}"></block>
                                                                     </value>
                                                                   </block>
                                                                 </value>
                                                                 <value name="B">
                                                                   <block type="logic_compare" id="c~wq1g9`wGeE*0~Y}{e3">
                                                                     <field name="OP">EQ</field>
                                                                     <value name="A">
                                                                       <block type="get_value" id="EA)j2{e|O/l.+.M63w,V">
                                                                         <field name="ATTR">val</field>
                                                                         <field name="OID">0_userdata.0.wetterdaten.myjson</field>
                                                                       </block>
                                                                     </value>
                                                                     <value name="B">
                                                                       <block type="text" id="/2?`df24lw8IgA^yYmAi">
                                                                         <field name="TEXT"></field>
                                                                       </block>
                                                                     </value>
                                                                   </block>
                                                                 </value>
                                                               </block>
                                                             </value>
                                                             <statement name="DO0">
                                                               <block type="debug" id="SY$#.xeOIzKPdHc$76Ew" disabled="true">
                                                                 <field name="Severity">log</field>
                                                                 <value name="TEXT">
                                                                   <shadow type="text" id="t6q{V@`Y^Cx1u.qd^j)i">
                                                                     <field name="TEXT">test</field>
                                                                   </shadow>
                                                                   <block type="text" id="W_Z)bP,A:V+lMjomQw(M">
                                                                     <field name="TEXT">is null</field>
                                                                   </block>
                                                                 </value>
                                                                 <next>
                                                                   <block type="variables_set" id="!IQc}l9;{#IkEPi#a{)$">
                                                                     <field name="VAR" id=",}TAmTg~SD)$AiH(yF-d">myjson</field>
                                                                     <value name="VALUE">
                                                                       <block type="lists_create_with" id=".KRm4To1AoALX}_S=A@[">
                                                                         <mutation items="0"></mutation>
                                                                       </block>
                                                                     </value>
                                                                   </block>
                                                                 </next>
                                                               </block>
                                                             </statement>
                                                             <statement name="ELSE">
                                                               <block type="variables_set" id="p{eUH`FC3Zx~AB!aJy5]">
                                                                 <field name="VAR" id=",}TAmTg~SD)$AiH(yF-d">myjson</field>
                                                                 <value name="VALUE">
                                                                   <block type="convert_json2object" id="_7I5/pZdY:D_{55+cHTT">
                                                                     <value name="VALUE">
                                                                       <block type="get_value" id="fK`6Jx!VRm@!;4SC~/1s">
                                                                         <field name="ATTR">val</field>
                                                                         <field name="OID">0_userdata.0.wetterdaten.myjson</field>
                                                                       </block>
                                                                     </value>
                                                                   </block>
                                                                 </value>
                                                               </block>
                                                             </statement>
                                                             <next>
                                                               <block type="control" id="n4.m}Zo@taPB8WOA^Rj(">
                                                                 <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                 <field name="OID">0_userdata.0.wetterdaten.myjson</field>
                                                                 <field name="WITH_DELAY">FALSE</field>
                                                                 <value name="VALUE">
                                                                   <block type="procedures_callcustomreturn" id=".:AGH_ry0p5v2r)qLz8r">
                                                                     <mutation name="erzeuge_json">
                                                                       <arg name="x"></arg>
                                                                       <arg name="y"></arg>
                                                                     </mutation>
                                                                     <value name="ARG0">
                                                                       <block type="variables_get" id="uWP,.`^=2fO,,1jqwL6f">
                                                                         <field name="VAR" id=",}TAmTg~SD)$AiH(yF-d">myjson</field>
                                                                       </block>
                                                                     </value>
                                                                     <value name="ARG1">
                                                                       <block type="variables_get" id="qMF5|!JdVK|F70k2Dn+G">
                                                                         <field name="VAR" id="K?ma?fv!bxf0zpe.ik*^">myarr2</field>
                                                                       </block>
                                                                     </value>
                                                                   </block>
                                                                 </value>
                                                               </block>
                                                             </next>
                                                           </block>
                                                         </next>
                                                       </block>
                                                     </statement>
                                                   </block>
                                                 </next>
                                               </block>
                                             </statement>
                                             <next>
                                               <block type="schedule" id="B`_CE(7m4B0Ee+ZCw6e(">
                                                 <field name="SCHEDULE">59 23 * * *</field>
                                                 <statement name="STATEMENT">
                                                   <block type="comment" id="l?kDG)4$T%z/+tS,LppT">
                                                     <field name="COMMENT">reset tagesdaten</field>
                                                     <next>
                                                       <block type="comment" id="~%Z*RRSNTjfg]93}84CR">
                                                         <field name="COMMENT">js-func  verhindert doppelt datum</field>
                                                         <next>
                                                           <block type="variables_set" id="IMDiAZR(f[bSbng5l0Dd">
                                                             <field name="VAR" id="K?ma?fv!bxf0zpe.ik*^">myarr2</field>
                                                             <value name="VALUE">
                                                               <block type="lists_create_with" id="QgW*)m6atjp^0}X#_Av=">
                                                                 <mutation items="0"></mutation>
                                                               </block>
                                                             </value>
                                                             <next>
                                                               <block type="control" id="]3MTM4Xl-nrG.EMb)8s{">
                                                                 <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                 <field name="OID">0_userdata.0.wetterdaten.myArr</field>
                                                                 <field name="WITH_DELAY">FALSE</field>
                                                                 <value name="VALUE">
                                                                   <block type="variables_get" id="^Pk)h|*XCDU]_|~A,BV3">
                                                                     <field name="VAR" id="K?ma?fv!bxf0zpe.ik*^">myarr2</field>
                                                                   </block>
                                                                 </value>
                                                                 <next>
                                                                   <block type="comment" id="fpFH48B)V$Q?buCw?-q.">
                                                                     <field name="COMMENT">sende to mysql</field>
                                                                     <next>
                                                                       <block type="controls_if" id="PxvQ?Tr{KOu+_|_Z[*DC">
                                                                         <value name="IF0">
                                                                           <block type="variables_get" id="Lo7]Yxd@{~(iUQ^Ji5+{">
                                                                             <field name="VAR" id="NnxetBELY~t%0JkoZu9N">willSQL</field>
                                                                           </block>
                                                                         </value>
                                                                         <statement name="DO0">
                                                                           <block type="sendto_custom" id="E#sn`xYd^6k?vV3AR}8*">
                                                                             <mutation xmlns="http://www.w3.org/1999/xhtml" items="" with_statement="false"></mutation>
                                                                             <field name="INSTANCE">sql.0</field>
                                                                             <field name="COMMAND">query</field>
                                                                             <field name="LOG">log</field>
                                                                             <field name="WITH_STATEMENT">FALSE</field>
                                                                             <value name="ARG0">
                                                                               <shadow type="text" id="_w?Ow5Je,Ed?|w||HD0S">
                                                                                 <field name="TEXT">UPDATE collection.coll SET aufgabe3 = "ohne" WHERE name = "acer"</field>
                                                                               </shadow>
                                                                               <block type="variables_get" id="ZKxmi]scn@fSb#AJ(8;w">
                                                                                 <field name="VAR" id="d3]Hk8WL;7ucLDX6HO8%">sqltext</field>
                                                                               </block>
                                                                             </value>
                                                                           </block>
                                                                         </statement>
                                                                       </block>
                                                                     </next>
                                                                   </block>
                                                                 </next>
                                                               </block>
                                                             </next>
                                                           </block>
                                                         </next>
                                                       </block>
                                                     </next>
                                                   </block>
                                                 </statement>
                                               </block>
                                             </next>
                                           </block>
                                         </next>
                                       </block>
                                     </next>
                                   </block>
                                 </next>
                               </block>
                             </next>
                           </block>
                         </next>
                       </block>
                       <block type="procedures_defcustomreturn" id="=%|y`3l-p6J[7ttM0,t[" x="862" y="388">
                         <mutation statements="false">
                           <arg name="x" varid="!qI%V7A*sBp50O4*@ouS"></arg>
                           <arg name="y" varid="8oq-+SkTYWw:o+`Y*h?~"></arg>
                         </mutation>
                         <field name="NAME">erzeuge_json</field>
                         <field name="SCRIPT">DQoNCmxldCB0ZW1waGlnaD1OdW1iZXIoeVswXVswXSk7DQpsZXQgdGVtcGxvdz1OdW1iZXIoeVswXVswXSk7DQpsZXQgZGF0ZTE7IGxldCBkYXRlMjsNCngucmV2ZXJzZSgpOw0KZm9yKGxldCBpPTA7IGk8eS5sZW5ndGg7aSsrKXsgDQoNCmlmIChOdW1iZXIoeVtpXVswXSk+PXRlbXBoaWdoKSB7dGVtcGhpZ2g9TnVtYmVyKHlbaV1bMF0pO2RhdGUxPXlbaV1bMl07IC8qbG9nKCJoaWdoOiAiK2RhdGUxK3RlbXBoaWdoKSovfSBlbHNle2lmIChpPT0wKSB7dGVtcGhpZ2g9TnVtYmVyKHlbaV1bMF0pO2RhdGUxPXlbaV1bMl19fQ0KaWYgKE51bWJlcih5W2ldWzBdKTw9dGVtcGxvdykgIHt0ZW1wbG93PU51bWJlcih5W2ldWzBdKTtkYXRlMj15W2ldWzJdOy8qbG9nKCJsb3c6ICIrZGF0ZTIrdGVtcGxvdykqL30gIGVsc2V7aWYgKGk9PTApIHt0ZW1wbG93PU51bWJlcih5W2ldWzBdKTtkYXRlMj15W2ldWzJdfX0NCiAgICAgDQp9DQovL2zDtnNjaHQgemVpbGUsIHdlbm4gZ2xlaWNoZXMgZGF0dW0NCmlmKGZvcm1hdERhdGUoZ2V0RGF0ZU9iamVjdCgobmV3IERhdGUoKS5nZXRUaW1lKCkpKSwgIlRULk1NLkpKSkoiKSA9PSB4W3gubGVuZ3RoLTFdLkRBVFVNICkge3guc3BsaWNlKHgubGVuZ3RoLTEpfQ0KDQoNCngucHVzaCh7DQogICAgIkRBVFVNIjogZm9ybWF0RGF0ZShnZXREYXRlT2JqZWN0KChuZXcgRGF0ZSgpLmdldFRpbWUoKSkpLCAiVFQuTU0uSkpKSiIpLA0KICAgICJaZWl0SG9jaCI6IGRhdGUxLA0KICAgICJUZW1wSGlnaCI6dGVtcGhpZ2gsDQogICAgIlplaXRUaWVmIjpkYXRlMiwNCiAgICAiVGVtcExvdyI6dGVtcGxvdw0KICAgIA0KfSkNCnNxbHRleHQ9YElOU0VSVCBJTlRPIHdldHRlcl9hdWZ6ZWljaG51bmcud2V0dGVyKERBVFVNLFplaXRIb2NoLFRlbXBIaWdoLFplaXRUaWVmLFRlbXBMb3cpIFZBTFVFU2ArDQogICAgICAgIGAgKCIke2Zvcm1hdERhdGUoZ2V0RGF0ZU9iamVjdCgobmV3IERhdGUoKS5nZXRUaW1lKCkpKSwgIlRULk1NLkpKSkoiKX0iLCIke2RhdGUxfSIsJHt0ZW1waGlnaH0sIiR7ZGF0ZTJ9Iiwke3RlbXBsb3d9ICkgYA0KDQppZih4Lmxlbmd0aD53aWV2aWVsVGFnZWluVklTKSB4LnNwbGljZSgwLDEpIA0KICAgICAgICANCnJldHVybiBKU09OLnN0cmluZ2lmeSh4LnJldmVyc2UoKSk7</field>
                         <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
                       </block>
                      </xml>
                      

                      mcBirne 1 Reply Last reply Reply Quote 0
                      • mcBirne
                        mcBirne @liv-in-sky last edited by

                        @liv-in-sky
                        Danke für das Skript.
                        Aber so ganz klappt es noch nicht. Ich habe die MinTemp und die MaxTemp und die Regenmenge. Diese muss ich nun "nur" noch in die DB schreiben. An der Stelle komme ich leider mit dem Skript nicht weiter. Ich muss:

                        1. Alle Werte in ein Array schreiben?
                        2. Die Werte in ein json schrieben?
                        3. Die Werte in die DB schreiben?

                        Kann ich die Werte nicht direkt in die DB schreiben? Ich habe mir die einzelnen Werte in Datenpunkten gemerkt. Diese werden automatisch aktualisiert. Eigentlich muss ich sie nur in die DB schreiben. also sowas wie:
                        sqltext=INSERT INTO wetter_aufzeichnung.wetter(DATUM,TempHigh,TempLow,Regenmenge) VALUES+
                        ("${formatDate(getDateObject((new Date().getTime())), "TT.MM.JJJJ")}","${date1}",${temphigh},"${date2}",${templow} )
                        Aber wo gebe ich da die Datenpunkte an?

                        Sorry für die für dich simplen Fragen, aber ich steige da noch nicht durch.

                        mcBirne 1 Reply Last reply Reply Quote 0
                        • mcBirne
                          mcBirne @mcBirne last edited by

                          Ich denke da an sowas...
                          4626c0e9-0ff7-4a80-960c-ba0882e203fd-image.png

                          Nur leider kommen in der DB keine Daten an...

                          liv-in-sky 1 Reply Last reply Reply Quote 0
                          • liv-in-sky
                            liv-in-sky @mcBirne last edited by

                            @mcbirne

                            bin nicht am rechner - aber im script wird doch in eine sql db geschrieben - das passiert ja nur einmal um 23:59

                            soweit ich mich erinnere:

                            • es gibt einen täglichen eintrag mit den daten in eine sql-tabelle - um mitternacht
                            • es gibt eine json tabelle zum direkten ansehen in einer vis-
                            • um datenpunkte habe ich mich nciht gekümmert - ich weiß nichtmal, was da drin stehen soll entweder ist es der gesamt-wert von gestern oder der immer wieder aktualisierte wert unterm tag

                            kann erst morgen nochmal nachsehen.

                            das blockly mit dem sql ist doch schon drin - man muss halt eine tabelle anlegen. wie der sql-query heißt, ist in dem js-functions-blocky drin
                            beschreibe bitte nochmal genau, was du wann haben willst - damit ich morgen das nochmal überprüfen kann

                            1 Reply Last reply Reply Quote 0
                            • mcBirne
                              mcBirne last edited by mcBirne

                              @liv-in-sky
                              OK, dann brauche ich die json Tabelle nicht, da ich es nicht darstellen möchte. Ich möchte die Werte nur in die DB schreiben.
                              Es ist ein SQL Befehl in Java drin. Ich wollte aber die Werte aus Datenpunkten nehmen, um sie in die DB zu schreiben. Dazu muss ich den SQL Befehl ändern, aber ich weiß nicht so recht wie...
                              Ich möchte die Werte gerne hier eintragen:
                              aa138335-b120-405e-840d-70f2fa854b6a-image.png Also in die DB iobroker.Wetter(Datum, Durchschnittstemp,...)

                              mcBirne 1 Reply Last reply Reply Quote 0
                              • mcBirne
                                mcBirne @mcBirne last edited by

                                Ich bin einen Schritt weiter. Ich kann jetzt Werte an die DB übergeben, allerdings wird das Datum nicht angezeigt. Ich denke es liegt am Format. Was mache ich falsch?
                                579a7c39-2b4c-45fc-b167-2e7b5a9c04ea-image.png
                                Das kommt in die DB:
                                e6d1ba33-1a0d-4b17-9874-362a3927ee33-image.png

                                Anstelle von Jahr und Monat und Tag kommen nur 0. Ich habe die Datumsspalte in der Datenbank als Date formatiert.

                                liv-in-sky 1 Reply Last reply Reply Quote 0
                                • liv-in-sky
                                  liv-in-sky @mcBirne last edited by liv-in-sky

                                  @mcbirne

                                  versuche es mal mit text im Datumsfeld

                                  oder : ich glaube man kann sowas auch automatisch generieren lassen - evtl hilft google weiter - also wenn du einen eintrag in die datenbank machst, dass dann autom ein datum generiert wird - das datumsfeld als text ist eigentlich keine gute lösung, dass werd ich auch bei mir ändern

                                  so stellt man z.b. den automatischen timestamp - der wird gesetzt, wenn ein eintrag in die sql-db erzeugt wird - danach kann man dann besser suchen - man muss nur noch en eigentlichen wert in die db geben

                                  Image 1.png

                                  wenn ich das datum selbst eingeben möchte, geht es bei mir damit (der letzte wert - DatumSQL):

                                  INSERT INTO wetter_aufzeichnung.wetter(DATUM,ZeitHoch,TempHigh,ZeitTief,TempLow,DurchschnittTemp,linux_ts,DatumSQL) VALUES ("07.04.2021","14:38",5.2,"14:42",3.5,4.3,"1617800869469","2021-04-07")
                                  

                                  Image 9.png

                                  evtl musst du noch anführungszeichen einfügen

                                  nicht getestet:

                                  Image 10.png

                                  mcBirne 1 Reply Last reply Reply Quote 0
                                  • mcBirne
                                    mcBirne @liv-in-sky last edited by

                                    @liv-in-sky super, die Hochkommata sind die Lösung. Danke!

                                    1 Reply Last reply Reply Quote 0
                                    • First post
                                      Last post

                                    Support us

                                    ioBroker
                                    Community Adapters
                                    Donate

                                    504
                                    Online

                                    32.0k
                                    Users

                                    80.5k
                                    Topics

                                    1.3m
                                    Posts

                                    3
                                    26
                                    987
                                    Loading More Posts
                                    • Oldest to Newest
                                    • Newest to Oldest
                                    • Most Votes
                                    Reply
                                    • Reply as topic
                                    Log in to reply
                                    Community
                                    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                    The ioBroker Community 2014-2023
                                    logo