Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Blockly Stromzähler zwei Tarife

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Blockly Stromzähler zwei Tarife

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

      Ich hab folgendes Blockly für die auswertung meines Stromzählers der zwei Tarife hat. Einmal einen Tarif wenn Netzbezug ist, und ein Tarif wenn PV bzw Batteriespeicher Bezug ist. Irgendwie funktioniert der Trigger nicht. Kann mir da jemand helfen.

      code_text
      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable id="O4cF~#WP#OZtn$mpym!}">Netzbezug</variable>
          <variable id="s]/FM,JUGQeHk.Ev:7XT">Wert</variable>
        </variables>
        <block type="on_ext" id="Cg|C}YTozds(1Hs(|Q?P" x="-537" y="-538">
          <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="{==Qcv~.{.:*ZlC~`Dap">
              <field name="oid">mqtt.0.Gas-Strom-Counter.Stromzähler_OG.Total</field>
            </shadow>
          </value>
          <statement name="STATEMENT">
            <block type="controls_if" id="E$qFNah}!:0}$cIEkaNm">
              <value name="IF0">
                <block type="logic_compare" id="?EWfIMb.Cq^R1lx|Xe:)">
                  <field name="OP">EQ</field>
                  <value name="A">
                    <block type="get_value" id="DJIsL0y;Gc`Mh^Ys4/e/">
                      <field name="ATTR">val</field>
                      <field name="OID">shelly.0.SHSW-1#E09806962EAB#1.Relay0.Switch</field>
                    </block>
                  </value>
                  <value name="B">
                    <block type="logic_boolean" id="nzo4WM2dDx0*HBJ2Z=ho">
                      <field name="BOOL">TRUE</field>
                    </block>
                  </value>
                </block>
              </value>
              <statement name="DO0">
                <block type="variables_set" id="HPc|=nKa-HoEeB[L;.;M">
                  <field name="VAR" id="O4cF~#WP#OZtn$mpym!}">Netzbezug</field>
                  <value name="VALUE">
                    <block type="logic_boolean" id="f?%!Lo8e*W;.%ip85qk@">
                      <field name="BOOL">TRUE</field>
                    </block>
                  </value>
                </block>
              </statement>
            </block>
          </statement>
        </block>
        <block type="on_ext" id="/Ke^4uol-G2u2UJ70Pz3" x="-513" y="-337">
          <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
          <field name="CONDITION">true</field>
          <field name="ACK_CONDITION"></field>
          <value name="OID0">
            <shadow type="field_oid" id="nYK=%!}:pW3ls0s,jJ)x">
              <field name="oid">mqtt.0.Gas-Strom-Counter.Stromzähler_OG.Total</field>
            </shadow>
            <block type="variables_get" id="!5(z+0(cS*Pw=RblRk5J">
              <field name="VAR" id="O4cF~#WP#OZtn$mpym!}">Netzbezug</field>
            </block>
          </value>
          <statement name="STATEMENT">
            <block type="controls_if" id="aE6lr~PHT(Hlt^e7`c!1">
              <mutation else="1"></mutation>
              <value name="IF0">
                <block type="logic_compare" id="lobA;m5lrok6!)1HqHLY">
                  <field name="OP">LT</field>
                  <value name="A">
                    <block type="get_value" id="VKRfDx=.8Mx[s~bj#Wl8">
                      <field name="ATTR">val</field>
                      <field name="OID">0_userdata.0.Gas-Strom-Counter.Strom_Zähler_Netz_T2.Hilfsvariable</field>
                    </block>
                  </value>
                  <value name="B">
                    <block type="math_number" id="A7kT`E1Xy[=HYrtbKx]|">
                      <field name="NUM">100</field>
                    </block>
                  </value>
                </block>
              </value>
              <statement name="DO0">
                <block type="control" id="!P8`ffBg9KBqC,GBwnoI">
                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                  <field name="OID">0_userdata.0.Gas-Strom-Counter.Strom_Zähler_Netz_T2.Hilfsvariable</field>
                  <field name="WITH_DELAY">FALSE</field>
                  <value name="VALUE">
                    <block type="math_arithmetic" id="1L.W`XkSE;D.7t3OyHtF">
                      <field name="OP">ADD</field>
                      <value name="A">
                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="G7NG8UAlP5v1vl%@!(?Y">
                          <field name="NUM">1</field>
                        </shadow>
                        <block type="get_value" id="MPxFx,-oFlWtc)t!RX:)">
                          <field name="ATTR">val</field>
                          <field name="OID">0_userdata.0.Gas-Strom-Counter.Strom_Zähler_Netz_T2.Hilfsvariable</field>
                        </block>
                      </value>
                      <value name="B">
                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="_?NJ0n~:8gnxP38|3IIu">
                          <field name="NUM">1</field>
                        </shadow>
                        <block type="get_value" id="DMsv+YX6Z}6e@zGvyU^G">
                          <field name="ATTR">val</field>
                          <field name="OID">mqtt.0.Gas-Strom-Counter.Stromzähler_OG.Count</field>
                        </block>
                      </value>
                    </block>
                  </value>
                </block>
              </statement>
              <statement name="ELSE">
                <block type="control" id="OBP6Sq0JGkM+VZHEgRrz">
                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                  <field name="OID">0_userdata.0.Gas-Strom-Counter.Strom_Zähler_Netz_T2.Hilfsvariable</field>
                  <field name="WITH_DELAY">FALSE</field>
                  <value name="VALUE">
                    <block type="math_arithmetic" id="VFlQwY4^*-y5vTSOi;T?">
                      <field name="OP">MINUS</field>
                      <value name="A">
                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="G7NG8UAlP5v1vl%@!(?Y">
                          <field name="NUM">1</field>
                        </shadow>
                        <block type="get_value" id="]a.fe(rJIrsVS85J9Ax!">
                          <field name="ATTR">val</field>
                          <field name="OID">0_userdata.0.Gas-Strom-Counter.Strom_Zähler_Netz_T2.Hilfsvariable</field>
                        </block>
                      </value>
                      <value name="B">
                        <shadow type="math_number" id=";A!ec(^U{_UqtIjLk/E_">
                          <field name="NUM">100</field>
                        </shadow>
                      </value>
                    </block>
                  </value>
                  <next>
                    <block type="control" id="ky#SKK:c9oTTyhKqg1^R">
                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                      <field name="OID">0_userdata.0.Gas-Strom-Counter.Strom_Zähler_Netz_T2.Zählerstand_Wohnung</field>
                      <field name="WITH_DELAY">FALSE</field>
                      <value name="VALUE">
                        <block type="math_arithmetic" id="3H6MGEQN%Py@{5eGdUIu">
                          <field name="OP">ADD</field>
                          <value name="A">
                            <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="G7NG8UAlP5v1vl%@!(?Y">
                              <field name="NUM">1</field>
                            </shadow>
                            <block type="get_value" id="3QqOy:M~7HqV8Gq7Oo?A">
                              <field name="ATTR">val</field>
                              <field name="OID">0_userdata.0.Gas-Strom-Counter.Strom_Zähler_Netz_T2.Zählerstand_Wohnung</field>
                            </block>
                          </value>
                          <value name="B">
                            <shadow type="math_number" id="_?NJ0n~:8gnxP38|3IIu">
                              <field name="NUM">1</field>
                            </shadow>
                          </value>
                        </block>
                      </value>
                    </block>
                  </next>
                </block>
              </statement>
              <next>
                <block type="control" id="g;HMXZxz]-rrJH@p7c=V">
                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                  <field name="OID">0_userdata.0.Gas-Strom-Counter.Strom_Zähler_Netz_T2.Zählerstand_gerundet</field>
                  <field name="WITH_DELAY">FALSE</field>
                  <value name="VALUE">
                    <block type="math_arithmetic" id="`uLVa4dh[6_Ks)+-],zK">
                      <field name="OP">DIVIDE</field>
                      <value name="A">
                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="Qrk%sWW3T:~Jme=yJ,!%">
                          <field name="NUM">1</field>
                        </shadow>
                        <block type="math_round" id="Gi=9L-[v.dnsSyS+^;r*">
                          <field name="OP">ROUND</field>
                          <value name="NUM">
                            <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="zmnKHSt*sC?gt`d_g1dI">
                              <field name="NUM">100</field>
                            </shadow>
                            <block type="math_arithmetic" id="89t3kCfjijjCk-o[{rEV">
                              <field name="OP">MULTIPLY</field>
                              <value name="A">
                                <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="G7NG8UAlP5v1vl%@!(?Y">
                                  <field name="NUM">1</field>
                                </shadow>
                                <block type="math_arithmetic" id="dCdJ](.1kJ!5a-]3-aI)">
                                  <field name="OP">ADD</field>
                                  <value name="A">
                                    <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="G7NG8UAlP5v1vl%@!(?Y">
                                      <field name="NUM">1</field>
                                    </shadow>
                                    <block type="get_value" id="19xu@iYtRm7hp6/2:?6a">
                                      <field name="ATTR">val</field>
                                      <field name="OID">0_userdata.0.Gas-Strom-Counter.Strom_Zähler_Netz_T2.Zählerstand_Wohnung</field>
                                    </block>
                                  </value>
                                  <value name="B">
                                    <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="}#`5*X:%.`+]MOp3*~H;">
                                      <field name="NUM">1</field>
                                    </shadow>
                                    <block type="math_arithmetic" id="w][*UCMm~2CtPY]56+0-">
                                      <field name="OP">DIVIDE</field>
                                      <value name="A">
                                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="2HmQT([^%b^Y72_advo.">
                                          <field name="NUM">1</field>
                                        </shadow>
                                        <block type="get_value" id="};k}o9IFv(Bz@@6pq8/%">
                                          <field name="ATTR">val</field>
                                          <field name="OID">0_userdata.0.Gas-Strom-Counter.Strom_Zähler_Netz_T2.Hilfsvariable</field>
                                        </block>
                                      </value>
                                      <value name="B">
                                        <shadow type="math_number" id="xZAoSj:J}Sz@@!XLlBXw">
                                          <field name="NUM">1000</field>
                                        </shadow>
                                      </value>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <value name="B">
                                <shadow type="math_number" id="u.e[R/@qd]DS5b}gOXW`">
                                  <field name="NUM">1000</field>
                                </shadow>
                              </value>
                            </block>
                          </value>
                        </block>
                      </value>
                      <value name="B">
                        <shadow type="math_number" id="0(J=(a`M4r2y-I)6kt3N">
                          <field name="NUM">1000</field>
                        </shadow>
                      </value>
                    </block>
                  </value>
                  <next>
                    <block type="control" id="(!jcHTP6cGh^O6l{#@B^">
                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                      <field name="OID">0_userdata.0.Gas-Strom-Counter.Strom_Zähler_Netz_T2.Aktueller_Zählerstand</field>
                      <field name="WITH_DELAY">FALSE</field>
                      <value name="VALUE">
                        <block type="math_arithmetic" id="4eA,jqFsAfeY-L=%Vh.9">
                          <field name="OP">DIVIDE</field>
                          <value name="A">
                            <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="Qrk%sWW3T:~Jme=yJ,!%">
                              <field name="NUM">1</field>
                            </shadow>
                            <block type="math_round" id="1;CQi(QuHkqYG:4-EDn|">
                              <field name="OP">ROUND</field>
                              <value name="NUM">
                                <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="zmnKHSt*sC?gt`d_g1dI">
                                  <field name="NUM">100</field>
                                </shadow>
                                <block type="math_arithmetic" id="GeNi[:Uw-/^+*`9aNflZ">
                                  <field name="OP">MULTIPLY</field>
                                  <value name="A">
                                    <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="G7NG8UAlP5v1vl%@!(?Y">
                                      <field name="NUM">1</field>
                                    </shadow>
                                    <block type="math_arithmetic" id="wp|:UYZj~S^,A#yvri_g">
                                      <field name="OP">ADD</field>
                                      <value name="A">
                                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="Vb@5C%1a5F`4VC3P)otu">
                                          <field name="NUM">1</field>
                                        </shadow>
                                        <block type="get_value" id="BE36M=9|v9Ime_pcs._X">
                                          <field name="ATTR">val</field>
                                          <field name="OID">0_userdata.0.Gas-Strom-Counter.Strom_Zähler_Netz_T2.Anfangs_Zählerstand</field>
                                        </block>
                                      </value>
                                      <value name="B">
                                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="CLnK.uIp+f_wBL]+41:e">
                                          <field name="NUM">1000</field>
                                        </shadow>
                                        <block type="get_value" id="9g7@V)Fg`l*]dyE8m0OO">
                                          <field name="ATTR">val</field>
                                          <field name="OID">0_userdata.0.Gas-Strom-Counter.Strom_Zähler_Netz_T2.Zählerstand_gerundet</field>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                  <value name="B">
                                    <shadow type="math_number" id="oS~ZRmhaHj6Aj:x-YYu#">
                                      <field name="NUM">1000</field>
                                    </shadow>
                                  </value>
                                </block>
                              </value>
                            </block>
                          </value>
                          <value name="B">
                            <shadow type="math_number" id="^yWF63iTDJX]f!Iaj!m8">
                              <field name="NUM">1000</field>
                            </shadow>
                          </value>
                        </block>
                      </value>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </statement>
          <next>
            <block type="on_ext" id="ysdmc3`Gr[OlS6wX3zwn">
              <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
              <field name="CONDITION">any</field>
              <field name="ACK_CONDITION"></field>
              <value name="OID0">
                <shadow type="field_oid" id="g=PqAuIY6*91!SWub}aQ">
                  <field name="oid">mqtt.0.Gas-Strom-Counter.Stromzähler_OG.Time</field>
                </shadow>
              </value>
              <statement name="STATEMENT">
                <block type="controls_if" id="v6mJMKs`6$1CQKipI@NT">
                  <value name="IF0">
                    <block type="logic_compare" id="t[QH7N-2s/0#f()E*+TK">
                      <field name="OP">GT</field>
                      <value name="A">
                        <block type="get_value" id="l,*,Z*N:qq6wgKXv[xRA">
                          <field name="ATTR">val</field>
                          <field name="OID">mqtt.0.Gas-Strom-Counter.Stromzähler_OG.Time</field>
                        </block>
                      </value>
                      <value name="B">
                        <block type="math_number" id="12!)ey:4h!i1Vcpa_P/.">
                          <field name="NUM">0</field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <statement name="DO0">
                    <block type="variables_set" id="l+b)/1Oh=bK{OW)cHTi?">
                      <field name="VAR" id="s]/FM,JUGQeHk.Ev:7XT">Wert</field>
                      <value name="VALUE">
                        <block type="math_arithmetic" id="Cr=Lo5i2kGjw31~IMD}Z">
                          <field name="OP">DIVIDE</field>
                          <value name="A">
                            <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="h5vLrf=_}6A)FIyY4iyR">
                              <field name="NUM">1</field>
                            </shadow>
                            <block type="get_value" id=")M7;?6gjE_kz.h[Gfe%4">
                              <field name="ATTR">val</field>
                              <field name="OID">mqtt.0.Gas-Strom-Counter.Stromzähler_OG.Time</field>
                            </block>
                          </value>
                          <value name="B">
                            <shadow type="math_number" id="CLnK.uIp+f_wBL]+41:e">
                              <field name="NUM">1000</field>
                            </shadow>
                          </value>
                        </block>
                      </value>
                      <next>
                        <block type="variables_set" id="#J1w5f46yGCvs`5;|l/|">
                          <field name="VAR" id="s]/FM,JUGQeHk.Ev:7XT">Wert</field>
                          <value name="VALUE">
                            <block type="math_arithmetic" id="^B7%2v{!gu0EEl@k9FrK">
                              <field name="OP">DIVIDE</field>
                              <value name="A">
                                <shadow type="math_number" id="h5vLrf=_}6A)FIyY4iyR">
                                  <field name="NUM">3600</field>
                                </shadow>
                              </value>
                              <value name="B">
                                <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="d6ob|)J]{ekBQ]}g`P_4">
                                  <field name="NUM">1000</field>
                                </shadow>
                                <block type="variables_get" id="OQ3o_4[OzW+,pD{vi7=Q">
                                  <field name="VAR" id="s]/FM,JUGQeHk.Ev:7XT">Wert</field>
                                </block>
                              </value>
                            </block>
                          </value>
                          <next>
                            <block type="control" id="=E0MGCLN./3sKFZkIOpb">
                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                              <field name="OID">0_userdata.0.Gas-Strom-Counter.Strom_Zähler_Netz_T2.Stromverbrauch_Aktuell</field>
                              <field name="WITH_DELAY">FALSE</field>
                              <value name="VALUE">
                                <block type="math_round" id="HjaqaHU@h#wj6OM?j*+:">
                                  <field name="OP">ROUND</field>
                                  <value name="NUM">
                                    <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="P=8-%G(uftUvKd|SikfY">
                                      <field name="NUM">3.1</field>
                                    </shadow>
                                    <block type="variables_get" id="+bKXuN1/@*.aKYmp{10T">
                                      <field name="VAR" id="s]/FM,JUGQeHk.Ev:7XT">Wert</field>
                                    </block>
                                  </value>
                                </block>
                              </value>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </statement>
                </block>
              </statement>
            </block>
          </next>
        </block>
      </xml>
      

      Blockly Strom.jpg

      F 1 Reply Last reply Reply Quote 0
      • F
        Fritzk @Fritzk last edited by Fritzk

        Ist gelöst

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

        Support us

        ioBroker
        Community Adapters
        Donate

        742
        Online

        32.0k
        Users

        80.5k
        Topics

        1.3m
        Posts

        1
        2
        189
        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