Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Datenpunkt JavascriptObjekt überschreiben nicht mehr möglich

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Datenpunkt JavascriptObjekt überschreiben nicht mehr möglich

    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      Krissie777 @liv-in-sky last edited by

      @liv-in-sky Hallo ihr beiden, ihr seid super herzlichen dank. Ich konnte es jetzt schon eingrenzen.
      Ich habe 2 Blockly Skripts:
      Eines legt den Datenpunkt an "Gaszähler" [1] und eines was ich von jemandem hier bekommen habe baut noch eine Entprellzeit von 100ms ein, das heißt "Gaszähler_2 mit entprellzeit 1000ms" [2].

      Ergebnis:
      Wenn nur das erste Skript [1] läuft, kann ich den Datenpunkt manuell setzen, funktioniert einwandfrei.
      Starte ich jedoch das zweite Skript [2] starte, dann springt der manuell eingegebenene Wert immer zurück. Sobald ich das 2te Skript [2] stoppe, kann ich wieder manuelle Werte eingeben.

      Beide Skripts liefen Wochen einwandfrei, nun zicken beide miteinander...

      Was könnte ich machen? Habt ihr eine Idee, da es ja bis vor kurzem einwandfrei lief 😉

      Soll ich euch beide Skripts hier reinstellen?

      Vielen, vielen Dank für eure Hilfe
      GLGR
      Kris

      Codierknecht liv-in-sky 2 Replies Last reply Reply Quote 0
      • Codierknecht
        Codierknecht Developer Most Active @Krissie777 last edited by Codierknecht

        @krissie777 sagte in Datenpunkt JavascriptObjekt überschreiben nicht mehr möglich:

        Eines legt den Datenpunkt an "Gaszähler" [1]

        Wozu brauchst Du das, wenn der DP bereits existiert?
        Oder macht das noch mehr als nur den DP anzulegen?

        Und beim zweiten haben ja schon andere hier vermutet, dass es sich beim Start den aktuellen Wert in eine Variablen merkt.
        Ohne die Scripte zu sehen, brauchen wir unsere Glaskugel - die ist aber gerade kaputt 😉

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

          @krissie777

          man könnte theoretisch abfragen, von wo aus der dp gesetzt worden ist - über javascript.0... oder admin.0....

          aber ohne die scripte ist helfen echt schwer

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

            @liv-in-sky
            Anbei beide Skripte:

            Skript "Gaszähler":

            <xml xmlns="https://developers.google.com/blockly/xml">
              <block type="create" id="O0.%:4f-:Pqkysp}DPdK" x="63" y="-37">
                <field name="NAME">GaszaehlerStand</field>
                <value name="VALUE">
                  <block type="math_number" id="DhL1vz/Iy1;/}/)[k9FO">
                    <field name="NUM">0</field>
                  </block>
                </value>
                <value name="COMMON">
                  <block type="text" id="$(AthiGYY3W!+XI%po/t">
                    <field name="TEXT">{"type": "number", "unit": "m³"}</field>
                  </block>
                </value>
                <next>
                  <block type="create" id="kt:st]g_7HQ~1,AVg(+C">
                    <field name="NAME">GaszaehlerStandkWh</field>
                    <value name="VALUE">
                      <block type="math_number" id="#Pt*uq1EN[v.o|eC$}9c">
                        <field name="NUM">0</field>
                      </block>
                    </value>
                    <value name="COMMON">
                      <block type="text" id="bWM6wLsF^Y~MSK#E$4}0">
                        <field name="TEXT">{"type": "number", "unit": "kWh"}</field>
                      </block>
                    </value>
                    <next>
                      <block type="create" id="c~W+Vn@gO~$w,H9,3xML">
                        <field name="NAME">GaszaehlerStandkWhAktuell</field>
                        <value name="VALUE">
                          <block type="math_number" id="6~||2y3P4g=*Gap6xyu(">
                            <field name="NUM">0</field>
                          </block>
                        </value>
                        <value name="COMMON">
                          <block type="text" id="uv{-J@N8j|XPi-fZ;Lc]">
                            <field name="TEXT">{"type": "number", "unit": "kWh"}</field>
                          </block>
                        </value>
                        <next>
                          <block type="on" id="[Aae;WUw?/GQLLaSi|YP">
                            <field name="OID">rpi2.0.gpio.23.state</field>
                            <field name="CONDITION">true</field>
                            <field name="ACK_CONDITION"></field>
                            <statement name="STATEMENT">
                              <block type="update" id="{Fr+[nvsyzsRW=R)4u{|" inline="false">
                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                <field name="OID">javascript.0.GaszaehlerStand</field>
                                <field name="WITH_DELAY">FALSE</field>
                                <value name="VALUE">
                                  <block type="math_arithmetic" id="J$]R.`;08=+yt0]}Ii|*" inline="false">
                                    <field name="OP">ADD</field>
                                    <value name="A">
                                      <shadow type="math_number" id="(8#e7nEvA)961d@}=f1e">
                                        <field name="NUM">1</field>
                                      </shadow>
                                      <block type="get_value" id="CUh_iTk5%z6jmF=-I~}Y">
                                        <field name="ATTR">val</field>
                                        <field name="OID">javascript.0.GaszaehlerStand</field>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <shadow type="math_number" id="UpA:b_2XlkBjbm_gL8bq">
                                        <field name="NUM">0.01</field>
                                      </shadow>
                                    </value>
                                  </block>
                                </value>
                              </block>
                            </statement>
                            <next>
                              <block type="on" id="|6!Nh%NKoNreoIx{kE(B">
                                <field name="OID">javascript.0.GaszaehlerStand</field>
                                <field name="CONDITION">ne</field>
                                <field name="ACK_CONDITION"></field>
                                <statement name="STATEMENT">
                                  <block type="comment" id="gz7=_OL%2?bU~j;XKk%R">
                                    <field name="COMMENT">m³ * Zustandszahl * Brennwert</field>
                                    <next>
                                      <block type="update" id="8$E,+yL|3cVhOf:%4~@W" inline="false">
                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                        <field name="OID">javascript.0.GaszaehlerStandkWh</field>
                                        <field name="WITH_DELAY">FALSE</field>
                                        <value name="VALUE">
                                          <block type="math_rndfixed" id=":a7CEg1}#$XfI]rAO}2/">
                                            <field name="n">1</field>
                                            <value name="x">
                                              <shadow type="math_number" id="Cm#rg^1=.kzHerEE(q1G">
                                                <field name="NUM">3.1234</field>
                                              </shadow>
                                              <block type="math_arithmetic" id="P~7p{TAN8J!hbi}wF=,s" inline="false">
                                                <field name="OP">MULTIPLY</field>
                                                <value name="A">
                                                  <shadow type="math_number" id="_zw?QIdjf[qQd_(c(X(V">
                                                    <field name="NUM">1</field>
                                                  </shadow>
                                                  <block type="math_arithmetic" id="h/K]6epkq4eEmczq#XW4" inline="false">
                                                    <field name="OP">MULTIPLY</field>
                                                    <value name="A">
                                                      <shadow type="math_number" id="cr[7/qN25UTSH_]kjR/S">
                                                        <field name="NUM">1</field>
                                                      </shadow>
                                                      <block type="on_source" id="-Vo;;;BDSiGRGu.Y~q0L">
                                                        <field name="ATTR">state.val</field>
                                                      </block>
                                                    </value>
                                                    <value name="B">
                                                      <shadow type="math_number" id="UNm.pI?(Vmrk*-{~Q!hs">
                                                        <field name="NUM">0.9595</field>
                                                      </shadow>
                                                    </value>
                                                  </block>
                                                </value>
                                                <value name="B">
                                                  <shadow type="math_number" id="K=xmEI^vFAvsM0@aV]/G">
                                                    <field name="NUM">10.247</field>
                                                  </shadow>
                                                </value>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                      </block>
                                    </next>
                                  </block>
                                </statement>
                                <next>
                                  <block type="on" id="p6?`i9$CD@7{adfD}:X=">
                                    <field name="OID">javascript.0.GaszaehlerStand</field>
                                    <field name="CONDITION">ne</field>
                                    <field name="ACK_CONDITION"></field>
                                    <statement name="STATEMENT">
                                      <block type="comment" id="-w)F88(KT~jIIR#NO3-I">
                                        <field name="COMMENT">m³ * Zustandszahl * Brennwert</field>
                                        <next>
                                          <block type="update" id="}u?BJ{W0jL$`@jpcqGO:" inline="false">
                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                            <field name="OID">javascript.0.GaszaehlerStandkWhAktuell</field>
                                            <field name="WITH_DELAY">FALSE</field>
                                            <value name="VALUE">
                                              <block type="math_arithmetic" id=")h+LcW=80vV}aRvLgIST" inline="false">
                                                <field name="OP">MINUS</field>
                                                <value name="A">
                                                  <shadow type="math_number">
                                                    <field name="NUM">1</field>
                                                  </shadow>
                                                  <block type="math_arithmetic" id="O!]xlfx~u*yAG@W/L8Yp" inline="false">
                                                    <field name="OP">ADD</field>
                                                    <value name="A">
                                                      <shadow type="math_number" id="Y;HNKZ~b$}0Yv3Sd{qyN">
                                                        <field name="NUM">1</field>
                                                      </shadow>
                                                      <block type="get_value" id=")O/%xa,c|yK}UxP*=I%N">
                                                        <field name="ATTR">val</field>
                                                        <field name="OID">javascript.0.GaszaehlerStandkWh</field>
                                                      </block>
                                                    </value>
                                                    <value name="B">
                                                      <shadow type="math_number" id="6hdg/Eh$E6Ze]y|UN-Zm">
                                                        <field name="NUM">1048.48</field>
                                                      </shadow>
                                                    </value>
                                                  </block>
                                                </value>
                                                <value name="B">
                                                  <shadow type="math_number" id="t]!r:c[xdiI8}:y~GHwu">
                                                    <field name="NUM">44148</field>
                                                  </shadow>
                                                </value>
                                              </block>
                                            </value>
                                          </block>
                                        </next>
                                      </block>
                                    </statement>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </xml>
            
            <xml xmlns="https://developers.google.com/blockly/xml">
              <block type="create" id="O0.%:4f-:Pqkysp}DPdK" x="63" y="-37">
                <field name="NAME">GaszaehlerStand</field>
                <value name="VALUE">
                  <block type="math_number" id="DhL1vz/Iy1;/}/)[k9FO">
                    <field name="NUM">0</field>
                  </block>
                </value>
                <value name="COMMON">
                  <block type="text" id="$(AthiGYY3W!+XI%po/t">
                    <field name="TEXT">{"type": "number", "unit": "m³"}</field>
                  </block>
                </value>
                <next>
                  <block type="create" id="kt:st]g_7HQ~1,AVg(+C">
                    <field name="NAME">GaszaehlerStandkWh</field>
                    <value name="VALUE">
                      <block type="math_number" id="#Pt*uq1EN[v.o|eC$}9c">
                        <field name="NUM">0</field>
                      </block>
                    </value>
                    <value name="COMMON">
                      <block type="text" id="bWM6wLsF^Y~MSK#E$4}0">
                        <field name="TEXT">{"type": "number", "unit": "kWh"}</field>
                      </block>
                    </value>
                    <next>
                      <block type="create" id="c~W+Vn@gO~$w,H9,3xML">
                        <field name="NAME">GaszaehlerStandkWhAktuell</field>
                        <value name="VALUE">
                          <block type="math_number" id="6~||2y3P4g=*Gap6xyu(">
                            <field name="NUM">0</field>
                          </block>
                        </value>
                        <value name="COMMON">
                          <block type="text" id="uv{-J@N8j|XPi-fZ;Lc]">
                            <field name="TEXT">{"type": "number", "unit": "kWh"}</field>
                          </block>
                        </value>
                        <next>
                          <block type="on" id="[Aae;WUw?/GQLLaSi|YP">
                            <field name="OID">rpi2.0.gpio.23.state</field>
                            <field name="CONDITION">true</field>
                            <field name="ACK_CONDITION"></field>
                            <statement name="STATEMENT">
                              <block type="update" id="{Fr+[nvsyzsRW=R)4u{|" inline="false">
                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                <field name="OID">javascript.0.GaszaehlerStand</field>
                                <field name="WITH_DELAY">FALSE</field>
                                <value name="VALUE">
                                  <block type="math_arithmetic" id="J$]R.`;08=+yt0]}Ii|*" inline="false">
                                    <field name="OP">ADD</field>
                                    <value name="A">
                                      <shadow type="math_number" id="(8#e7nEvA)961d@}=f1e">
                                        <field name="NUM">1</field>
                                      </shadow>
                                      <block type="get_value" id="CUh_iTk5%z6jmF=-I~}Y">
                                        <field name="ATTR">val</field>
                                        <field name="OID">javascript.0.GaszaehlerStand</field>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <shadow type="math_number" id="UpA:b_2XlkBjbm_gL8bq">
                                        <field name="NUM">0.01</field>
                                      </shadow>
                                    </value>
                                  </block>
                                </value>
                              </block>
                            </statement>
                            <next>
                              <block type="on" id="|6!Nh%NKoNreoIx{kE(B">
                                <field name="OID">javascript.0.GaszaehlerStand</field>
                                <field name="CONDITION">ne</field>
                                <field name="ACK_CONDITION"></field>
                                <statement name="STATEMENT">
                                  <block type="comment" id="gz7=_OL%2?bU~j;XKk%R">
                                    <field name="COMMENT">m³ * Zustandszahl * Brennwert</field>
                                    <next>
                                      <block type="update" id="8$E,+yL|3cVhOf:%4~@W" inline="false">
                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                        <field name="OID">javascript.0.GaszaehlerStandkWh</field>
                                        <field name="WITH_DELAY">FALSE</field>
                                        <value name="VALUE">
                                          <block type="math_rndfixed" id=":a7CEg1}#$XfI]rAO}2/">
                                            <field name="n">1</field>
                                            <value name="x">
                                              <shadow type="math_number" id="Cm#rg^1=.kzHerEE(q1G">
                                                <field name="NUM">3.1234</field>
                                              </shadow>
                                              <block type="math_arithmetic" id="P~7p{TAN8J!hbi}wF=,s" inline="false">
                                                <field name="OP">MULTIPLY</field>
                                                <value name="A">
                                                  <shadow type="math_number" id="_zw?QIdjf[qQd_(c(X(V">
                                                    <field name="NUM">1</field>
                                                  </shadow>
                                                  <block type="math_arithmetic" id="h/K]6epkq4eEmczq#XW4" inline="false">
                                                    <field name="OP">MULTIPLY</field>
                                                    <value name="A">
                                                      <shadow type="math_number" id="cr[7/qN25UTSH_]kjR/S">
                                                        <field name="NUM">1</field>
                                                      </shadow>
                                                      <block type="on_source" id="-Vo;;;BDSiGRGu.Y~q0L">
                                                        <field name="ATTR">state.val</field>
                                                      </block>
                                                    </value>
                                                    <value name="B">
                                                      <shadow type="math_number" id="UNm.pI?(Vmrk*-{~Q!hs">
                                                        <field name="NUM">0.9595</field>
                                                      </shadow>
                                                    </value>
                                                  </block>
                                                </value>
                                                <value name="B">
                                                  <shadow type="math_number" id="K=xmEI^vFAvsM0@aV]/G">
                                                    <field name="NUM">10.247</field>
                                                  </shadow>
                                                </value>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                      </block>
                                    </next>
                                  </block>
                                </statement>
                                <next>
                                  <block type="on" id="p6?`i9$CD@7{adfD}:X=">
                                    <field name="OID">javascript.0.GaszaehlerStand</field>
                                    <field name="CONDITION">ne</field>
                                    <field name="ACK_CONDITION"></field>
                                    <statement name="STATEMENT">
                                      <block type="comment" id="-w)F88(KT~jIIR#NO3-I">
                                        <field name="COMMENT">m³ * Zustandszahl * Brennwert</field>
                                        <next>
                                          <block type="update" id="}u?BJ{W0jL$`@jpcqGO:" inline="false">
                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                            <field name="OID">javascript.0.GaszaehlerStandkWhAktuell</field>
                                            <field name="WITH_DELAY">FALSE</field>
                                            <value name="VALUE">
                                              <block type="math_arithmetic" id=")h+LcW=80vV}aRvLgIST" inline="false">
                                                <field name="OP">MINUS</field>
                                                <value name="A">
                                                  <shadow type="math_number">
                                                    <field name="NUM">1</field>
                                                  </shadow>
                                                  <block type="math_arithmetic" id="O!]xlfx~u*yAG@W/L8Yp" inline="false">
                                                    <field name="OP">ADD</field>
                                                    <value name="A">
                                                      <shadow type="math_number" id="Y;HNKZ~b$}0Yv3Sd{qyN">
                                                        <field name="NUM">1</field>
                                                      </shadow>
                                                      <block type="get_value" id=")O/%xa,c|yK}UxP*=I%N">
                                                        <field name="ATTR">val</field>
                                                        <field name="OID">javascript.0.GaszaehlerStandkWh</field>
                                                      </block>
                                                    </value>
                                                    <value name="B">
                                                      <shadow type="math_number" id="6hdg/Eh$E6Ze]y|UN-Zm">
                                                        <field name="NUM">1048.48</field>
                                                      </shadow>
                                                    </value>
                                                  </block>
                                                </value>
                                                <value name="B">
                                                  <shadow type="math_number" id="t]!r:c[xdiI8}:y~GHwu">
                                                    <field name="NUM">44148</field>
                                                  </shadow>
                                                </value>
                                              </block>
                                            </value>
                                          </block>
                                        </next>
                                      </block>
                                    </statement>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </xml>
            

            Skript2 "Gaszähler_2 mit entprellzeit 1000ms":

            <xml xmlns="https://developers.google.com/blockly/xml">
              <variables>
                <variable id="1StR`seQeUQb`H_z!#DP">impulse</variable>
                <variable type="timeout" id="timeout">timeout</variable>
              </variables>
              <block type="variables_set" id="CYMfwYP4Y[~Z;gpBdX@D" x="62" y="362">
                <field name="VAR" id="1StR`seQeUQb`H_z!#DP">impulse</field>
                <value name="VALUE">
                  <block type="math_round" id="sr`@`$#f3?`,+iEloksL">
                    <field name="OP">ROUND</field>
                    <value name="NUM">
                      <shadow type="math_number" id="9]vTD}|XWIv:xGe]0r9~">
                        <field name="NUM">3.1</field>
                      </shadow>
                      <block type="math_arithmetic" id="%CD,R)X,M6RF!Y+Wld/z">
                        <field name="OP">MULTIPLY</field>
                        <value name="A">
                          <shadow type="math_number" id="rsxHWJNVxs]{I].bJ.j!">
                            <field name="NUM">100</field>
                          </shadow>
                        </value>
                        <value name="B">
                          <shadow type="math_number" id="[iT+)d{;#?aF(}S4a$mm">
                            <field name="NUM">1</field>
                          </shadow>
                          <block type="get_value" id="CUh_iTk5%z6jmF=-I~}Y">
                            <field name="ATTR">val</field>
                            <field name="OID">javascript.0.GaszaehlerStand</field>
                          </block>
                        </value>
                      </block>
                    </value>
                  </block>
                </value>
                <next>
                  <block type="on" id="[Aae;WUw?/GQLLaSi|YP">
                    <field name="OID">rpi2.0.gpio.23.state</field>
                    <field name="CONDITION">gt</field>
                    <field name="ACK_CONDITION"></field>
                    <statement name="STATEMENT">
                      <block type="controls_if" id=".8+?7#XtnwL8wSR$)I7I">
                        <value name="IF0">
                          <block type="logic_negate" id="zXX?d|iliQ_h*SR.+(RD">
                            <value name="BOOL">
                              <block type="timeouts_gettimeout" id="c#x{Jf@)jg!OgtA84Uv^">
                                <field name="NAME">timeout</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO0">
                          <block type="timeouts_settimeout" id="Z!VN*vvC?muiLV8x-3=,">
                            <field name="NAME">timeout</field>
                            <field name="DELAY">1000</field>
                            <field name="UNIT">ms</field>
                            <statement name="STATEMENT">
                              <block type="timeouts_cleartimeout" id="?;w6?OB{?Xc?z=Wt@cLQ">
                                <field name="NAME">timeout</field>
                              </block>
                            </statement>
                            <next>
                              <block type="math_change" id="`/[H3+Ij3nE00b.+0)i~">
                                <field name="VAR" id="1StR`seQeUQb`H_z!#DP">impulse</field>
                                <value name="DELTA">
                                  <shadow type="math_number" id="oRDL[;AKGlhn0,~F-#15">
                                    <field name="NUM">1</field>
                                  </shadow>
                                </value>
                                <next>
                                  <block type="update" id="{Fr+[nvsyzsRW=R)4u{|">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                    <field name="OID">javascript.0.GaszaehlerStand</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <block type="math_arithmetic" id="30_K7,K8pZwo/**.A9)M">
                                        <field name="OP">DIVIDE</field>
                                        <value name="A">
                                          <shadow type="math_number" id="/4LUx#BMga1iIphZYSY#">
                                            <field name="NUM">1</field>
                                          </shadow>
                                          <block type="variables_get" id="*o~eO#%{e#tFNV{HqlnS">
                                            <field name="VAR" id="1StR`seQeUQb`H_z!#DP">impulse</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <shadow type="math_number" id="412o~m?jItv#F.Y-ynTU">
                                            <field name="NUM">100</field>
                                          </shadow>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </statement>
                      </block>
                    </statement>
                    <next>
                      <block type="on" id="|6!Nh%NKoNreoIx{kE(B">
                        <field name="OID">javascript.0.GaszaehlerStand</field>
                        <field name="CONDITION">ne</field>
                        <field name="ACK_CONDITION"></field>
                        <statement name="STATEMENT">
                          <block type="comment" id="gz7=_OL%2?bU~j;XKk%R">
                            <field name="COMMENT">m³ * Zustandszahl * Brennwert</field>
                            <next>
                              <block type="update" id="8$E,+yL|3cVhOf:%4~@W">
                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                <field name="OID">javascript.0.GaszaehlerStandkWh</field>
                                <field name="WITH_DELAY">FALSE</field>
                                <value name="VALUE">
                                  <block type="math_rndfixed" id=":a7CEg1}#$XfI]rAO}2/">
                                    <field name="n">1</field>
                                    <value name="x">
                                      <shadow type="math_number" id="Cm#rg^1=.kzHerEE(q1G">
                                        <field name="NUM">3.1234</field>
                                      </shadow>
                                      <block type="math_arithmetic" id="P~7p{TAN8J!hbi}wF=,s" inline="false">
                                        <field name="OP">MULTIPLY</field>
                                        <value name="A">
                                          <shadow type="math_number" id="_zw?QIdjf[qQd_(c(X(V">
                                            <field name="NUM">1</field>
                                          </shadow>
                                          <block type="math_arithmetic" id="h/K]6epkq4eEmczq#XW4" inline="false">
                                            <field name="OP">MULTIPLY</field>
                                            <value name="A">
                                              <shadow type="math_number" id="cr[7/qN25UTSH_]kjR/S">
                                                <field name="NUM">1</field>
                                              </shadow>
                                              <block type="on_source" id="-Vo;;;BDSiGRGu.Y~q0L">
                                                <field name="ATTR">state.val</field>
                                              </block>
                                            </value>
                                            <value name="B">
                                              <shadow type="math_number" id="UNm.pI?(Vmrk*-{~Q!hs">
                                                <field name="NUM">0.9595</field>
                                              </shadow>
                                            </value>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <shadow type="math_number" id="K=xmEI^vFAvsM0@aV]/G">
                                            <field name="NUM">10.247</field>
                                          </shadow>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                              </block>
                            </next>
                          </block>
                        </statement>
                        <next>
                          <block type="on" id="p6?`i9$CD@7{adfD}:X=">
                            <field name="OID">javascript.0.GaszaehlerStand</field>
                            <field name="CONDITION">ne</field>
                            <field name="ACK_CONDITION"></field>
                            <statement name="STATEMENT">
                              <block type="comment" id="-w)F88(KT~jIIR#NO3-I">
                                <field name="COMMENT">m³ * Zustandszahl * Brennwert</field>
                                <next>
                                  <block type="update" id="}u?BJ{W0jL$`@jpcqGO:">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                    <field name="OID">javascript.0.GaszaehlerStandkWhAktuell</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <block type="math_arithmetic" id=")h+LcW=80vV}aRvLgIST" inline="false">
                                        <field name="OP">MINUS</field>
                                        <value name="A">
                                          <shadow type="math_number">
                                            <field name="NUM">1</field>
                                          </shadow>
                                          <block type="math_arithmetic" id="O!]xlfx~u*yAG@W/L8Yp" inline="false">
                                            <field name="OP">ADD</field>
                                            <value name="A">
                                              <shadow type="math_number" id="Y;HNKZ~b$}0Yv3Sd{qyN">
                                                <field name="NUM">1</field>
                                              </shadow>
                                              <block type="get_value" id=")O/%xa,c|yK}UxP*=I%N">
                                                <field name="ATTR">val</field>
                                                <field name="OID">javascript.0.GaszaehlerStandkWh</field>
                                              </block>
                                            </value>
                                            <value name="B">
                                              <shadow type="math_number" id="6hdg/Eh$E6Ze]y|UN-Zm">
                                                <field name="NUM">1048.48</field>
                                              </shadow>
                                            </value>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <shadow type="math_number" id="t]!r:c[xdiI8}:y~GHwu">
                                            <field name="NUM">44148</field>
                                          </shadow>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </next>
                              </block>
                            </statement>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </xml>
            

            Vielen Dank für eure Hilfe. Ist echt komisch dass beide Skripte Wochen einwandfrei laufen und dann von dem einen Tag auf den anderen sich anscheinend gegenseitig "zwicken"...

            Ist es möglich beide Skripte in einem zusammenzufassen? Würde das das Thema auf einfache Art lösen?

            Vielen Dank für alles
            GLGR
            Kris

            liv-in-sky 2 Replies Last reply Reply Quote 0
            • liv-in-sky
              liv-in-sky @Krissie777 last edited by

              @krissie777 bitte code tags verwenden bei solchen posts

              https://forum.iobroker.net/post/394912

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

                @krissie777

                das ist 2mal das selbe script ??? fehler beim kopieren ?

                laufen die beide gleichzeitig ?

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

                  @liv-in-sky
                  vielen Dank habe wieder was dazugelernt. Habe die Skripts jetzt korrekt eingefügt 🙂 Danke Dir.

                  Entschuldige bitte, ja mein Fehler, jetzt sind beide Skripte im Originalbeitrag korrekt.

                  Ja laufen beide gleichzeitig.
                  LGR
                  Kris

                  Codierknecht 2 Replies Last reply Reply Quote 0
                  • Codierknecht
                    Codierknecht Developer Most Active @Krissie777 last edited by

                    @krissie777
                    Im ersten sind 2 Blockly enthalten. Das lässt sich so nicht importieren.

                    1 Reply Last reply Reply Quote 0
                    • Codierknecht
                      Codierknecht Developer Most Active @Krissie777 last edited by Codierknecht

                      @krissie777
                      Wie bereits vermutet, merkt sich Script 2 beim Start den aktuellen Stand.
                      Da kannst Du ändern wie Du willst - sobald der nächste Impuls kommt, wird der Wert wieder überschrieben.

                      Script 1 macht prinzipiell genau das Gleiche wie Script 2, außer dass hier vorher die DP angelegt werden.
                      Die beide laufen zu haben macht erstmal überhaupt keinen Sinn. Im Gegenteil: Die stören sich eher gegenseitig.

                      Script 1 brauchst Du eigentlich gar nicht mehr, da die DP ja jetzt existieren.
                      Wenn schon, dann übernehme die 3 Blöcke zum Anlegen der DP in Script 2.

                      In Script 2 existieren 2 Trigger auf das gleiche Objekt. Das macht keinen Sinn und kann zu Fehlern führen.

                      Wenn Du den DP manuell ändern willst, musst Du zwangsläufig Script 2 stoppen.
                      Es sei denn, Du änderst das wie @liv-in-sky bereits vorgeschlagen hat. Das sähe dann wie folgt aus:

                      6ac5d6c2-617c-41f3-a2f0-fc803d1e3069-image.png

                      <xml xmlns="https://developers.google.com/blockly/xml">
                       <variables>
                         <variable id="1StR`seQeUQb`H_z!#DP">impulse</variable>
                         <variable type="timeout" id="timeout">timeout</variable>
                       </variables>
                       <block type="create" id="O0.%:4f-:Pqkysp}DPdK" x="62" y="-88">
                         <field name="NAME">GaszaehlerStand</field>
                         <value name="VALUE">
                           <block type="math_number" id="DhL1vz/Iy1;/}/)[k9FO">
                             <field name="NUM">0</field>
                           </block>
                         </value>
                         <value name="COMMON">
                           <block type="text" id="$(AthiGYY3W!+XI%po/t">
                             <field name="TEXT">{"type": "number", "unit": "m³"}</field>
                           </block>
                         </value>
                         <next>
                           <block type="create" id="kt:st]g_7HQ~1,AVg(+C">
                             <field name="NAME">GaszaehlerStandkWh</field>
                             <value name="VALUE">
                               <block type="math_number" id="#Pt*uq1EN[v.o|eC$}9c">
                                 <field name="NUM">0</field>
                               </block>
                             </value>
                             <value name="COMMON">
                               <block type="text" id="bWM6wLsF^Y~MSK#E$4}0">
                                 <field name="TEXT">{"type": "number", "unit": "kWh"}</field>
                               </block>
                             </value>
                             <next>
                               <block type="create" id="c~W+Vn@gO~$w,H9,3xML">
                                 <field name="NAME">GaszaehlerStandkWhAktuell</field>
                                 <value name="VALUE">
                                   <block type="math_number" id="6~||2y3P4g=*Gap6xyu(">
                                     <field name="NUM">0</field>
                                   </block>
                                 </value>
                                 <value name="COMMON">
                                   <block type="text" id="uv{-J@N8j|XPi-fZ;Lc]">
                                     <field name="TEXT">{"type": "number", "unit": "kWh"}</field>
                                   </block>
                                 </value>
                                 <next>
                                   <block type="variables_set" id="CYMfwYP4Y[~Z;gpBdX@D">
                                     <field name="VAR" id="1StR`seQeUQb`H_z!#DP">impulse</field>
                                     <value name="VALUE">
                                       <block type="math_round" id="sr`@`$#f3?`,+iEloksL">
                                         <field name="OP">ROUND</field>
                                         <value name="NUM">
                                           <shadow type="math_number" id="9]vTD}|XWIv:xGe]0r9~">
                                             <field name="NUM">3.1</field>
                                           </shadow>
                                           <block type="math_arithmetic" id="%CD,R)X,M6RF!Y+Wld/z">
                                             <field name="OP">MULTIPLY</field>
                                             <value name="A">
                                               <shadow type="math_number" id="rsxHWJNVxs]{I].bJ.j!">
                                                 <field name="NUM">100</field>
                                               </shadow>
                                             </value>
                                             <value name="B">
                                               <shadow type="math_number" id="[iT+)d{;#?aF(}S4a$mm">
                                                 <field name="NUM">1</field>
                                               </shadow>
                                               <block type="get_value" id="l7SF`EkH)]8kVe@jI^=%">
                                                 <field name="ATTR">val</field>
                                                 <field name="OID">javascript.0.GaszaehlerStand</field>
                                               </block>
                                             </value>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                     <next>
                                       <block type="on" id="4Q,ZMH192%Jc0V=afaWZ">
                                         <field name="OID">rpi2.0.gpio.23.state</field>
                                         <field name="CONDITION">gt</field>
                                         <field name="ACK_CONDITION"></field>
                                         <statement name="STATEMENT">
                                           <block type="timeouts_cleartimeout" id="?;w6?OB{?Xc?z=Wt@cLQ">
                                             <field name="NAME">timeout</field>
                                             <next>
                                               <block type="timeouts_settimeout" id="Z!VN*vvC?muiLV8x-3=,">
                                                 <field name="NAME">timeout</field>
                                                 <field name="DELAY">1000</field>
                                                 <field name="UNIT">ms</field>
                                                 <statement name="STATEMENT">
                                                   <block type="math_change" id="`/[H3+Ij3nE00b.+0)i~">
                                                     <field name="VAR" id="1StR`seQeUQb`H_z!#DP">impulse</field>
                                                     <value name="DELTA">
                                                       <shadow type="math_number" id="oRDL[;AKGlhn0,~F-#15">
                                                         <field name="NUM">1</field>
                                                       </shadow>
                                                     </value>
                                                     <next>
                                                       <block type="update" id="eD]9(7(H9uMawLy5]mMU">
                                                         <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                         <field name="OID">javascript.0.GaszaehlerStand</field>
                                                         <field name="WITH_DELAY">FALSE</field>
                                                         <value name="VALUE">
                                                           <block type="math_arithmetic" id="30_K7,K8pZwo/**.A9)M">
                                                             <field name="OP">DIVIDE</field>
                                                             <value name="A">
                                                               <shadow type="math_number" id="/4LUx#BMga1iIphZYSY#">
                                                                 <field name="NUM">1</field>
                                                               </shadow>
                                                               <block type="variables_get" id="*o~eO#%{e#tFNV{HqlnS">
                                                                 <field name="VAR" id="1StR`seQeUQb`H_z!#DP">impulse</field>
                                                               </block>
                                                             </value>
                                                             <value name="B">
                                                               <shadow type="math_number" id="412o~m?jItv#F.Y-ynTU">
                                                                 <field name="NUM">100</field>
                                                               </shadow>
                                                             </value>
                                                           </block>
                                                         </value>
                                                       </block>
                                                     </next>
                                                   </block>
                                                 </statement>
                                               </block>
                                             </next>
                                           </block>
                                         </statement>
                                         <next>
                                           <block type="on" id="$q%Ar;dm|%Ks-tJcOke%">
                                             <field name="OID">javascript.0.GaszaehlerStand</field>
                                             <field name="CONDITION">ne</field>
                                             <field name="ACK_CONDITION"></field>
                                             <statement name="STATEMENT">
                                               <block type="comment" id="wU(SZk-L$i)2sL$6n!41">
                                                 <field name="COMMENT">Bei manueller Änderung, Variable aktualisieren</field>
                                                 <next>
                                                   <block type="controls_if" id="c`~t:#[b^W6n|yWnIO~x">
                                                     <value name="IF0">
                                                       <block type="logic_compare" id="Jl*Gc|1u7rI!BWc-ICA|">
                                                         <field name="OP">EQ</field>
                                                         <value name="A">
                                                           <block type="on_source" id="dJ1/(E{v3d9/J}vFCOCZ">
                                                             <field name="ATTR">state.from</field>
                                                           </block>
                                                         </value>
                                                         <value name="B">
                                                           <block type="text" id=")F#k}}DT}/gPt-^y=m+g">
                                                             <field name="TEXT">system.adapter.admin.0</field>
                                                           </block>
                                                         </value>
                                                       </block>
                                                     </value>
                                                     <statement name="DO0">
                                                       <block type="variables_set" id="fG@)XZzamB:}t13j27m]">
                                                         <field name="VAR" id="1StR`seQeUQb`H_z!#DP">impulse</field>
                                                         <value name="VALUE">
                                                           <block type="math_round" id="408xnA_rIegyC/SkqB]I">
                                                             <field name="OP">ROUND</field>
                                                             <value name="NUM">
                                                               <shadow type="math_number">
                                                                 <field name="NUM">3.1</field>
                                                               </shadow>
                                                               <block type="math_arithmetic" id="F5kR(h^Qt|0]q8zAfjLD">
                                                                 <field name="OP">MULTIPLY</field>
                                                                 <value name="A">
                                                                   <shadow type="math_number" id="i]galM#_?rBUn/x:.W-G">
                                                                     <field name="NUM">100</field>
                                                                   </shadow>
                                                                 </value>
                                                                 <value name="B">
                                                                   <shadow type="math_number">
                                                                     <field name="NUM">1</field>
                                                                   </shadow>
                                                                   <block type="get_value" id="-;Bm@!m4C$HN|NyfzxAY">
                                                                     <field name="ATTR">val</field>
                                                                     <field name="OID">javascript.0.GaszaehlerStand</field>
                                                                   </block>
                                                                 </value>
                                                               </block>
                                                             </value>
                                                           </block>
                                                         </value>
                                                       </block>
                                                     </statement>
                                                     <next>
                                                       <block type="comment" id="kwn]Lg1,9|R:^P6fRzmW">
                                                         <field name="COMMENT">m³ * Zustandszahl * Brennwert</field>
                                                         <next>
                                                           <block type="update" id="Cw*nlr|Is`_dAwRKrqVF">
                                                             <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                             <field name="OID">javascript.0.GaszaehlerStandkWh</field>
                                                             <field name="WITH_DELAY">FALSE</field>
                                                             <value name="VALUE">
                                                               <block type="math_rndfixed" id="=Oyhcx$5R[BST$gDZjqr">
                                                                 <field name="n">1</field>
                                                                 <value name="x">
                                                                   <shadow type="math_number" id="Cm#rg^1=.kzHerEE(q1G">
                                                                     <field name="NUM">3.1234</field>
                                                                   </shadow>
                                                                   <block type="math_arithmetic" id="W3IUc[bZJXx*M;x}[MBc" inline="false">
                                                                     <field name="OP">MULTIPLY</field>
                                                                     <value name="A">
                                                                       <shadow type="math_number" id="_zw?QIdjf[qQd_(c(X(V">
                                                                         <field name="NUM">1</field>
                                                                       </shadow>
                                                                       <block type="math_arithmetic" id="hmN:VhAiqFE_q[|C|K9N" inline="false">
                                                                         <field name="OP">MULTIPLY</field>
                                                                         <value name="A">
                                                                           <shadow type="math_number" id="cr[7/qN25UTSH_]kjR/S">
                                                                             <field name="NUM">1</field>
                                                                           </shadow>
                                                                           <block type="on_source" id=":Irj^!E(tl}PO^joC_n;">
                                                                             <field name="ATTR">state.val</field>
                                                                           </block>
                                                                         </value>
                                                                         <value name="B">
                                                                           <shadow type="math_number" id="45~UXm4fXhMV5C@x?{{I">
                                                                             <field name="NUM">0.9595</field>
                                                                           </shadow>
                                                                         </value>
                                                                       </block>
                                                                     </value>
                                                                     <value name="B">
                                                                       <shadow type="math_number" id="(qz;Nq1uxI7u_XK,|#[F">
                                                                         <field name="NUM">10.247</field>
                                                                       </shadow>
                                                                     </value>
                                                                   </block>
                                                                 </value>
                                                               </block>
                                                             </value>
                                                             <next>
                                                               <block type="comment" id="9S6Mrd1ojRDYbe`b5/=!">
                                                                 <field name="COMMENT">m³ * Zustandszahl * Brennwert</field>
                                                                 <next>
                                                                   <block type="update" id="?Kkq+6i26~2:^y,;{Il.">
                                                                     <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                     <field name="OID">javascript.0.GaszaehlerStandkWhAktuell</field>
                                                                     <field name="WITH_DELAY">FALSE</field>
                                                                     <value name="VALUE">
                                                                       <block type="math_arithmetic" id="$Qo1`Tr:vfBF^Qo)K6,C" inline="false">
                                                                         <field name="OP">MINUS</field>
                                                                         <value name="A">
                                                                           <shadow type="math_number">
                                                                             <field name="NUM">1</field>
                                                                           </shadow>
                                                                           <block type="math_arithmetic" id="MQq5rjJkvU6!8[6++87:" inline="false">
                                                                             <field name="OP">ADD</field>
                                                                             <value name="A">
                                                                               <shadow type="math_number" id="Y;HNKZ~b$}0Yv3Sd{qyN">
                                                                                 <field name="NUM">1</field>
                                                                               </shadow>
                                                                               <block type="get_value" id="X*)M}r)_mz[/]YKlkm,w">
                                                                                 <field name="ATTR">val</field>
                                                                                 <field name="OID">javascript.0.GaszaehlerStandkWh</field>
                                                                               </block>
                                                                             </value>
                                                                             <value name="B">
                                                                               <shadow type="math_number" id="@2Palhxji7T6~`s@Yc=B">
                                                                                 <field name="NUM">1048.48</field>
                                                                               </shadow>
                                                                             </value>
                                                                           </block>
                                                                         </value>
                                                                         <value name="B">
                                                                           <shadow type="math_number" id="MEF,$PjjYVNais{%GAp6">
                                                                             <field name="NUM">44148</field>
                                                                           </shadow>
                                                                         </value>
                                                                       </block>
                                                                     </value>
                                                                   </block>
                                                                 </next>
                                                               </block>
                                                             </next>
                                                           </block>
                                                         </next>
                                                       </block>
                                                     </next>
                                                   </block>
                                                 </next>
                                               </block>
                                             </statement>
                                           </block>
                                         </next>
                                       </block>
                                     </next>
                                   </block>
                                 </next>
                               </block>
                             </next>
                           </block>
                         </next>
                       </block>
                      </xml>
                      

                      K 1 Reply Last reply Reply Quote 1
                      • K
                        Krissie777 @Codierknecht last edited by

                        @codierknecht @liv-in-sky @mcm57

                        Guten Morgen zusammen,

                        ich bin so etwas von glücklich, Ihr habt das Thema in so kurzer Zeit gelöst, es läuft und wie, sogar noch besser als vorher 🙂
                        Danke dass es euch gibt.

                        Jetzt noch eine abschliessende Frage:
                        Ohne Entprellzeit hatte ich alle 2-3 Tage den Wert vom Gaszählerstand manuell ca. 1qm nach unten korrigieren müssen (läuft zu schnell).
                        Mit einer Entprellzeit von 1000ms brauche ich nur noch alle 2 Wochen korrigieren aber etwas nach oben ca 1qm in 2 Wochen (läuft zu einen Hauch zu langsam).
                        Kann ich probieren die Entprellzeit z.B. auf 900ms einzustellen im Skript? Wird es dann besser?

                        NAch Beantwortung meiner letzten Frage, werde ich selbstverständlich das thema als hervorragend gelöst markieren. 🙂

                        Vielen Dank für alles
                        Herzliche Grüße
                        Kris

                        Codierknecht 1 Reply Last reply Reply Quote 0
                        • Codierknecht
                          Codierknecht Developer Most Active @Krissie777 last edited by

                          @krissie777 sagte in Datenpunkt JavascriptObjekt überschreiben nicht mehr möglich:

                          Mit einer Entprellzeit von 1000ms brauche ich nur noch alle 2 Wochen korrigieren aber etwas nach oben ca 1qm in 2 Wochen (läuft zu einen Hauch zu langsam)
                          Kann ich probieren die Entprellzeit z.B. auf 900ms einzustellen im Skript? Wird es dann besser?

                          Das ist aus der Ferne nicht so einfach zu beantworten.
                          Meinen Gaszähler lese ich ebenfalls aus. Mit einem Reedkontakt an einem HM-Eingang.
                          Unter "Prellen" versteht man ja so eine Art "Geflacker" beim Wechsel des Sensoreingangs beim Wechsel zwischen High und Low. Wenn also das Signal während der Umdrehungen des Zählwerkes nicht einfach nur von 0 auf 1 und dann von 1 auf 0 wechselt, sondern bis zum Erreichen eines stabilen Zustands innerhalb weniger Millisekunden mehrfach hin und her wechselt.
                          Das fängt man über den Timeout und insbesondere mit dem "Stop Timeout" ein. Gezählt wird damit erst dann, wenn der Zustand (0 oder 1) eine bestimmte Zeit stabil vorliegt und nicht bei jeder Änderung innerhalb von Millisekunden.
                          Das Ganze ist jetzt ein wenig davon abhängig, was Du zählst.
                          An der Walze des Zählwerkes ist ein kleiner Magnet befestigt. Auf welcher Walze, hängt davon ab ob ein Impuls jetzt 0,1 oder 0,01 m³ entspricht.
                          Ich zähle bei mir erst dann, wenn der Magnet wieder "verschwindet" und der Kontakt damit wieder geöffnet wird. Grund dafür: Dieser Zustand liegt länger an - auch (und besonders) dann, wenn der Zähler "volle Pulle" rotiert.

                          Ich vermute jetzt einfach mal, dass Du zählst wenn der Magnet unter dem Sensor "erscheint". Wenn das Zählwerk dann mal besonders schnell läuft, sind Deine 1000 ms zu lange und das Signal liegt nicht lange genug an um überhaupt gezählt zu werden.

                          Du kannst mal versuchen, das mit 900 ms zu optimieren.
                          Oder Du änderst von "ist größer als letztes" auf "ist kleiner als letztes". Hängt davon ab, ob Dein Sensor ein "Öffner" oder ein "Schließer" ist.
                          Versuch macht klug 😉

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

                          Support us

                          ioBroker
                          Community Adapters
                          Donate
                          FAQ Cloud / IOT
                          HowTo: Node.js-Update
                          HowTo: Backup/Restore
                          Downloads
                          BLOG

                          447
                          Online

                          32.0k
                          Users

                          80.4k
                          Topics

                          1.3m
                          Posts

                          4
                          16
                          521
                          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