Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Blockly Abfrage auf InfluxDB Version 1

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Blockly Abfrage auf InfluxDB Version 1

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

      Stehe grad auf dem Schlauch und bräuchte kurz Hilfe.
      Ich frage eine InfluxDB V1.8 ab und bekomme ein String als Result zurück - mir fehlt jetzt der Schritt den Wert "last" auszulesen.
      Was mache ich falsch?

      Teil des Blockly:
      Blockly-json.png

      Variable "result" kommt korrekt aus der Influx DB
      Variable "preis" ist undefined

      im Log:
      15:30:00.099 info javascript.0 (247) script.js.Java-Instanz0.InfluxDB-V1: {'result':[[{'last':633,'ts':1691587772173}]],'ts':1691587800066,'error':null}
      15:30:00.099 info javascript.0 (247) script.js.Java-Instanz0.InfluxDB-V1: undefined

      DJMarc75 paul53 mickym 3 Replies Last reply Reply Quote 0
      • DJMarc75
        DJMarc75 @ps1304 last edited by

        @ps1304 sagte in Blockly Abfrage auf InfluxDB Version 1:

        {'result':[[{'last':633,'ts':1691587772173}]],'ts':1691587800066,'error':null}

        Schön wäre es das ganze Blockly zu sehen 😉

        P 1 Reply Last reply Reply Quote 0
        • P
          ps1304 @DJMarc75 last edited by

          @djmarc75 klaro als Bild und/oder als Code?
          bacdb3c3-d82d-45d1-b6e2-3fa8b30ee31a-image.png

          1 Reply Last reply Reply Quote 0
          • paul53
            paul53 @ps1304 last edited by

            @ps1304 sagte: im Log:

            Es sind geschachtelte Arrays enthalten.

            Blockly_temp.JPG

            1 Reply Last reply Reply Quote 1
            • mickym
              mickym Most Active @ps1304 last edited by

              @ps1304 sagte in Blockly Abfrage auf InfluxDB Version 1:

              {'result':[[{'last':633,'ts':1691587772173}]],'ts':1691587800066,'error':null}

              def4d945-88c1-4af4-a68f-5cf2f018b7d5-image.png

              Das ist ein doppeltes Array

              P 2 Replies Last reply Reply Quote 1
              • P
                ps1304 @mickym last edited by

                @mickym DANKE ! das war jetzt wirklich einfach.

                1 Reply Last reply Reply Quote 0
                • P
                  ps1304 @mickym last edited by ps1304

                  @mickym falls jemand das braucht - die variablen kannn man ja anpassen - das funktionierende Blockly als Spoiler:

                  <xml xmlns="https://developers.google.com/blockly/xml">
                   <variables>
                     <variable id=":)VLwK/`@H+J(LM#$WD7">flux</variable>
                     <variable id="Hap*,T)oNQNM[M8bZeb7">result</variable>
                     <variable id=".5z}V1WTXA6xD^rmM@W4">preis</variable>
                     <variable id="19e+]})FfXk}~`Wj.4bM">htmlString</variable>
                   </variables>
                   <block type="schedule" id="n=UEN2;yjIT1`l#FdcV_" x="-1787" y="-987">
                     <field name="SCHEDULE">* * * * *</field>
                     <statement name="STATEMENT">
                       <block type="variables_set" id="x45T#QqEweP.8DbaXVqx">
                         <field name="VAR" id=":)VLwK/`@H+J(LM#$WD7">flux</field>
                         <value name="VALUE">
                           <block type="text_join" id="o9Vd,Q~U,{!3is[fPCf.">
                             <mutation items="7"></mutation>
                             <value name="ADD0">
                               <block type="text" id="?I]TaO6_Vbp6gDEIQkdm">
                                 <field name="TEXT">SELECT last("value") FROM "e3dc-rscp.0.EMS.POWER_HOME" WHERE time &gt;= now() - 2d and time &lt;= now()</field>
                               </block>
                             </value>
                           </block>
                         </value>
                         <next>
                           <block type="sendto_custom" id="5y7]CToD:3Ygw}FhT%(D">
                             <mutation xmlns="http://www.w3.org/1999/xhtml" items="" with_statement="true"></mutation>
                             <field name="INSTANCE">influxdb.0</field>
                             <field name="COMMAND">query</field>
                             <field name="LOG"></field>
                             <field name="WITH_STATEMENT">TRUE</field>
                             <value name="ARG0">
                               <shadow type="text" id="NNx0rHt6*yq21~HguTF2">
                                 <field name="TEXT">from(bucket: "ioBroker") |&gt; range(start: -14d, stop: now()) |&gt; filter(fn: (r) =&gt; r["_measurement"] == "DP_Guenstigste") |&gt; filter(fn: (r) =&gt; r["_field"] == "value") |&gt; filter(fn: (r) =&gt; r._value &gt; 0) |&gt; group() |&gt; min()</field>
                               </shadow>
                               <block type="variables_get" id="B}$z9o?iyz%Y*wBKcvDF">
                                 <field name="VAR" id=":)VLwK/`@H+J(LM#$WD7">flux</field>
                               </block>
                             </value>
                             <statement name="STATEMENT">
                               <block type="controls_if" id="@q#iNuUr!:m7zob|9%)u">
                                 <mutation else="1"></mutation>
                                 <value name="IF0">
                                   <block type="logic_compare" id="|vlsW/V*`9wqY9BOp$Cx">
                                     <field name="OP">NEQ</field>
                                     <value name="A">
                                       <block type="get_attr" id="^9J$l,fj?KhQ@qUB:Nas">
                                         <value name="PATH">
                                           <shadow type="text" id="~z[BTi$mMMYZ+GcomoOq">
                                             <field name="TEXT">error</field>
                                           </shadow>
                                         </value>
                                         <value name="OBJECT">
                                           <block type="variables_get" id="N@T;SzLIsoETGcO$H+ri">
                                             <field name="VAR" id="Hap*,T)oNQNM[M8bZeb7">result</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                     <value name="B">
                                       <block type="logic_null" id="+U3-sX~0PE)=BKfCuo7O"></block>
                                     </value>
                                   </block>
                                 </value>
                                 <statement name="DO0">
                                   <block type="debug" id="LCT~%[BmemUbm?b4]W6U" inline="true">
                                     <field name="Severity">error</field>
                                     <value name="TEXT">
                                       <shadow type="text" id="mDRzWYEa1NzHsf1:2u16">
                                         <field name="TEXT">test</field>
                                       </shadow>
                                       <block type="get_attr" id="8G61*~d~XGk2qY$ng{D4">
                                         <value name="PATH">
                                           <shadow type="text" id="45h$8w}|$sRP,uLQ(70%">
                                             <field name="TEXT">error</field>
                                           </shadow>
                                         </value>
                                         <value name="OBJECT">
                                           <block type="variables_get" id="LIT!%WT~ykvRmkF=1Gc9">
                                             <field name="VAR" id="Hap*,T)oNQNM[M8bZeb7">result</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                   </block>
                                 </statement>
                                 <statement name="ELSE">
                                   <block type="debug" id="*{3T#Du4w~:TroJZ6?7o">
                                     <field name="Severity">log</field>
                                     <value name="TEXT">
                                       <shadow type="text" id="rKJ^P{TxN(jKoW}ETA*l">
                                         <field name="TEXT">test</field>
                                       </shadow>
                                       <block type="variables_get" id="k{fzf,[:pu[Qah[M:FAf">
                                         <field name="VAR" id="Hap*,T)oNQNM[M8bZeb7">result</field>
                                       </block>
                                     </value>
                                     <next>
                                       <block type="variables_set" id="DD6;G(Wo]rIFaI+6.8:?">
                                         <field name="VAR" id=".5z}V1WTXA6xD^rmM@W4">preis</field>
                                         <value name="VALUE">
                                           <block type="convert_tostring" id="MQ|=t3[21rC.~l3cFZea">
                                             <value name="VALUE">
                                               <block type="get_attr" id="n36f=MeXwJ3Yc1kOE1/$">
                                                 <value name="PATH">
                                                   <shadow type="text" id="(b0I9y0aoY#dd84CK7KS">
                                                     <field name="TEXT">result.0.0.last</field>
                                                   </shadow>
                                                 </value>
                                                 <value name="OBJECT">
                                                   <block type="convert_object2json" id="ERm+qpC!vRo1]{;r$+$(">
                                                     <field name="PRETTIFY">TRUE</field>
                                                     <value name="VALUE">
                                                       <block type="variables_get" id="+6+4;B%#/G*bG`j}yEgo">
                                                         <field name="VAR" id="Hap*,T)oNQNM[M8bZeb7">result</field>
                                                       </block>
                                                     </value>
                                                   </block>
                                                 </value>
                                               </block>
                                             </value>
                                           </block>
                                         </value>
                                         <next>
                                           <block type="debug" id="Dk~te}`/A.7SOl~GxbHb">
                                             <field name="Severity">log</field>
                                             <value name="TEXT">
                                               <shadow type="text">
                                                 <field name="TEXT">test</field>
                                               </shadow>
                                               <block type="variables_get" id="qVv+RA+qJOw4*h)Yt_m5">
                                                 <field name="VAR" id=".5z}V1WTXA6xD^rmM@W4">preis</field>
                                               </block>
                                             </value>
                                             <next>
                                               <block type="comment" id="KoZ]ZSByDTlWb4^s_)xQ">
                                                 <field name="COMMENT">Kommentar</field>
                                                 <next>
                                                   <block type="debug" id="-M)_Dgrsw.+.x@5y1*()" inline="true" disabled="true">
                                                     <field name="Severity">log</field>
                                                     <value name="TEXT">
                                                       <shadow type="text">
                                                         <field name="TEXT">test</field>
                                                       </shadow>
                                                       <block type="variables_get" id="e--Fk%lR(K!5Z96CC{uu">
                                                         <field name="VAR" id=".5z}V1WTXA6xD^rmM@W4">preis</field>
                                                       </block>
                                                     </value>
                                                     <next>
                                                       <block type="controls_if" id="iuLo^lOy^Qg)/#[A*q(L">
                                                         <mutation else="1"></mutation>
                                                         <value name="IF0">
                                                           <block type="logic_compare" id="U.wOefdDK@:;kt3`^MmY">
                                                             <field name="OP">NEQ</field>
                                                             <value name="A">
                                                               <block type="text_length" id="-~ACns1F5u7EF=f(qfVs">
                                                                 <value name="VALUE">
                                                                   <shadow type="text" id=":xhtsG,UW?hdA9r~/IJ+">
                                                                     <field name="TEXT">abc</field>
                                                                   </shadow>
                                                                   <block type="variables_get" id="[wde$^9G?veK#O[!#aK3">
                                                                     <field name="VAR" id=".5z}V1WTXA6xD^rmM@W4">preis</field>
                                                                   </block>
                                                                 </value>
                                                               </block>
                                                             </value>
                                                             <value name="B">
                                                               <block type="math_number" id="O};wwWf9LLIWspXZ_ZG.">
                                                                 <field name="NUM">0</field>
                                                               </block>
                                                             </value>
                                                           </block>
                                                         </value>
                                                         <statement name="DO0">
                                                           <block type="variables_set" id="vd3MOaB/E.B.%`GT+Fw%">
                                                             <field name="VAR" id="19e+]})FfXk}~`Wj.4bM">htmlString</field>
                                                             <value name="VALUE">
                                                               <block type="text_join" id="BNP,)B,LyiB6@@zuP`MQ">
                                                                 <mutation items="5"></mutation>
                                                                 <value name="ADD0">
                                                                   <block type="math_rndfixed" id="`7)CQyf3rs|:wgv(?zkQ">
                                                                     <field name="n">2</field>
                                                                     <value name="x">
                                                                       <shadow type="math_number" id="aD68X9^3_V]EXP2,k~um">
                                                                         <field name="NUM">3.1234</field>
                                                                       </shadow>
                                                                       <block type="variables_get" id="pdHSe%(ol_jZx6frXiWv">
                                                                         <field name="VAR" id=".5z}V1WTXA6xD^rmM@W4">preis</field>
                                                                       </block>
                                                                     </value>
                                                                   </block>
                                                                 </value>
                                                               </block>
                                                             </value>
                                                             <next>
                                                               <block type="update" id="}!6!8(47NX^9;U6C_G#a">
                                                                 <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                 <field name="OID">0_userdata.0.Test.V1</field>
                                                                 <field name="WITH_DELAY">FALSE</field>
                                                                 <value name="VALUE">
                                                                   <block type="variables_get" id="%ge_Q6+64-Xvb0u@}{Mb">
                                                                     <field name="VAR" id="19e+]})FfXk}~`Wj.4bM">htmlString</field>
                                                                   </block>
                                                                 </value>
                                                                 <next>
                                                                   <block type="debug" id="+Po4LYz|l3-bP_*!uMLD" inline="true" disabled="true">
                                                                     <field name="Severity">log</field>
                                                                     <value name="TEXT">
                                                                       <shadow type="text" id="upBA@|x/?+tqJ;{2_X^+">
                                                                         <field name="TEXT">test</field>
                                                                       </shadow>
                                                                       <block type="variables_get" id="@Nvf(injXf$Yw_H/!rZO">
                                                                         <field name="VAR" id="19e+]})FfXk}~`Wj.4bM">htmlString</field>
                                                                       </block>
                                                                     </value>
                                                                     <next>
                                                                       <block type="debug" id="PA/=R6e@4[]/tuW5m,I3" inline="true">
                                                                         <field name="Severity">log</field>
                                                                         <value name="TEXT">
                                                                           <shadow type="text" id="[54tEV#3P+y$ZwK{^|g~">
                                                                             <field name="TEXT">V1 aktualisiert</field>
                                                                           </shadow>
                                                                         </value>
                                                                       </block>
                                                                     </next>
                                                                   </block>
                                                                 </next>
                                                               </block>
                                                             </next>
                                                           </block>
                                                         </statement>
                                                         <statement name="ELSE">
                                                           <block type="debug" id="eG[!NGV)c1@lXqO0RRaA" inline="true">
                                                             <field name="Severity">warn</field>
                                                             <value name="TEXT">
                                                               <shadow type="text" id="e;9g?#xrOkVdJvU?OQWj">
                                                                 <field name="TEXT">length of the price string does not fit</field>
                                                               </shadow>
                                                             </value>
                                                           </block>
                                                         </statement>
                                                       </block>
                                                     </next>
                                                   </block>
                                                 </next>
                                               </block>
                                             </next>
                                           </block>
                                         </next>
                                       </block>
                                     </next>
                                   </block>
                                 </statement>
                               </block>
                             </statement>
                           </block>
                         </next>
                       </block>
                     </statement>
                   </block>
                  </xml>
                  

                  DJMarc75 1 Reply Last reply Reply Quote 0
                  • DJMarc75
                    DJMarc75 @ps1304 last edited by

                    @ps1304 sagte in Blockly Abfrage auf InfluxDB Version 1:

                    Blockly als Spoiler

                    Im Spoiler das Blockly bitte in Codetags setzen

                    P 1 Reply Last reply Reply Quote 0
                    • P
                      ps1304 @DJMarc75 last edited by

                      @djmarc75 erledigt

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

                      Support us

                      ioBroker
                      Community Adapters
                      Donate

                      833
                      Online

                      32.0k
                      Users

                      80.4k
                      Topics

                      1.3m
                      Posts

                      4
                      9
                      256
                      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