Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. S0 Stromzähler umrechnen in aktuelle Verbrauch

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    S0 Stromzähler umrechnen in aktuelle Verbrauch

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

      Hallo GoodOld,

      erstmal muss ich sagen das dieses Script Wunderbar funktioniert.
      Kann man das noch erweitern, so das man den Tages- Wochen- Monat- und Jahresverbrauch
      anzeigen lassen kann.
      Leider reichen meine Kenntnisse hierüber noch nicht aus.

      Liebe Grüße
      Jörg

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

        @joewanne sagte:

        Tages- Wochen- Monat- und Jahresverbrauch anzeigen lassen kann.

        Dafür ist der Adapter SourceAnalytix gedacht.

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

          @paul53 said in S0 Stromzähler umrechnen in aktuelle Verbrauch:

          Dafür ist der Adapter SourceAnalytix gedacht.

          Okay, danke schon mal für die schnelle Antwort, werde ich mir dann später noch anschauen

          1 Reply Last reply Reply Quote 0
          • D
            do4bmw @GoodOld last edited by

            @GoodOld Hy Ich hoffe du bist noch aktiv

            bin auch gerade neu in ioBroker angekommen und habe dein Script entdeckt.

            Grundsätzlich funktioniert es wunderbar , nur wenn ich einen Verbrauch von mehr als 3600Watt habe zeigt es nicht mehr an.

            habe ein Test mit 7KW last gemacht , leider zeigt das script nie mehr als ungefähr 3568watt an.

            Zähler macht 1000imp/kWh , habe die 1000 Stehen lassen

            irgendeine idee ?

            gruß Benny

            D paul53 2 Replies Last reply Reply Quote 0
            • D
              do4bmw @do4bmw last edited by

              oder hat jemand anderes vieleicht eine idee dazu ?

              D 1 Reply Last reply Reply Quote 0
              • D
                do4bmw @do4bmw last edited by

                niemand 😞

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

                  @do4bmw sagte:

                  Test mit 7KW last gemacht , leider zeigt das script nie mehr als ungefähr 3568watt an.

                  Script ? Kommen ca. 2 Impulse pro s ?

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

                    @paul53 said in S0 Stromzähler umrechnen in aktuelle Verbrauch:

                    @do4bmw sagte:

                    Test mit 7KW last gemacht , leider zeigt das script nie mehr als ungefähr 3568watt an.

                    Script ? Kommen ca. 2 Impulse pro s ?

                    Hy

                    das script habe ich von @GoodOld übernommen, sieht bei mir derzeit so aus

                    und ja es kann schon sein das manchmal 2 impulse pro Sek kommen ... ist das dass problem ?
                    gerade dann wenn man halt viele KW zieht.

                    <xml xmlns="https://developers.google.com/blockly/xml">
                      <variables>
                        <variable id="Y*)uQOfA3A0pswm8w1GH">Wert</variable>
                      </variables>
                      <block type="on_ext" id="0Sk;oHtQ6S:k07HPnW?7" x="63" y="88">
                        <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="L/T2y/92sL}W_HXn2T1~">
                            <field name="oid">mqtt.0.DO4BMW_S0-1.Strom.Time</field>
                          </shadow>
                        </value>
                        <statement name="STATEMENT">
                          <block type="controls_if" id="iUaf[k~^|w),4x.){V+F">
                            <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.DO4BMW_S0-1.Strom.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="We#NKwtz7+;Hz#jm.(;}">
                                <field name="VAR" id="Y*)uQOfA3A0pswm8w1GH">Wert</field>
                                <value name="VALUE">
                                  <block type="math_arithmetic" id="ej+i[]|eM4x7k?O^x^E7">
                                    <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="l|suXsLX?BHmSza7l|iJ">
                                        <field name="ATTR">val</field>
                                        <field name="OID">mqtt.0.DO4BMW_S0-1.Strom.Time</field>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <shadow type="math_number" id="LM4@`W`A:}E8Y9it}x=+">
                                        <field name="NUM">1000</field>
                                      </shadow>
                                    </value>
                                  </block>
                                </value>
                                <next>
                                  <block type="variables_set" id="~;[g2O3X(]AA,rIqaiF+">
                                    <field name="VAR" id="Y*)uQOfA3A0pswm8w1GH">Wert</field>
                                    <value name="VALUE">
                                      <block type="math_arithmetic" id="8*o-g!6Okm;;z%}o*W65">
                                        <field name="OP">DIVIDE</field>
                                        <value name="A">
                                          <shadow type="math_number" id="I[7R;75:Lju`h(5wk]:}">
                                            <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="/e/c.+=#@9#.ykM}aa+*">
                                            <field name="VAR" id="Y*)uQOfA3A0pswm8w1GH">Wert</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <next>
                                      <block type="control" id="Op`JzD}_|;6;ql1k2ON9">
                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                        <field name="OID">mqtt.0.DO4BMW_S0-1.Strom.Watt2</field>
                                        <field name="WITH_DELAY">FALSE</field>
                                        <value name="VALUE">
                                          <block type="math_round" id="F=.oa5q#rl**.n0;FfkU">
                                            <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="0{|G%xhtf5NW3jz4NXe=">
                                                <field name="VAR" id="Y*)uQOfA3A0pswm8w1GH">Wert</field>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                      </block>
                                    </next>
                                  </block>
                                </next>
                              </block>
                            </statement>
                          </block>
                        </statement>
                      </block>
                    </xml>
                    
                    paul53 1 Reply Last reply Reply Quote 0
                    • paul53
                      paul53 @do4bmw last edited by paul53

                      @do4bmw sagte:

                      manchmal 2 impulse pro Sek kommen ... ist das dass problem ?

                      Bei 7 kW müssen 2 Impulse pro Sekunde kommen. Das Skript wertet allerdings eine Zeit aus und enthält keine Begrenzung. Logge mal den Trigger-Wert, der bei 7 kW etwas über 500 enthalten muss.

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

                        @paul53 said in S0 Stromzähler umrechnen in aktuelle Verbrauch:

                        @do4bmw sagte:

                        manchmal 2 impulse pro Sek kommen ... ist das dass problem ?

                        Bei 7 kW müssen 2 Impulse pro Sekunde kommen. Das Skript wertet allerdings eine Zeit aus und enthält keine Begrenzung. Logge mal den Trigger-Wert, der bei 7 kW etwas über 500 enthalten muss.

                        bei 7.7KW kommt hier sehr häufig der wert 1014 durch

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

                          @do4bmw sagte:

                          bei 7.7KW kommt hier sehr häufig der wert 1014 durch

                          Der Wert ist falsch. Du musst also die Ursache an der Quelle suchen.

                          D 1 Reply Last reply Reply Quote 1
                          • D
                            do4bmw @paul53 last edited by

                            @paul53 said in S0 Stromzähler umrechnen in aktuelle Verbrauch:

                            @do4bmw sagte:

                            bei 7.7KW kommt hier sehr häufig der wert 1014 durch

                            Der Wert ist falsch. Du musst also die Ursache an der Quelle suchen.

                            das ist der wert der mir das wemos D1 mit EasyESP als Time zurück gibt ...

                            ist das der wert den du meinst ?

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

                              @do4bmw sagte:

                              ist das der wert den du meinst ?

                              Ja.

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

                                @paul53 said in S0 Stromzähler umrechnen in aktuelle Verbrauch:

                                @do4bmw sagte:

                                ist das der wert den du meinst ?

                                Ja.

                                mein fehler

                                hatte ein debounce von 1000msec drin

                                nun ist der wert bei 468

                                und schon klappt es auch mit der anzeige

                                danke für die hilfe

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

                                  erledigt.

                                  1 Reply Last reply Reply Quote 1
                                  • D
                                    DaveAustria @GoodOld last edited by

                                    @GoodOld Hallo, ich bin mal so frei und hol das skript wieder hoch,

                                    Ich kann das skript bei mir nicht einfügen, ist es möglich das du mir das nochmal exportierst und schickst ?

                                    Das Skript vom 21.Oct 2018 funktioniert soweit nur wenn ich 0 watt erzeuge, also keine impulse geschickt bekomme, werden mir immer 7 Watt angezeigt, woran kann das liegen ?

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

                                      @DaveAustria sagte:

                                      wenn ich 0 watt erzeuge, also keine impulse geschickt bekomme, werden mir immer 7 Watt angezeigt, woran kann das liegen ?

                                      Weil dann wahrscheinlich nicht getriggert wird. Bau ein Timeout ein, der den Wert nach einer bestimmten Zeit ohne Trigger auf 0 setzt.

                                      Blockly_temp.JPG

                                      <xml xmlns="https://developers.google.com/blockly/xml">
                                       <variables>
                                         <variable id="Y*)uQOfA3A0pswm8w1GH">leistung</variable>
                                         <variable type="timeout" id="timeout">timeout</variable>
                                       </variables>
                                       <block type="on_ext" id="0Sk;oHtQ6S:k07HPnW?7" x="63" y="88">
                                         <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="L/T2y/92sL}W_HXn2T1~">
                                             <field name="oid">mqtt.0.DO4BMW_S0-1.Strom.Time</field>
                                           </shadow>
                                         </value>
                                         <statement name="STATEMENT">
                                           <block type="controls_if" id="iUaf[k~^|w),4x.){V+F">
                                             <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="on_source" id="D!C)q*uU}]fX1bO6VYxn">
                                                     <field name="ATTR">state.val</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="~;[g2O3X(]AA,rIqaiF+">
                                                 <field name="VAR" id="Y*)uQOfA3A0pswm8w1GH">leistung</field>
                                                 <value name="VALUE">
                                                   <block type="math_arithmetic" id="8*o-g!6Okm;;z%}o*W65">
                                                     <field name="OP">DIVIDE</field>
                                                     <value name="A">
                                                       <shadow type="math_number" id="I[7R;75:Lju`h(5wk]:}">
                                                         <field name="NUM">3600000</field>
                                                       </shadow>
                                                     </value>
                                                     <value name="B">
                                                       <shadow type="math_number" id="d6ob|)J]{ekBQ]}g`P_4">
                                                         <field name="NUM">1000</field>
                                                       </shadow>
                                                       <block type="on_source" id="a2vbx!t8f}B}UV_Hq~3p">
                                                         <field name="ATTR">state.val</field>
                                                       </block>
                                                     </value>
                                                   </block>
                                                 </value>
                                                 <next>
                                                   <block type="control" id="Op`JzD}_|;6;ql1k2ON9">
                                                     <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                     <field name="OID">mqtt.0.DO4BMW_S0-1.Strom.Watt2</field>
                                                     <field name="WITH_DELAY">FALSE</field>
                                                     <value name="VALUE">
                                                       <block type="math_round" id="F=.oa5q#rl**.n0;FfkU">
                                                         <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="0{|G%xhtf5NW3jz4NXe=">
                                                             <field name="VAR" id="Y*)uQOfA3A0pswm8w1GH">leistung</field>
                                                           </block>
                                                         </value>
                                                       </block>
                                                     </value>
                                                     <next>
                                                       <block type="timeouts_cleartimeout" id="xHoFioZq73=S9tzzBTq0">
                                                         <field name="NAME">timeout</field>
                                                         <next>
                                                           <block type="timeouts_settimeout" id="MA!5nB{$E.2Qm.QJrJaS">
                                                             <field name="NAME">timeout</field>
                                                             <field name="DELAY">10</field>
                                                             <field name="UNIT">min</field>
                                                             <statement name="STATEMENT">
                                                               <block type="control" id="+2JN]+2,VrSil#6#M{_9">
                                                                 <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                 <field name="OID">mqtt.0.DO4BMW_S0-1.Strom.Watt2</field>
                                                                 <field name="WITH_DELAY">FALSE</field>
                                                                 <value name="VALUE">
                                                                   <block type="math_number" id="At0ZBoh)@0m1emVJG|Qt">
                                                                     <field name="NUM">0</field>
                                                                   </block>
                                                                 </value>
                                                               </block>
                                                             </statement>
                                                           </block>
                                                         </next>
                                                       </block>
                                                     </next>
                                                   </block>
                                                 </next>
                                               </block>
                                             </statement>
                                           </block>
                                         </statement>
                                       </block>
                                      </xml>
                                      

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

                                        Muss das hier nochmal aufwärmen, leider scheint die Rechnung falsch zu sein. Es kommen keine passenden Werte raus.

                                        Hier meine Lösung:

                                        <xml xmlns="https://developers.google.com/blockly/xml">
                                          <variables>
                                            <variable id="AP1}0!{NwZLxuu@pAF`Z">Wert</variable>
                                          </variables>
                                          <block type="on_ext" id="W#4Ls_h_y|cwT?nCY/XR" x="-412" y="-313">
                                            <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="6cdwgAAgS+kz]!+7pnZ)">
                                                <field name="oid">mqtt.0.Stromzähler.Strom_S0.Time</field>
                                              </shadow>
                                            </value>
                                            <statement name="STATEMENT">
                                              <block type="variables_set" id="ogj^ePrs9*@jzEe:R6Km">
                                                <field name="VAR" id="AP1}0!{NwZLxuu@pAF`Z">Wert</field>
                                                <value name="VALUE">
                                                  <block type="math_arithmetic" id="]0M=(k9=r]sxV;nCRTAy">
                                                    <field name="OP">DIVIDE</field>
                                                    <value name="A">
                                                      <shadow type="math_number" id="xc(2ROKN:buynD{lNw[n">
                                                        <field name="NUM">3600</field>
                                                      </shadow>
                                                    </value>
                                                    <value name="B">
                                                      <shadow type="math_number" id="MNkY9Jf5t,f%Q11oIT(1">
                                                        <field name="NUM">1000</field>
                                                      </shadow>
                                                      <block type="math_arithmetic" id="lZpxQ[,}4+i]5FSu[+[~">
                                                        <field name="OP">MULTIPLY</field>
                                                        <value name="A">
                                                          <shadow type="math_number" id="UtZ0GU2I6J.}oqT@qDRd">
                                                            <field name="NUM">0</field>
                                                          </shadow>
                                                          <block type="math_arithmetic" id="b6|Lt+;F9Oq9@:x(*bY9">
                                                            <field name="OP">DIVIDE</field>
                                                            <value name="A">
                                                              <shadow type="math_number" id="Qxvf80B#cQ+k.tWypY(2">
                                                                <field name="NUM">400</field>
                                                              </shadow>
                                                            </value>
                                                            <value name="B">
                                                              <shadow type="math_number" id="MuNNnjw#(B-u]9gQSqeO">
                                                                <field name="NUM">1000</field>
                                                              </shadow>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <value name="B">
                                                          <shadow type="math_number" id="I3xE42u.NAVO9Y)#f-}q">
                                                            <field name="NUM">0</field>
                                                          </shadow>
                                                          <block type="math_arithmetic" id="t?g$@EnYr@L(lZzLa3M8">
                                                            <field name="OP">DIVIDE</field>
                                                            <value name="A">
                                                              <shadow type="math_number" id="n~NMy}8^69Ds0AgcZL(9">
                                                                <field name="NUM">1</field>
                                                              </shadow>
                                                              <block type="get_value" id="9)r@Tz4:V@|MA3p$Cqyo">
                                                                <field name="ATTR">val</field>
                                                                <field name="OID">mqtt.0.Stromzähler.Strom_S0.Time</field>
                                                              </block>
                                                            </value>
                                                            <value name="B">
                                                              <shadow type="math_number" id="EKd;^a4yAI#3k#Dg0nJW">
                                                                <field name="NUM">1000</field>
                                                              </shadow>
                                                            </value>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="control" id="Zh:,x@fPl?!iX),z3z_y">
                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                    <field name="OID">0_userdata.0.Stromzähler.Leistung</field>
                                                    <field name="WITH_DELAY">FALSE</field>
                                                    <value name="VALUE">
                                                      <block type="math_round" id="sjOp3d8^}jClP_0/9_]Y">
                                                        <field name="OP">ROUND</field>
                                                        <value name="NUM">
                                                          <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number">
                                                            <field name="NUM">3.1</field>
                                                          </shadow>
                                                          <block type="variables_get" id="1_c0K2p^[!Yr.axi5F-e">
                                                            <field name="VAR" id="AP1}0!{NwZLxuu@pAF`Z">Wert</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </next>
                                              </block>
                                            </statement>
                                          </block>
                                          <block type="comment" id="6OGtBrzv6fM;c;:x~bS7" x="-213" y="-262">
                                            <field name="COMMENT">h in s</field>
                                          </block>
                                          <block type="comment" id="y=^bV{C~DBmN2AzM3bya" x="-87" y="-262">
                                            <field name="COMMENT">Impulse/kWh</field>
                                          </block>
                                          <block type="comment" id="3(V2ODtu1Kr6+jE;5B{Z" x="38" y="-262">
                                            <field name="COMMENT">von kW in W</field>
                                          </block>
                                          <block type="comment" id="DbtR1m)Y10ih/#v89g%N" x="287" y="-263">
                                            <field name="COMMENT">ms in s umrechnen</field>
                                          </block>
                                          <block type="variables_get" id="OQ3o_4[OzW+,pD{vi7=Q" x="913" y="4263">
                                            <field name="VAR" id="AP1}0!{NwZLxuu@pAF`Z">Wert</field>
                                          </block>
                                        </xml>
                                        
                                        1 Reply Last reply Reply Quote 0
                                        • Elektroniker86
                                          Elektroniker86 last edited by

                                          Hallo,

                                          ich weiß, das hier ist schon ziemlich alt aber benötige hier Hilfe.
                                          Und zwar funktioniert das Blockly leider nicht da mir der Datenpunkt "count" fehlt.

                                          Ich habe ein S0 Zählerimpuls an einem Eingang der LOGO hängen und schleife den direkt durch zu ioBroker wo ich im Blockly mir den Zählerstand hochzählen lasse.

                                          Es sollte doch möglich sein anhand diesem Wert die momentane Leistung zu berechnen in Blockly?
                                          Der ändert sich ja nach jedem neuen Impuls.

                                          Kann mir da jemand helfen?

                                          Vielen Dank im voraus!

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

                                            @elektroniker86 sagte: Zählerstand hochzählen lasse.
                                            Es sollte doch möglich sein anhand diesem Wert die momentane Leistung zu berechnen in Blockly?

                                            Bild_2022-12-13_203229293.png

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            886
                                            Online

                                            31.7k
                                            Users

                                            79.6k
                                            Topics

                                            1.3m
                                            Posts

                                            11
                                            66
                                            6026
                                            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