Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Abstände zwischen mehreren Events berechnen (Blockly)

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Abstände zwischen mehreren Events berechnen (Blockly)

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

      Ich melde mich mal wieder zurück. Leider funktioniert das Skript trotz timeouts immer noch nicht wie gewünscht. Die Datenpunkte werden viel zu oft aktualisiert und das Skript scheint oft parallel zu laufen und damit falsche Abstände zu berechnen.
      Ich versuche noch mal grob zu beschreiben was das Ziel ist.
      Es sollen die letzten zwei zeitlichen Abstände zwischen zwei Brennerstarts meiner Heizung berechnet werden. Dazu möchte ich die Variable VitoStartBrenner nutzen. Hintergrund ist das hochfrequentierte ein und ausschalten der Heizung in der Übergangszeit, was ich hiermit detektieren möchte.
      Hier ist mein aktueller Code. Ich würde mich freuen wenn jemand mal drüber gucken kann. Ich vermute es benötigt einen neuen Ansatz.


      <xml xmlns="https://developers.google.com/blockly/xml">
      <variables>
      <variable type="timeout" id="timeout15">timeout15</variable>
      <variable id="5t9p1Dxw,$Hk*h.$xcg">Zeitstempel3_lokal</variable> <variable type="timeout" id="timeout16">timeout16</variable> <variable id="w5DgCBDMyFCt5c(S./|!">Zeitstempel2_lokal</variable> <variable type="timeout" id="timeout17">timeout17</variable> <variable id="Vy[aoB}!u@F)cFH@mb/0">Zeitstempel1_lokal</variable> <variable type="timeout" id="timeout18">timeout18</variable> <variable id="d2Hca]CPU+D32h3H=BU">Abstand1_lokal</variable>
      <variable type="timeout" id="timeout19">timeout19</variable>
      <variable id="1AoS_%+:!c@4+#30Vfwe">Abstand2_lokal</variable>
      <variable type="interval" id="Intervall2">Intervall2</variable>
      <variable type="timeout" id="timeout20">timeout20</variable>
      </variables>
      <block type="on_ext" id="![=JFmD0UB1vtF~|Di^" x="238" y="590"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="}.GxRXPD[M2S[cQVqH;+"> <field name="oid">viessmann.0.get.VitoStartsBrenner</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="7HlOlU2L}V*ajD$g[2?V"> <value name="IF0"> <block type="logic_compare" id="G[M;=~wX%eR1y6S3Bp0?"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="?nU*vx5UEcW,h10-9:LQ"> <field name="ATTR">val</field> <field name="OID">viessmann.0.get.VitoStatusWW</field> </block> </value> <value name="B"> <block type="math_number" id="(N5s_A;npDPuOB,KLj{H"> <field name="NUM">0</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_settimeout" id="QdNR{j4j-R|H12tkS]OT"> <field name="NAME">timeout15</field> <field name="DELAY">100</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="O(fNI_zEqWveou,ZN^S">
      <field name="VAR" id="5t9p1Dxw,$Hk*h.$xcg">Zeitstempel3_lokal</field> <value name="VALUE"> <block type="variables_get" id="(b_hqSV{U5i_JX^Zla-4"> <field name="VAR" id="w5DgCBDMyFCt5c(S./|!">Zeitstempel2_lokal</field> </block> </value> <next> <block type="debug" id="gH1.Ho}BG1NW6xTLp(b|"> <field name="Severity">log</field> <value name="TEXT"> <shadow xmlns="http://www.w3.org/1999/xhtml" type="text"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="if?k_%lLCm:VJ@T[SEoi"> <mutation items="3"></mutation> <value name="ADD0"> <block type="text" id="-L9#zCqB8#w_FI!aQ.%h"> <field name="TEXT">Zeitstempel zwei Brennerstarts zuvor: </field> </block> </value> <value name="ADD1"> <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number"> <field name="NUM">3.1</field> </shadow> <block type="variables_get" id=".vg#,tfOEKE^JYZ(::^P"> <field name="VAR" id="5t9p1Dxw,$Hkh.$xcg">Zeitstempel3_lokal</field>
      </block>
      </value>
      <value name="ADD2">
      <block type="text" id="R^BmzC3tn..VobsbUSoo">
      <field name="TEXT"> min</field>
      </block>
      </value>
      </block>
      </value>
      </block>
      </next>
      </block>
      </statement>
      <next>
      <block type="timeouts_settimeout" id="wx9CQ}h?Isym3TFg0JxW">
      <field name="NAME">timeout16</field>
      <field name="DELAY">200</field>
      <field name="UNIT">ms</field>
      <statement name="STATEMENT">
      <block type="variables_set" id="w$Xp5d@5XB?oV60OUMr">
      <field name="VAR" id="w5DgCBDMyFCt5c(S./|!">Zeitstempel2_lokal</field>
      <value name="VALUE">
      <block type="variables_get" id="[c%eKeX4yJ^c7CWHieYd">
      <field name="VAR" id="Vy[aoB}!u@F)cFH@mb/0">Zeitstempel1_lokal</field>
      </block>
      </value>
      <next>
      <block type="debug" id="[|V]B|Bi
      FmNvu4M[B9.">
      <field name="Severity">log</field>
      <value name="TEXT">
      <shadow xmlns="http://www.w3.org/1999/xhtml" type="text">
      <field name="TEXT"></field>
      </shadow>
      <block type="text_join" id="$22k$xMtESSD/LU)=AZZ">
      <mutation items="3"></mutation>
      <value name="ADD0">
      <block type="text" id="L
      %35_O}uiiD(o}#X~[]">
      <field name="TEXT">Zeitstempel ein Brennerstart zuvor: </field>
      </block>
      </value>
      <value name="ADD1">
      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
      <field name="NUM">3.1</field>
      </shadow>
      <block type="variables_get" id="{%rh+kvn8#XPRw[@6$7g">
      <field name="VAR" id="w5DgCBDMyFCt5c(S./|!">Zeitstempel2_lokal</field>
      </block>
      </value>
      <value name="ADD2">
      <block type="text" id="-c!e^_OC3uti3Ko(p}?@">
      <field name="TEXT"> min</field>
      </block>
      </value>
      </block>
      </value>
      <next>
      <block type="variables_set" id=")bLkU2c+ueuaq5e+I{j7">
      <field name="VAR" id="Vy[aoB}!u@F)cFH@mb/0">Zeitstempel1_lokal</field>
      <value name="VALUE">
      <block type="math_round" id="e53+s-ZEMM0EwsdO4{Rb">
      <field name="OP">ROUND</field>
      <value name="NUM">
      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
      <field name="NUM">3.1</field>
      </shadow>
      <block type="math_arithmetic" id="!.u3jkS$OIwzWQJq|kov">
      <field name="OP">DIVIDE</field>
      <value name="A">
      <shadow type="math_number">
      <field name="NUM">1</field>
      </shadow>
      <block type="on_source" id="b.)@eGLDxg7:Xe,VA%U"> <field name="ATTR">state.ts</field> </block> </value> <value name="B"> <shadow type="math_number" id="C{Z/CKfe{}Q?hNk4(5N%"> <field name="NUM">60000</field> </shadow> </value> </block> </value> </block> </value> </block> </next> </block> </next> </block> </statement> <next> <block type="timeouts_settimeout" id="0CEr(SwQ{Ji::6d?s;;B"> <field name="NAME">timeout17</field> <field name="DELAY">300</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="debug" id="o0{OCKkLv6{UsKkehy07"> <field name="Severity">log</field> <value name="TEXT"> <shadow xmlns="http://www.w3.org/1999/xhtml" type="text"> <field name="TEXT">test</field> </shadow> <block type="text_join" id=";/@_22:yltE*a:p@!oyQ"> <mutation items="3"></mutation> <value name="ADD0"> <block type="text" id="5S3cg[pD;U6z?Pj58Z*b"> <field name="TEXT">Zeitstempel aktueller Brennerstart: </field> </block> </value> <value name="ADD1"> <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number"> <field name="NUM">3.1</field> </shadow> <block type="variables_get" id="L_t$@ycd}zlzRdVge!Ef"> <field name="VAR" id="Vy[aoB}!u@F)cFH@mb/0">Zeitstempel1_lokal</field> </block> </value> <value name="ADD2"> <block type="text" id="3S([iSuZQ*|SNNVTL%9#"> <field name="TEXT"> min</field> </block> </value> </block> </value> </block> </statement> <next> <block type="timeouts_settimeout" id="H%e.Sqgt.LImej1XhtnC"> <field name="NAME">timeout18</field> <field name="DELAY">400</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="%w%$W4E43g~3pBjrk._N"> <field name="VAR" id="d2Hca]CPU+D32h3H=BU">Abstand1_lokal</field>
      <value name="VALUE">
      <block type="math_arithmetic" id="X2aeV2^Ca5#uQMVqcel*">
      <field name="OP">MINUS</field>
      <value name="A">
      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
      <field name="NUM">1</field>
      </shadow>
      <block type="variables_get" id="(#newn(BEI/@40^1zc1"> <field name="VAR" id="Vy[aoB}!u@F)cFH@mb/0">Zeitstempel1_lokal</field> </block> </value> <value name="B"> <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="KmfKkHIdaBaeoy(3ZL-Y"> <field name="VAR" id="w5DgCBDMyFCt5c(S./|!">Zeitstempel2_lokal</field> </block> </value> </block> </value> <next> <block type="comment" id="~7,f2lw,J5XprZ0Md0ER"> <field name="COMMENT">Abstand Taktung1= Zeitstempel1-Zeitstempel2 [min]</field> <next> <block type="debug" id="yi(c@6v_DkPZ9{_]%GC!"> <field name="Severity">log</field> <value name="TEXT"> <shadow xmlns="http://www.w3.org/1999/xhtml" type="text"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="h1[^^d(P0hOZOV_^U%2+"> <mutation items="3"></mutation> <value name="ADD0"> <block type="text" id="%]1#|L|1Tbg||xJwxJu!"> <field name="TEXT">Abstand zwischen aktuellem und vorherigem Brennerstart : </field> </block> </value> <value name="ADD1"> <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number"> <field name="NUM">3.1</field> </shadow> <block type="variables_get" id="(|v|)S@V/WIPUR|=Q5">
      <field name="VAR" id="d2Hca]CPU+D32h3H=BU">Abstand1_lokal</field> </block> </value> <value name="ADD2"> <block type="text" id="8ZCHZIuGMTRzt:H#+uJ("> <field name="TEXT"> min</field> </block> </value> </block> </value> </block> </next> </block> </next> </block> </statement> <next> <block type="timeouts_settimeout" id="CB-yH~p=l|H3fmSQW05">
      <field name="NAME">timeout19</field>
      <field name="DELAY">500</field>
      <field name="UNIT">ms</field>
      <statement name="STATEMENT">
      <block type="variables_set" id="hGibDc2pcK;=j%pkU|u"> <field name="VAR" id="1AoS_%+:!c@4+#30Vfwe">Abstand2_lokal</field> <value name="VALUE"> <block type="math_arithmetic" id="Y=idd}Jln}3b6N,}XY4l"> <field name="OP">MINUS</field> <value name="A"> <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="CUXYMOXfgP=I^rQ@Oy=)"> <field name="VAR" id="w5DgCBDMyFCt5c(S./|!">Zeitstempel2_lokal</field> </block> </value> <value name="B"> <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="Gl74d0I6,][(*kFsyJp7"> <field name="VAR" id="5t9p1Dxw,$Hkh.$xcg">Zeitstempel3_lokal</field>
      </block>
      </value>
      </block>
      </value>
      <next>
      <block type="comment" id="yQ9Q]DPHi?wlf~
      |K6eI">
      <field name="COMMENT">Abstand Taktung1= Zeitstempel2-Zeitstempel3 [min]</field>
      <next>
      <block type="debug" id="[KFi4^XRnD_Av[y7@Q#?">
      <field name="Severity">log</field>
      <value name="TEXT">
      <shadow xmlns="http://www.w3.org/1999/xhtml" type="text">
      <field name="TEXT">test</field>
      </shadow>
      <block type="text_join" id="/.Hd{st}N})FEtilr%[D">
      <mutation items="3"></mutation>
      <value name="ADD0">
      <block type="text" id="q:E~v$3N_l@}$PhJ)T)"> <field name="TEXT">Abstand zwischen vorletztem und letztem Brennerstart: </field> </block> </value> <value name="ADD1"> <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number"> <field name="NUM">3.1</field> </shadow> <block type="variables_get" id="c8he;m0JdL20:E1zfg^-"> <field name="VAR" id="1AoS_%+:!c@4+#30Vfwe">Abstand2_lokal</field> </block> </value> <value name="ADD2"> <block type="text" id="vIQ/}}mVYl+Cc.5Kb3,">
      <field name="TEXT"> min</field>
      </block>
      </value>
      </block>
      </value>
      </block>
      </next>
      </block>
      </next>
      </block>
      </statement>
      <next>
      <block type="timeouts_setinterval" id="d@w4smoXSX|cT-^r=nm">
      <field name="NAME">Intervall2</field>
      <field name="INTERVAL">1000</field>
      <field name="UNIT">ms</field>
      <statement name="STATEMENT">
      <block type="update" id="Vh.:?h3Jd!esppCzt%$6">
      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
      <field name="OID">0_userdata.0.Heizung.Brenner.Zeitstempel1</field>
      <field name="WITH_DELAY">FALSE</field>
      <value name="VALUE">
      <block type="convert_tonumber" id="]K!|.b:;aSn97}+ldyi">
      <value name="VALUE">
      <block type="variables_get" id="NV@m(N8u4a-{4}Bis}t"> <field name="VAR" id="Vy[aoB}!u@F)cFH@mb/0">Zeitstempel1_lokal</field> </block> </value> </block> </value> <next> <block type="update" id="XL3OaIU70vtxf-{8DQM["> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Heizung.Brenner.Zeitstempel2</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="convert_tonumber" id="ITr?dx~[9O[9QHy:d%!3"> <value name="VALUE"> <block type="variables_get" id="L}y%i5W!kN(n=YitCNpR"> <field name="VAR" id="w5DgCBDMyFCt5c(S./|!">Zeitstempel2_lokal</field> </block> </value> </block> </value> <next> <block type="update" id="Pu(Mps4x2=o:$**;E|q">
      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
      <field name="OID">0_userdata.0.Heizung.Brenner.Zeitstempel3</field>
      <field name="WITH_DELAY">FALSE</field>
      <value name="VALUE">
      <block type="convert_tonumber" id="gN73k(Tb#]KdN1B$~!--">
      <value name="VALUE">
      <block type="variables_get" id="
      /OiCXrIRGKF9dNcli~$">
      <field name="VAR" id="5t9p1Dxw,$Hk*h.$xcg">Zeitstempel3_lokal</field> </block> </value> </block> </value> <next> <block type="update" id="n=?%O(J[1Fe%Ho*{JtRH"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Heizung.Brenner.Abstand1</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="convert_tonumber" id="y{$0O;HLt4/^3@tXpJjN"> <value name="VALUE"> <block type="variables_get" id="+m:rmF]T]6))|8kQ,a@n"> <field name="VAR" id="d2Hca]CPU+D32h3H=BU">Abstand1_lokal</field>
      </block>
      </value>
      </block>
      </value>
      <next>
      <block type="update" id="O]NWDtF}q#BE,Bu8yJw">
      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
      <field name="OID">0_userdata.0.Heizung.Brenner.Abstand2</field>
      <field name="WITH_DELAY">FALSE</field>
      <value name="VALUE">
      <block type="convert_tonumber" id="Vn/s5r1w@9+3$F-SbR3R">
      <value name="VALUE">
      <block type="variables_get" id="#|JujysL|6{4JtG@?QtQ">
      <field name="VAR" id="1AoS
      %+:!c@4+#30Vfwe">Abstand2_lokal</field>
      </block>
      </value>
      </block>
      </value>
      </block>
      </next>
      </block>
      </next>
      </block>
      </next>
      </block>
      </next>
      </block>
      </statement>
      <next>
      <block type="timeouts_settimeout" id="{t96;LdE4o2pEe;t@xr"> <field name="NAME">timeout20</field> <field name="DELAY">1200</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="controls_if" id="(1el,P[!}V:|+:k;/D~">
      <value name="IF0">
      <block type="logic_operation" id="S}:%U%6@1wK9+}(RxcB"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="lgN$TXl)@u{?)7WrAg.@"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="3LG[owD|:-zt.0htp!=">
      <field name="ATTR">val</field>
      <field name="OID">0_userdata.0.Heizung.Brenner.Takten_erkannt</field>
      </block>
      </value>
      <value name="B">
      <block type="logic_boolean" id="+KvB([iRAJTu
      L54:a~">
      <field name="BOOL">FALSE</field>
      </block>
      </value>
      </block>
      </value>
      <value name="B">
      <block type="logic_operation" id=".A~AYpPpJR{7(C$m,L)s">
      <field name="OP">AND</field>
      <value name="A">
      <block type="logic_compare" id="#^ln{:;.G08c=t/JoG]L">
      <field name="OP">LT</field>
      <value name="A">
      <block type="variables_get" id="7)W^0IK8#5RPyc}+u^)w">
      <field name="VAR" id="d2Hca]CPU+D32h3H=BU">Abstand1_lokal</field> </block> </value> <value name="B"> <block type="math_number" id="_ZJ1n]SVr~t[YIOI#$7">
      <field name="NUM">18</field>
      </block>
      </value>
      </block>
      </value>
      <value name="B">
      <block type="logic_compare" id="8_YS%}iwNq$ZOQ,,%HX
      ">
      <field name="OP">LT</field>
      <value name="A">
      <block type="variables_get" id="LS^))4j+qlx%fsa}8FZH">
      <field name="VAR" id="1AoS
      %+:!c@4+#30Vfwe">Abstand2_lokal</field>
      </block>
      </value>
      <value name="B">
      <block type="math_number" id="4V-Y)n!^$Y:BcNvhhJ:z">
      <field name="NUM">18</field>
      </block>
      </value>
      </block>
      </value>
      </block>
      </value>
      </block>
      </value>
      <statement name="DO0">
      <block type="update" id="hHx+C:gYwPHn50nNcH)v">
      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
      <field name="OID">0_userdata.0.Heizung.Brenner.Takten_erkannt</field>
      <field name="WITH_DELAY">FALSE</field>
      <value name="VALUE">
      <block type="logic_boolean" id="H#5BJfNcPi)4$y9Vh;;B">
      <field name="BOOL">TRUE</field>
      </block>
      </value>
      <next>
      <block type="comment" id="Q/_c9^D[CM@lPne9]gCz">
      <field name="COMMENT">falls Abstand 1 und 2 < 10min, dann Brennertakten erkannt = 1</field>
      <next>
      <block type="debug" id="lue$qzaw!v0.eqfZ/{=}">
      <field name="Severity">log</field>
      <value name="TEXT">
      <shadow type="text" id="D_cek6$LX(]TK54Ga-i8">
      <field name="TEXT">Brennertakten erkannt </field>
      </shadow>
      </value>
      </block>
      </next>
      </block>
      </next>
      </block>
      </statement>
      </block>
      </statement>
      </block>
      </next>
      </block>
      </next>
      </block>
      </next>
      </block>
      </next>
      </block>
      </next>
      </block>
      </next>
      </block>
      </statement>
      </block>
      </statement>
      </block>
      </xml>

      rantanplan Asgothian 2 Replies Last reply Reply Quote 0
      • rantanplan
        rantanplan @passuff last edited by

        @passuff Kann Dein Script leider nicht importieren.
        Nach Deiner Beschreibung vermute ich mal, dass Du die timeouts mehrmals startest ohne sie vorher zu beenden.

        Grüße

        1 Reply Last reply Reply Quote 0
        • Asgothian
          Asgothian Developer @passuff last edited by Asgothian

          @passuff sagte in Abstände zwischen mehreren Events berechnen (Blockly):

          Hier ist mein aktueller Code. Ich würde mich freuen wenn jemand mal drüber gucken kann. Ich vermute es benötigt einen neuen Ansatz.

          Herzlichen Glückwunsch - der Code ist unlesbar. Es fehlen die

          Code Tags
          

          Ich hab mehrmals versucht den Code zu importieren. Geht nicht.

          Eine Frage habe ich aber trotzdem: Wofür brauchst du bei der Fragestellung Timeouts ?

          Du hast im Trigger mit dem Baustein
          Screenshot 2020-11-09 at 10.22.08.png

          Zugriff auf:

          • den Timestamp der aktuellen Änderung
          • den Timestamp der letzten Änderung
          • den aktuellen Wert
          • den letzten Wert

          Damit solltest du direkt im Trigger die von Dir gewünschten Dinge berechnen können ohne das Du timeouts benutzt.

          A.

          Nachtrag: Ich würde das so lösen:

          • Annahme: Datenpunkt = true heisst Brenner ist an.

          • Variable "LetztesMalEingeschaltet" = 0

          • Trigger auf Wert ist grösser als vorher

          • Einschaltabstand = "LetztesMalEingeschaltet - Timestamp aktuelle Änderung.

          • "LetztesMalEingeschaltet" = Timestamp aktuelle Änderung

          ggf. musst du den Timestamp noch konvertieren, glaube ich aber nicht, so wie ich das erinnere liefert der ms, relativ zu einem Ursprungsdatum

          A.

          P 1 Reply Last reply Reply Quote 0
          • P
            passuff @Asgothian last edited by

            @Asgothian
            Vielen Dank für deine Tipps.
            Ich habe die Blöcke exportiert. Ich habe es gerade nochmal getestet und kann diese auch wieder importieren. Ich weiß nicht weshalb es bei dir nicht funktioniert.
            Dein Ansatz den Abstand zu berechnen gefällt mir, das klingt etwas einfacher als bei mir. Der erste Abstand ist aber m.E. nicht das Problem, sondern der zweite. Ich vermute bei mir den Fehler beim "umschichten" der Abstände (neuer Abstand = alter Abstand ) und dem typischen JS Problem, dass Befehle nicht nacheinander abgearbeitet werden. Daher nutze ich Timeouts. Ohne diese Timeouts funktioniert das Skript überhaupt nicht.

            Asgothian paul53 2 Replies Last reply Reply Quote 0
            • Asgothian
              Asgothian Developer @passuff last edited by

              @passuff bist du sicher das du das aus dem post noch einmal heraus kopiert hast ? ich hab das noch mehrmals probiert und bekomme immer xml parser errors.

              poste doch mal einen Screenshot vom Script, dann können wir sehen wie das Script aussieht.

              A.

              P 1 Reply Last reply Reply Quote 0
              • P
                passuff @Asgothian last edited by

                @Asgothian
                gerade nochmal versucht - funktioniert einwandfrei.
                Das Skript ist sehr lange. Dann müsste ich viele Screenshots erstellen - das wird sehr unübersichtlich.
                Wie exportierst/importierst du skripte? In der Blockly oder in der JS Ansicht?

                Asgothian 2 Replies Last reply Reply Quote 0
                • Asgothian
                  Asgothian Developer @passuff last edited by

                  @passuff In der Blockly Ansicht

                  Asgothian 1 Reply Last reply Reply Quote 0
                  • Asgothian
                    Asgothian Developer @Asgothian last edited by

                    @Asgothian Nachfrage: hast du irgendwie Telegramm oder Alexa Blöcke im Skript ? Beide Adapter laufen bei mir nicht, deswegen fehlen die Blöcke auch

                    P 1 Reply Last reply Reply Quote 0
                    • Asgothian
                      Asgothian Developer @passuff last edited by

                      @passuff Pass doch bitte deinen Post mit dem XML so an das der XML in Code tags gesetzt ist, dann kann ich nochmal versuchen das zu importieren.

                      A.

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

                        @passuff sagte:

                        dass Befehle nicht nacheinander abgearbeitet werden. Daher nutze ich Timeouts. Ohne diese Timeouts funktioniert das Skript überhaupt nicht.

                        Timeouts sind nicht erforderlich, wenn folgendes Prinzip angewendet wird:

                        Blockly_temp.JPG

                        letzte Änderung findet man unter "Trigger" und es enthält den aktuellen Startzeitpunkt.

                        1 Reply Last reply Reply Quote 0
                        • P
                          passuff @Asgothian last edited by

                          @Asgothian sagte in Abstände zwischen mehreren Events berechnen (Blockly):

                          @Asgothian Nachfrage: hast du irgendwie Telegramm oder Alexa Blöcke im Skript ? Beide Adapter laufen bei mir nicht, deswegen fehlen die Blöcke auch

                          Nein, weder Alexa noch Telegram.

                          @passuff Pass doch bitte deinen Post mit dem XML so an das der XML in Code tags gesetzt ist, dann kann ich nochmal versuchen das zu importieren.

                          <xml xmlns="https://developers.google.com/blockly/xml">
                            <variables>
                              <variable type="timeout" id="timeout15">timeout15</variable>
                              <variable id="5t9p`1Dxw,$Hk*h.$xcg">Zeitstempel3_lokal</variable>
                              <variable type="timeout" id="timeout16">timeout16</variable>
                              <variable id="w5DgCBDMyFCt5c(S./|!">Zeitstempel2_lokal</variable>
                              <variable type="timeout" id="timeout17">timeout17</variable>
                              <variable id="Vy[aoB}!u@F)cFH@mb/0">Zeitstempel1_lokal</variable>
                              <variable type="timeout" id="timeout18">timeout18</variable>
                              <variable id="d2Hca]CPU+D32`h3H=BU">Abstand1_lokal</variable>
                              <variable type="timeout" id="timeout19">timeout19</variable>
                              <variable id="1AoS_%+:!c@4+#30Vfwe">Abstand2_lokal</variable>
                              <variable type="interval" id="Intervall2">Intervall2</variable>
                              <variable type="timeout" id="timeout20">timeout20</variable>
                            </variables>
                            <block type="on_ext" id="![=JFmD0UB1vtF~|D`i^" x="238" y="590">
                              <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
                              <field name="CONDITION">ne</field>
                              <field name="ACK_CONDITION"></field>
                              <value name="OID0">
                                <shadow type="field_oid" id="}.GxRXPD[M2S[cQVqH;+">
                                  <field name="oid">viessmann.0.get.VitoStartsBrenner</field>
                                </shadow>
                              </value>
                              <statement name="STATEMENT">
                                <block type="controls_if" id="7HlOlU2L}V*ajD$g[2?V">
                                  <value name="IF0">
                                    <block type="logic_compare" id="G[M;=~wX%eR1y6S3Bp0?">
                                      <field name="OP">EQ</field>
                                      <value name="A">
                                        <block type="get_value" id="?nU*vx5UEcW,h10-9:LQ">
                                          <field name="ATTR">val</field>
                                          <field name="OID">viessmann.0.get.VitoStatusWW</field>
                                        </block>
                                      </value>
                                      <value name="B">
                                        <block type="math_number" id="(N5s_A;npDPuOB,KLj{H">
                                          <field name="NUM">0</field>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                  <statement name="DO0">
                                    <block type="timeouts_settimeout" id="QdNR{j4j-R|H12tkS]OT">
                                      <field name="NAME">timeout15</field>
                                      <field name="DELAY">100</field>
                                      <field name="UNIT">ms</field>
                                      <statement name="STATEMENT">
                                        <block type="variables_set" id="O(fNI_zEq`Wveou,ZN^S">
                                          <field name="VAR" id="5t9p`1Dxw,$Hk*h.$xcg">Zeitstempel3_lokal</field>
                                          <value name="VALUE">
                                            <block type="variables_get" id="(b_hqSV{U5i_JX^Zla-4">
                                              <field name="VAR" id="w5DgCBDMyFCt5c(S./|!">Zeitstempel2_lokal</field>
                                            </block>
                                          </value>
                                          <next>
                                            <block type="debug" id="gH1.Ho}BG1NW6xTLp(b|">
                                              <field name="Severity">log</field>
                                              <value name="TEXT">
                                                <shadow xmlns="http://www.w3.org/1999/xhtml" type="text">
                                                  <field name="TEXT">test</field>
                                                </shadow>
                                                <block type="text_join" id="if?k_%lLCm:VJ@T[SEoi">
                                                  <mutation items="3"></mutation>
                                                  <value name="ADD0">
                                                    <block type="text" id="-L9#zCqB8#w_FI!aQ.%h">
                                                      <field name="TEXT">Zeitstempel zwei Brennerstarts zuvor:  </field>
                                                    </block>
                                                  </value>
                                                  <value name="ADD1">
                                                    <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
                                                      <field name="NUM">3.1</field>
                                                    </shadow>
                                                    <block type="variables_get" id=".vg#,tfOEKE^JYZ(::^P">
                                                      <field name="VAR" id="5t9p`1Dxw,$Hk*h.$xcg">Zeitstempel3_lokal</field>
                                                    </block>
                                                  </value>
                                                  <value name="ADD2">
                                                    <block type="text" id="R^BmzC3tn..VobsbUSoo">
                                                      <field name="TEXT"> min</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                            </block>
                                          </next>
                                        </block>
                                      </statement>
                                      <next>
                                        <block type="timeouts_settimeout" id="wx9CQ}h?Isym3TFg0JxW">
                                          <field name="NAME">timeout16</field>
                                          <field name="DELAY">200</field>
                                          <field name="UNIT">ms</field>
                                          <statement name="STATEMENT">
                                            <block type="variables_set" id="w$Xp5d@5XB?*oV60OUMr">
                                              <field name="VAR" id="w5DgCBDMyFCt5c(S./|!">Zeitstempel2_lokal</field>
                                              <value name="VALUE">
                                                <block type="variables_get" id="[c%eKeX4yJ^c7CWHieYd">
                                                  <field name="VAR" id="Vy[aoB}!u@F)cFH@mb/0">Zeitstempel1_lokal</field>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="debug" id="[|V]B|Bi*FmNvu4M[B9.">
                                                  <field name="Severity">log</field>
                                                  <value name="TEXT">
                                                    <shadow xmlns="http://www.w3.org/1999/xhtml" type="text">
                                                      <field name="TEXT"></field>
                                                    </shadow>
                                                    <block type="text_join" id="$22k$xMtESSD/LU)=AZZ">
                                                      <mutation items="3"></mutation>
                                                      <value name="ADD0">
                                                        <block type="text" id="L*%35_O}uiiD(o}#X~[]">
                                                          <field name="TEXT">Zeitstempel ein Brennerstart zuvor:  </field>
                                                        </block>
                                                      </value>
                                                      <value name="ADD1">
                                                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
                                                          <field name="NUM">3.1</field>
                                                        </shadow>
                                                        <block type="variables_get" id="{%rh+kvn8#XPRw[@6$7g">
                                                          <field name="VAR" id="w5DgCBDMyFCt5c(S./|!">Zeitstempel2_lokal</field>
                                                        </block>
                                                      </value>
                                                      <value name="ADD2">
                                                        <block type="text" id="-c!e^_OC3uti3Ko(p}?@">
                                                          <field name="TEXT"> min</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="variables_set" id=")bLkU2c+ueuaq5e+I{j7">
                                                      <field name="VAR" id="Vy[aoB}!u@F)cFH@mb/0">Zeitstempel1_lokal</field>
                                                      <value name="VALUE">
                                                        <block type="math_round" id="e53+s-ZEMM0EwsdO4{Rb">
                                                          <field name="OP">ROUND</field>
                                                          <value name="NUM">
                                                            <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
                                                              <field name="NUM">3.1</field>
                                                            </shadow>
                                                            <block type="math_arithmetic" id="!.u3jkS$OIwzWQJq|kov">
                                                              <field name="OP">DIVIDE</field>
                                                              <value name="A">
                                                                <shadow type="math_number">
                                                                  <field name="NUM">1</field>
                                                                </shadow>
                                                                <block type="on_source" id="b.)@eG`LDxg7:Xe,VA%U">
                                                                  <field name="ATTR">state.ts</field>
                                                                </block>
                                                              </value>
                                                              <value name="B">
                                                                <shadow type="math_number" id="C{Z/CKfe{}Q?hNk4(5N%">
                                                                  <field name="NUM">60000</field>
                                                                </shadow>
                                                              </value>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </statement>
                                          <next>
                                            <block type="timeouts_settimeout" id="0CEr(SwQ{Ji::6d?s;;B">
                                              <field name="NAME">timeout17</field>
                                              <field name="DELAY">300</field>
                                              <field name="UNIT">ms</field>
                                              <statement name="STATEMENT">
                                                <block type="debug" id="o0{OCKkLv6{UsKkehy07">
                                                  <field name="Severity">log</field>
                                                  <value name="TEXT">
                                                    <shadow xmlns="http://www.w3.org/1999/xhtml" type="text">
                                                      <field name="TEXT">test</field>
                                                    </shadow>
                                                    <block type="text_join" id=";/@_22:yltE*a:p@!oyQ">
                                                      <mutation items="3"></mutation>
                                                      <value name="ADD0">
                                                        <block type="text" id="5S3cg[pD;U6z?Pj58Z*b">
                                                          <field name="TEXT">Zeitstempel aktueller Brennerstart:  </field>
                                                        </block>
                                                      </value>
                                                      <value name="ADD1">
                                                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
                                                          <field name="NUM">3.1</field>
                                                        </shadow>
                                                        <block type="variables_get" id="L_t$@ycd}zlzRdVge!Ef">
                                                          <field name="VAR" id="Vy[aoB}!u@F)cFH@mb/0">Zeitstempel1_lokal</field>
                                                        </block>
                                                      </value>
                                                      <value name="ADD2">
                                                        <block type="text" id="3S([iSuZQ*|SNNVTL%9#">
                                                          <field name="TEXT"> min</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                </block>
                                              </statement>
                                              <next>
                                                <block type="timeouts_settimeout" id="H%e.Sqgt.LImej1XhtnC">
                                                  <field name="NAME">timeout18</field>
                                                  <field name="DELAY">400</field>
                                                  <field name="UNIT">ms</field>
                                                  <statement name="STATEMENT">
                                                    <block type="variables_set" id="%w%$W4E43g~3pBjrk._N">
                                                      <field name="VAR" id="d2Hca]CPU+D32`h3H=BU">Abstand1_lokal</field>
                                                      <value name="VALUE">
                                                        <block type="math_arithmetic" id="X2aeV2^Ca5#uQMVqcel*">
                                                          <field name="OP">MINUS</field>
                                                          <value name="A">
                                                            <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
                                                              <field name="NUM">1</field>
                                                            </shadow>
                                                            <block type="variables_get" id="(#newn(BEI/@40^1`zc1">
                                                              <field name="VAR" id="Vy[aoB}!u@F)cFH@mb/0">Zeitstempel1_lokal</field>
                                                            </block>
                                                          </value>
                                                          <value name="B">
                                                            <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
                                                              <field name="NUM">1</field>
                                                            </shadow>
                                                            <block type="variables_get" id="KmfKkHIdaBaeoy(3ZL-Y">
                                                              <field name="VAR" id="w5DgCBDMyFCt5c(S./|!">Zeitstempel2_lokal</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="comment" id="~7,f2lw,J5XprZ0Md0ER">
                                                          <field name="COMMENT">Abstand Taktung1= Zeitstempel1-Zeitstempel2 [min]</field>
                                                          <next>
                                                            <block type="debug" id="yi(c@6v_DkPZ9{_]%GC!">
                                                              <field name="Severity">log</field>
                                                              <value name="TEXT">
                                                                <shadow xmlns="http://www.w3.org/1999/xhtml" type="text">
                                                                  <field name="TEXT">test</field>
                                                                </shadow>
                                                                <block type="text_join" id="h1[^^d(P0hOZOV_^U%2+">
                                                                  <mutation items="3"></mutation>
                                                                  <value name="ADD0">
                                                                    <block type="text" id="%]1#|L|1Tbg||xJwxJu!">
                                                                      <field name="TEXT">Abstand zwischen aktuellem und vorherigem Brennerstart :  </field>
                                                                    </block>
                                                                  </value>
                                                                  <value name="ADD1">
                                                                    <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
                                                                      <field name="NUM">3.1</field>
                                                                    </shadow>
                                                                    <block type="variables_get" id="(|v|)S@`_V/WIPUR|=Q5">
                                                                      <field name="VAR" id="d2Hca]CPU+D32`h3H=BU">Abstand1_lokal</field>
                                                                    </block>
                                                                  </value>
                                                                  <value name="ADD2">
                                                                    <block type="text" id="8ZCHZIuGMTRzt:H#+uJ(">
                                                                      <field name="TEXT"> min</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </statement>
                                                  <next>
                                                    <block type="timeouts_settimeout" id="CB-yH~p=l|`H3fmSQW05">
                                                      <field name="NAME">timeout19</field>
                                                      <field name="DELAY">500</field>
                                                      <field name="UNIT">ms</field>
                                                      <statement name="STATEMENT">
                                                        <block type="variables_set" id="hGibDc2pcK;=j%p`kU|u">
                                                          <field name="VAR" id="1AoS_%+:!c@4+#30Vfwe">Abstand2_lokal</field>
                                                          <value name="VALUE">
                                                            <block type="math_arithmetic" id="Y=idd}Jln}3b6N,}XY4l">
                                                              <field name="OP">MINUS</field>
                                                              <value name="A">
                                                                <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
                                                                  <field name="NUM">1</field>
                                                                </shadow>
                                                                <block type="variables_get" id="CUXYMOXfgP=I^rQ@Oy=)">
                                                                  <field name="VAR" id="w5DgCBDMyFCt5c(S./|!">Zeitstempel2_lokal</field>
                                                                </block>
                                                              </value>
                                                              <value name="B">
                                                                <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
                                                                  <field name="NUM">1</field>
                                                                </shadow>
                                                                <block type="variables_get" id="Gl74d0I6,][(*kFsyJp7">
                                                                  <field name="VAR" id="5t9p`1Dxw,$Hk*h.$xcg">Zeitstempel3_lokal</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                          <next>
                                                            <block type="comment" id="yQ9Q]DPHi?wlf~*|K6eI">
                                                              <field name="COMMENT">Abstand Taktung1= Zeitstempel2-Zeitstempel3 [min]</field>
                                                              <next>
                                                                <block type="debug" id="[KFi4^XRnD_Av[y7@Q#?">
                                                                  <field name="Severity">log</field>
                                                                  <value name="TEXT">
                                                                    <shadow xmlns="http://www.w3.org/1999/xhtml" type="text">
                                                                      <field name="TEXT">test</field>
                                                                    </shadow>
                                                                    <block type="text_join" id="/.Hd{st}N})FEtilr%[D">
                                                                      <mutation items="3"></mutation>
                                                                      <value name="ADD0">
                                                                        <block type="text" id="q:E~v$3N_l@}$PhJ)T)`">
                                                                          <field name="TEXT">Abstand zwischen vorletztem und letztem  Brennerstart:  </field>
                                                                        </block>
                                                                      </value>
                                                                      <value name="ADD1">
                                                                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
                                                                          <field name="NUM">3.1</field>
                                                                        </shadow>
                                                                        <block type="variables_get" id="c8he;m0JdL20:E1zfg^-">
                                                                          <field name="VAR" id="1AoS_%+:!c@4+#30Vfwe">Abstand2_lokal</field>
                                                                        </block>
                                                                      </value>
                                                                      <value name="ADD2">
                                                                        <block type="text" id="vIQ/}}mVY`l+Cc.5Kb3,">
                                                                          <field name="TEXT"> min</field>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </statement>
                                                      <next>
                                                        <block type="timeouts_setinterval" id="d@w4smoXSX|*cT-^r=nm">
                                                          <field name="NAME">Intervall2</field>
                                                          <field name="INTERVAL">1000</field>
                                                          <field name="UNIT">ms</field>
                                                          <statement name="STATEMENT">
                                                            <block type="update" id="Vh.:?h3Jd!esppCzt%$6">
                                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                              <field name="OID">0_userdata.0.Heizung.Brenner.Zeitstempel1</field>
                                                              <field name="WITH_DELAY">FALSE</field>
                                                              <value name="VALUE">
                                                                <block type="convert_tonumber" id="]K!|.b:;aSn97}+*ldyi">
                                                                  <value name="VALUE">
                                                                    <block type="variables_get" id="N`V@m(N8u4a-{4}Bis}t">
                                                                      <field name="VAR" id="Vy[aoB}!u@F)cFH@mb/0">Zeitstempel1_lokal</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                              <next>
                                                                <block type="update" id="XL3OaIU70vtxf-{8DQM[">
                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                  <field name="OID">0_userdata.0.Heizung.Brenner.Zeitstempel2</field>
                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                  <value name="VALUE">
                                                                    <block type="convert_tonumber" id="ITr?dx~[9O[9QHy:d%!3">
                                                                      <value name="VALUE">
                                                                        <block type="variables_get" id="L}y%i5W!kN(n=YitCNpR">
                                                                          <field name="VAR" id="w5DgCBDMyFCt5c(S./|!">Zeitstempel2_lokal</field>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                  <next>
                                                                    <block type="update" id="Pu(Mps4x2=o:$**`;E|q">
                                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                      <field name="OID">0_userdata.0.Heizung.Brenner.Zeitstempel3</field>
                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                      <value name="VALUE">
                                                                        <block type="convert_tonumber" id="gN73k(Tb#]KdN1B$~!--">
                                                                          <value name="VALUE">
                                                                            <block type="variables_get" id="*/OiCXrIRGKF9dNcli~$">
                                                                              <field name="VAR" id="5t9p`1Dxw,$Hk*h.$xcg">Zeitstempel3_lokal</field>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </value>
                                                                      <next>
                                                                        <block type="update" id="n=?%O(J[1Fe%Ho*{JtRH">
                                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                          <field name="OID">0_userdata.0.Heizung.Brenner.Abstand1</field>
                                                                          <field name="WITH_DELAY">FALSE</field>
                                                                          <value name="VALUE">
                                                                            <block type="convert_tonumber" id="y{$0O;HLt4/^3@tXpJjN">
                                                                              <value name="VALUE">
                                                                                <block type="variables_get" id="+m:rmF]T]6))|8kQ,a@n">
                                                                                  <field name="VAR" id="d2Hca]CPU+D32`h3H=BU">Abstand1_lokal</field>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </value>
                                                                          <next>
                                                                            <block type="update" id="O]NWDtF}q#_BE,Bu8yJw">
                                                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                              <field name="OID">0_userdata.0.Heizung.Brenner.Abstand2</field>
                                                                              <field name="WITH_DELAY">FALSE</field>
                                                                              <value name="VALUE">
                                                                                <block type="convert_tonumber" id="Vn/s5r1w@9+3$F-SbR3R">
                                                                                  <value name="VALUE">
                                                                                    <block type="variables_get" id="#|JujysL|6{4JtG@?QtQ">
                                                                                      <field name="VAR" id="1AoS_%+:!c@4+#30Vfwe">Abstand2_lokal</field>
                                                                                    </block>
                                                                                  </value>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </next>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </statement>
                                                          <next>
                                                            <block type="timeouts_settimeout" id="{t96;`LdE4o2pEe;t@xr">
                                                              <field name="NAME">timeout20</field>
                                                              <field name="DELAY">1200</field>
                                                              <field name="UNIT">ms</field>
                                                              <statement name="STATEMENT">
                                                                <block type="controls_if" id="(1el,P[!}V:`|+:k;/D~">
                                                                  <value name="IF0">
                                                                    <block type="logic_operation" id="S}:%U%6@1wK9+}(R`xcB">
                                                                      <field name="OP">AND</field>
                                                                      <value name="A">
                                                                        <block type="logic_compare" id="lgN$TXl)@u{?)7WrAg.@">
                                                                          <field name="OP">EQ</field>
                                                                          <value name="A">
                                                                            <block type="get_value" id="3LG[owD|:-zt.0htp!=`">
                                                                              <field name="ATTR">val</field>
                                                                              <field name="OID">0_userdata.0.Heizung.Brenner.Takten_erkannt</field>
                                                                            </block>
                                                                          </value>
                                                                          <value name="B">
                                                                            <block type="logic_boolean" id="+KvB([iRAJTu*L*54:a~">
                                                                              <field name="BOOL">FALSE</field>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </value>
                                                                      <value name="B">
                                                                        <block type="logic_operation" id=".A~AYpPpJR{7(C$m,L)s">
                                                                          <field name="OP">AND</field>
                                                                          <value name="A">
                                                                            <block type="logic_compare" id="#^ln{:;.G08c=t/JoG]L">
                                                                              <field name="OP">LT</field>
                                                                              <value name="A">
                                                                                <block type="variables_get" id="7)W^0IK8#5RPyc}+u^)w">
                                                                                  <field name="VAR" id="d2Hca]CPU+D32`h3H=BU">Abstand1_lokal</field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="B">
                                                                                <block type="math_number" id="_ZJ1n]SVr~t[Y`IOI#$7">
                                                                                  <field name="NUM">18</field>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </value>
                                                                          <value name="B">
                                                                            <block type="logic_compare" id="8_YS%}iwNq$ZOQ,,%HX*">
                                                                              <field name="OP">LT</field>
                                                                              <value name="A">
                                                                                <block type="variables_get" id="LS^))4j+qlx%fsa}8FZH">
                                                                                  <field name="VAR" id="1AoS_%+:!c@4+#30Vfwe">Abstand2_lokal</field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="B">
                                                                                <block type="math_number" id="4V-Y)n!^$Y:BcNvhhJ:z">
                                                                                  <field name="NUM">18</field>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                  <statement name="DO0">
                                                                    <block type="update" id="hHx+C:gYwPHn50nNcH)v">
                                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                      <field name="OID">0_userdata.0.Heizung.Brenner.Takten_erkannt</field>
                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                      <value name="VALUE">
                                                                        <block type="logic_boolean" id="H#5BJfNcPi)4$y9Vh;;B">
                                                                          <field name="BOOL">TRUE</field>
                                                                        </block>
                                                                      </value>
                                                                      <next>
                                                                        <block type="comment" id="Q/_c9^D[CM@lPne9]gCz">
                                                                          <field name="COMMENT">falls Abstand 1 und 2 &lt; 10min, dann Brennertakten erkannt = 1</field>
                                                                          <next>
                                                                            <block type="debug" id="lue$qzaw!v0.eqfZ/{=}">
                                                                              <field name="Severity">log</field>
                                                                              <value name="TEXT">
                                                                                <shadow type="text" id="D_cek6$LX(]TK54Ga-i8">
                                                                                  <field name="TEXT">Brennertakten erkannt </field>
                                                                                </shadow>
                                                                              </value>
                                                                            </block>
                                                                          </next>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </statement>
                                                                </block>
                                                              </statement>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </statement>
                                </block>
                              </statement>
                            </block>
                          </xml>
                          
                          paul53 Asgothian 2 Replies Last reply Reply Quote 0
                          • paul53
                            paul53 @passuff last edited by paul53

                            @passuff
                            Ich habe mal sämtliche Timeouts entfernt und die Startzeiten im lesbaren Format "hh:mm:ss" (string) ausgegeben:

                            <xml xmlns="https://developers.google.com/blockly/xml">
                             <variables>
                               <variable id="P:q[ktzwPWYzn2KAbtI/">letzter_Start</variable>
                               <variable id="Ih0G2nhEOs%*#K9VWNB`">vorletzter_Start</variable>
                               <variable id="emx6TU6bU!mM0o2_8~|I">aktuelle_diff</variable>
                               <variable id="5IyVsSvX-%^u/^3-cKUV">letzte_diff</variable>
                             </variables>
                             <block type="variables_set" id="ZR1UiE6xbx}Xwp]|j`PO" x="313" y="538">
                               <field name="VAR" id="P:q[ktzwPWYzn2KAbtI/">letzter_Start</field>
                               <value name="VALUE">
                                 <block type="convert_to_date" id=")*MrT^8zvCDtf%|f}D@.">
                                   <value name="VALUE">
                                     <block type="get_value_var" id="v#mnP=LDxGv428yjM/PR">
                                       <field name="ATTR">val</field>
                                       <value name="OID">
                                         <shadow type="text" id="n}{B{!O@LGHAfbh^pu(@">
                                           <field name="TEXT">0_userdata.0.Heizung.Brenner.Zeitstempel1</field>
                                         </shadow>
                                       </value>
                                     </block>
                                   </value>
                                 </block>
                               </value>
                               <next>
                                 <block type="variables_set" id="5d%G-BL4LOXR8OSC$X0$">
                                   <field name="VAR" id="Ih0G2nhEOs%*#K9VWNB`">vorletzter_Start</field>
                                   <value name="VALUE">
                                     <block type="convert_to_date" id="B[/x(9k~uvLKg/mEZ2$M">
                                       <value name="VALUE">
                                         <block type="get_value_var" id="I|9o.M]pk5f.MFfl0%V(">
                                           <field name="ATTR">val</field>
                                           <value name="OID">
                                             <shadow type="text" id="HI[s1:JEqa`PdMr$1X|$">
                                               <field name="TEXT">0_userdata.0.Heizung.Brenner.Zeitstempel2</field>
                                             </shadow>
                                           </value>
                                         </block>
                                       </value>
                                     </block>
                                   </value>
                                   <next>
                                     <block type="on_ext" id="![=JFmD0UB1vtF~|D`i^">
                                       <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
                                       <field name="CONDITION">ne</field>
                                       <field name="ACK_CONDITION"></field>
                                       <value name="OID0">
                                         <shadow type="field_oid" id="}.GxRXPD[M2S[cQVqH;+">
                                           <field name="oid">viessmann.0.get.VitoStartsBrenner</field>
                                         </shadow>
                                       </value>
                                       <statement name="STATEMENT">
                                         <block type="controls_if" id="7HlOlU2L}V*ajD$g[2?V">
                                           <value name="IF0">
                                             <block type="logic_compare" id="G[M;=~wX%eR1y6S3Bp0?">
                                               <field name="OP">EQ</field>
                                               <value name="A">
                                                 <block type="get_value" id="?nU*vx5UEcW,h10-9:LQ">
                                                   <field name="ATTR">val</field>
                                                   <field name="OID">viessmann.0.get.VitoStatusWW</field>
                                                 </block>
                                               </value>
                                               <value name="B">
                                                 <block type="math_number" id="(N5s_A;npDPuOB,KLj{H">
                                                   <field name="NUM">0</field>
                                                 </block>
                                               </value>
                                             </block>
                                           </value>
                                           <statement name="DO0">
                                             <block type="variables_set" id="x$=A5g0k%;TNf?=v]00O">
                                               <field name="VAR" id="emx6TU6bU!mM0o2_8~|I">aktuelle_diff</field>
                                               <value name="VALUE">
                                                 <block type="math_round" id="|F6-K$/j6pQE~`DMF]5{">
                                                   <field name="OP">ROUND</field>
                                                   <value name="NUM">
                                                     <shadow type="math_number" id="b*g4W]_Y.G,H=xhw2miV">
                                                       <field name="NUM">3.1</field>
                                                     </shadow>
                                                     <block type="math_arithmetic" id="zUp-.GX=7{|b_-kvB,p-" inline="false">
                                                       <field name="OP">DIVIDE</field>
                                                       <value name="A">
                                                         <shadow type="math_number" id="uR7V!?SX)!.*cRttS4D:">
                                                           <field name="NUM">1</field>
                                                         </shadow>
                                                         <block type="math_arithmetic" id=":UYc.`8G}71cqw$2!u7K">
                                                           <field name="OP">MINUS</field>
                                                           <value name="A">
                                                             <shadow type="math_number" id="!O4D,KA[uE#UU5~;;J*A">
                                                               <field name="NUM">1</field>
                                                             </shadow>
                                                             <block type="on_source" id="OKgONehQfiQP1s:Kx;wf">
                                                               <field name="ATTR">state.lc</field>
                                                             </block>
                                                           </value>
                                                           <value name="B">
                                                             <shadow type="math_number" id="whpf=c)0_abHr(u9:O-$">
                                                               <field name="NUM">1</field>
                                                             </shadow>
                                                             <block type="variables_get" id="fhXN%}szs2SGFyj*7:P~">
                                                               <field name="VAR" id="P:q[ktzwPWYzn2KAbtI/">letzter_Start</field>
                                                             </block>
                                                           </value>
                                                         </block>
                                                       </value>
                                                       <value name="B">
                                                         <shadow type="math_number" id="l=!og2s0hOjSOu)G1C;[">
                                                           <field name="NUM">60000</field>
                                                         </shadow>
                                                       </value>
                                                     </block>
                                                   </value>
                                                 </block>
                                               </value>
                                               <next>
                                                 <block type="variables_set" id="Lrl,vi@{Vi[?ca+;[{gl">
                                                   <field name="VAR" id="5IyVsSvX-%^u/^3-cKUV">letzte_diff</field>
                                                   <value name="VALUE">
                                                     <block type="math_round" id="0j@.IEUHlI!3r]N$@rBv">
                                                       <field name="OP">ROUND</field>
                                                       <value name="NUM">
                                                         <shadow type="math_number">
                                                           <field name="NUM">3.1</field>
                                                         </shadow>
                                                         <block type="math_arithmetic" id="dR|xFh!X7[a$Fs%ZQu(." inline="false">
                                                           <field name="OP">DIVIDE</field>
                                                           <value name="A">
                                                             <shadow type="math_number">
                                                               <field name="NUM">1</field>
                                                             </shadow>
                                                             <block type="math_arithmetic" id="5mEeK9}C+NN6x5|Y7g9U">
                                                               <field name="OP">MINUS</field>
                                                               <value name="A">
                                                                 <shadow type="math_number" id="Aw|sG{i!10Qq?TtJO7br">
                                                                   <field name="NUM">1</field>
                                                                 </shadow>
                                                                 <block type="variables_get" id="9B5Cjc?W=|mM[sJU57Fq">
                                                                   <field name="VAR" id="P:q[ktzwPWYzn2KAbtI/">letzter_Start</field>
                                                                 </block>
                                                               </value>
                                                               <value name="B">
                                                                 <shadow type="math_number">
                                                                   <field name="NUM">1</field>
                                                                 </shadow>
                                                                 <block type="variables_get" id="+]quuKalV|n0QY6soguO">
                                                                   <field name="VAR" id="Ih0G2nhEOs%*#K9VWNB`">vorletzter_Start</field>
                                                                 </block>
                                                               </value>
                                                             </block>
                                                           </value>
                                                           <value name="B">
                                                             <shadow type="math_number" id="|dAfupKdLYGOX,[pfKg-">
                                                               <field name="NUM">60000</field>
                                                             </shadow>
                                                           </value>
                                                         </block>
                                                       </value>
                                                     </block>
                                                   </value>
                                                   <next>
                                                     <block type="update" id="Vh.:?h3Jd!esppCzt%$6">
                                                       <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                       <field name="OID">0_userdata.0.Heizung.Brenner.Zeitstempel1</field>
                                                       <field name="WITH_DELAY">FALSE</field>
                                                       <value name="VALUE">
                                                         <block type="convert_from_date" id="J8=Z`V+hyFw_FVKeJ@)M">
                                                           <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                           <field name="OPTION">hh:mm:ss</field>
                                                           <value name="VALUE">
                                                             <block type="on_source" id="e(]v.-3C8}Xpy[e}^UJ[">
                                                               <field name="ATTR">state.lc</field>
                                                             </block>
                                                           </value>
                                                         </block>
                                                       </value>
                                                       <next>
                                                         <block type="update" id="XL3OaIU70vtxf-{8DQM[">
                                                           <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                           <field name="OID">0_userdata.0.Heizung.Brenner.Zeitstempel2</field>
                                                           <field name="WITH_DELAY">FALSE</field>
                                                           <value name="VALUE">
                                                             <block type="convert_from_date" id="Ee+H.X^QmtC+^]I!DLb!">
                                                               <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                               <field name="OPTION">hh:mm:ss</field>
                                                               <value name="VALUE">
                                                                 <block type="variables_get" id="W`vB|Dyy*[#cmuVMb+rg">
                                                                   <field name="VAR" id="P:q[ktzwPWYzn2KAbtI/">letzter_Start</field>
                                                                 </block>
                                                               </value>
                                                             </block>
                                                           </value>
                                                           <next>
                                                             <block type="update" id="Pu(Mps4x2=o:$**`;E|q">
                                                               <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                               <field name="OID">0_userdata.0.Heizung.Brenner.Zeitstempel3</field>
                                                               <field name="WITH_DELAY">FALSE</field>
                                                               <value name="VALUE">
                                                                 <block type="convert_from_date" id="7:Pnia0$xgN|AGv]@kUW">
                                                                   <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                                   <field name="OPTION">hh:mm:ss</field>
                                                                   <value name="VALUE">
                                                                     <block type="variables_get" id="L}y%i5W!kN(n=YitCNpR">
                                                                       <field name="VAR" id="Ih0G2nhEOs%*#K9VWNB`">vorletzter_Start</field>
                                                                     </block>
                                                                   </value>
                                                                 </block>
                                                               </value>
                                                               <next>
                                                                 <block type="update" id="n=?%O(J[1Fe%Ho*{JtRH">
                                                                   <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                   <field name="OID">0_userdata.0.Heizung.Brenner.Abstand1</field>
                                                                   <field name="WITH_DELAY">FALSE</field>
                                                                   <value name="VALUE">
                                                                     <block type="variables_get" id="+m:rmF]T]6))|8kQ,a@n">
                                                                       <field name="VAR" id="emx6TU6bU!mM0o2_8~|I">aktuelle_diff</field>
                                                                     </block>
                                                                   </value>
                                                                   <next>
                                                                     <block type="update" id="O]NWDtF}q#_BE,Bu8yJw">
                                                                       <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                       <field name="OID">0_userdata.0.Heizung.Brenner.Abstand2</field>
                                                                       <field name="WITH_DELAY">FALSE</field>
                                                                       <value name="VALUE">
                                                                         <block type="variables_get" id="#|JujysL|6{4JtG@?QtQ">
                                                                           <field name="VAR" id="5IyVsSvX-%^u/^3-cKUV">letzte_diff</field>
                                                                         </block>
                                                                       </value>
                                                                       <next>
                                                                         <block type="variables_set" id="uFmNx?kGg{$jAU)wa7kL">
                                                                           <field name="VAR" id="Ih0G2nhEOs%*#K9VWNB`">vorletzter_Start</field>
                                                                           <value name="VALUE">
                                                                             <block type="variables_get" id="6qu]Eu|2!!]lE@S8P?-Q">
                                                                               <field name="VAR" id="P:q[ktzwPWYzn2KAbtI/">letzter_Start</field>
                                                                             </block>
                                                                           </value>
                                                                           <next>
                                                                             <block type="variables_set" id="]-275,[r)OQSm87LqFxE">
                                                                               <field name="VAR" id="P:q[ktzwPWYzn2KAbtI/">letzter_Start</field>
                                                                               <value name="VALUE">
                                                                                 <block type="on_source" id="mnO^/xYwdHMcxC:K%`kJ">
                                                                                   <field name="ATTR">state.lc</field>
                                                                                 </block>
                                                                               </value>
                                                                               <next>
                                                                                 <block type="comment" id="#8{N7e(b#Z_!/m]zBD}E">
                                                                                   <field name="COMMENT">Auswertung Differenzen (in Minuten)</field>
                                                                                   <next>
                                                                                     <block type="controls_if" id="(1el,P[!}V:`|+:k;/D~">
                                                                                       <value name="IF0">
                                                                                         <block type="logic_operation" id="S}:%U%6@1wK9+}(R`xcB" inline="false">
                                                                                           <field name="OP">AND</field>
                                                                                           <value name="A">
                                                                                             <block type="logic_compare" id="lgN$TXl)@u{?)7WrAg.@">
                                                                                               <field name="OP">EQ</field>
                                                                                               <value name="A">
                                                                                                 <block type="get_value" id="3LG[owD|:-zt.0htp!=`">
                                                                                                   <field name="ATTR">val</field>
                                                                                                   <field name="OID">0_userdata.0.Heizung.Brenner.Takten_erkannt</field>
                                                                                                 </block>
                                                                                               </value>
                                                                                               <value name="B">
                                                                                                 <block type="logic_boolean" id="+KvB([iRAJTu*L*54:a~">
                                                                                                   <field name="BOOL">FALSE</field>
                                                                                                 </block>
                                                                                               </value>
                                                                                             </block>
                                                                                           </value>
                                                                                           <value name="B">
                                                                                             <block type="logic_operation" id=".A~AYpPpJR{7(C$m,L)s">
                                                                                               <field name="OP">AND</field>
                                                                                               <value name="A">
                                                                                                 <block type="logic_compare" id="#^ln{:;.G08c=t/JoG]L">
                                                                                                   <field name="OP">LT</field>
                                                                                                   <value name="A">
                                                                                                     <block type="variables_get" id="7)W^0IK8#5RPyc}+u^)w">
                                                                                                       <field name="VAR" id="emx6TU6bU!mM0o2_8~|I">aktuelle_diff</field>
                                                                                                     </block>
                                                                                                   </value>
                                                                                                   <value name="B">
                                                                                                     <block type="math_number" id="_ZJ1n]SVr~t[Y`IOI#$7">
                                                                                                       <field name="NUM">18</field>
                                                                                                     </block>
                                                                                                   </value>
                                                                                                 </block>
                                                                                               </value>
                                                                                               <value name="B">
                                                                                                 <block type="logic_compare" id="8_YS%}iwNq$ZOQ,,%HX*">
                                                                                                   <field name="OP">LT</field>
                                                                                                   <value name="A">
                                                                                                     <block type="variables_get" id="LS^))4j+qlx%fsa}8FZH">
                                                                                                       <field name="VAR" id="5IyVsSvX-%^u/^3-cKUV">letzte_diff</field>
                                                                                                     </block>
                                                                                                   </value>
                                                                                                   <value name="B">
                                                                                                     <block type="math_number" id="4V-Y)n!^$Y:BcNvhhJ:z">
                                                                                                       <field name="NUM">18</field>
                                                                                                     </block>
                                                                                                   </value>
                                                                                                 </block>
                                                                                               </value>
                                                                                             </block>
                                                                                           </value>
                                                                                         </block>
                                                                                       </value>
                                                                                       <statement name="DO0">
                                                                                         <block type="update" id="hHx+C:gYwPHn50nNcH)v">
                                                                                           <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                           <field name="OID">0_userdata.0.Heizung.Brenner.Takten_erkannt</field>
                                                                                           <field name="WITH_DELAY">FALSE</field>
                                                                                           <value name="VALUE">
                                                                                             <block type="logic_boolean" id="H#5BJfNcPi)4$y9Vh;;B">
                                                                                               <field name="BOOL">TRUE</field>
                                                                                             </block>
                                                                                           </value>
                                                                                           <next>
                                                                                             <block type="comment" id="Q/_c9^D[CM@lPne9]gCz">
                                                                                               <field name="COMMENT">falls Abstand 1 und 2 &lt; 18min, dann Brennertakten erkannt = true</field>
                                                                                               <next>
                                                                                                 <block type="debug" id="lue$qzaw!v0.eqfZ/{=}">
                                                                                                   <field name="Severity">log</field>
                                                                                                   <value name="TEXT">
                                                                                                     <shadow type="text" id="D_cek6$LX(]TK54Ga-i8">
                                                                                                       <field name="TEXT">Brennertakten erkannt </field>
                                                                                                     </shadow>
                                                                                                   </value>
                                                                                                 </block>
                                                                                               </next>
                                                                                             </block>
                                                                                           </next>
                                                                                         </block>
                                                                                       </statement>
                                                                                     </block>
                                                                                   </next>
                                                                                 </block>
                                                                               </next>
                                                                             </block>
                                                                           </next>
                                                                         </block>
                                                                       </next>
                                                                     </block>
                                                                   </next>
                                                                 </block>
                                                               </next>
                                                             </block>
                                                           </next>
                                                         </block>
                                                       </next>
                                                     </block>
                                                   </next>
                                                 </block>
                                               </next>
                                             </block>
                                           </statement>
                                         </block>
                                       </statement>
                                     </block>
                                   </next>
                                 </block>
                               </next>
                             </block>
                            </xml>
                            

                            Wie wird "Takten_erkannt" zurück gesetzt ?

                            EDIT: Bild

                            Blockly_temp.JPG

                            P 1 Reply Last reply Reply Quote 0
                            • Asgothian
                              Asgothian Developer @passuff last edited by

                              @passuff

                              So - jetzt konnte ich es auch importieren:

                              die gute Nachricht: Alle Timeouts die ich gesehen habe sind unnötig. Warum:

                              • Die Timeouts 15-19 arbeiten nur mit Variablen. Da gibt es nichts asynchrones.
                              • Der Timeout 20 ist auch unnötig - der Datenpunkt den du liest (Takten erkannt) wird sicher erst nach dem lesen gesetzt.
                              • Du hast um das setzen der Datenpunkte ein Intervall. Das ist sicherlich nicht ok. Unnötig ist es auch. Die Datenpunkte machen im übrigen nur Sinn wenn du zu beginn des Skriptes die entsprechenden Variablen aus den Datenpunkten initialisierst.

                              (@paul53 war schneller 🙂 )

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

                                @paul53
                                VielenDank dafür. Ich habe importier, aber irgendwie stört sich iobroker an den Zeilen 10, 11, 12 (aktualisiere Zeitstempel 1-3).

                                javascript.0 (14906) script.js.common.Heizung_Kamin.Takten_Erkennen: setForeignState(id=0_userdata.0.Heizung.Brenner.Zeitstempel3, state={"val":"NaN:NaN:NaN","ack":true}) - wurde nicht ausgeführt, während der Debug-Modus aktiv ist
                                

                                Das skript scheint aber zu laufen...

                                paul53 1 Reply Last reply Reply Quote 0
                                • P
                                  passuff @Asgothian last edited by

                                  @Asgothian
                                  Du hast vermutlich völlig recht, dennoch hat es mit timeouts meistens funktioniert und ohne gar nicht. Ohne habe ich als Abstand immer "null" erhalten.
                                  Warum das so war, kann ich nicht sagen - war nur eine Beobachtung. Vl kam noch eine andere Störgröße hinzu.

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

                                    @passuff
                                    Ändere den Datenpunkt-Typ der 3 Startzeiten in "Zeichenkette" (string).
                                    Wenn es die Zeilen 10, 11, 12 sind, hast Du die Initialisierung der beiden Variablen letzter_Start und vorletzter_Start oberhalb des Triggers noch nicht drin (hatte ich nachträglich ergänzt).

                                    Blockly_temp.JPG

                                    Vor dem ersten Skriptstart trage manuell sinnvolle Zeiten im Format "hh:mm:ss" in die beiden Datenpunkte ein.

                                    1 Reply Last reply Reply Quote 0
                                    • P
                                      passuff last edited by

                                      Super, funktioniert wie es soll. Danke euch allen!

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

                                      Support us

                                      ioBroker
                                      Community Adapters
                                      Donate

                                      948
                                      Online

                                      31.9k
                                      Users

                                      80.1k
                                      Topics

                                      1.3m
                                      Posts

                                      blockly
                                      4
                                      30
                                      1453
                                      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