Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Impulse zählen bei Leistungsanstieg

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Impulse zählen bei Leistungsanstieg

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

      Hallo,
      ich möchte über den Leistungsanstieg meiner Wasserpumpe zählwn wie oft sie einschaltet.
      Zur Umsetzung dachte ich, einfach messen wenn 25 Watt überschritten werden, dann den Zähler um 1 hochzählen.
      Um sicher zu sein dass er nur einmal zählt dachte ich, einfach 1 Minute warten und dann erst ausführen. (Die Pumpe läuft nur 30Sekunden dann ist der Sammelschacht leer.)
      Das passt aber nicht 🙂 Der Zähler zählt nach 1 Minute zuerst um Eins hoch, dann kurz darauf nochmal um Eins.
      3b83a352-2294-4629-97f4-b70df418bc64-image.png
      Wo liegt mein Denkfehler? DANKE !

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable type="timeout" id="timeout">timeout</variable>
          <variable id="3okqS59VMsK+XDFh+0SE">impulse_alt</variable>
          <variable id="RZI_u}?y}!ozy(dUH5QW">impulse_neu</variable>
        </variables>
        <block type="on_ext" id="^O]{#X4cLVr,dxA8J+oZ" x="-713" y="-613">
          <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="?QVRfK`Km3@@7fspSI:1">
              <field name="oid">hm-rpc.0.REQ0777466.2.POWER</field>
            </shadow>
          </value>
          <statement name="STATEMENT">
            <block type="controls_if" id="eKBgg_cLdvp!h%Wc06}0">
              <value name="IF0">
                <block type="logic_compare" id="*qAWBZj1_x(%/dw$7Eg=">
                  <field name="OP">GTE</field>
                  <value name="A">
                    <block type="get_value" id="MhP%.qzHXx/4b3,jg:8m">
                      <field name="ATTR">val</field>
                      <field name="OID">hm-rpc.0.REQ0777466.2.POWER</field>
                    </block>
                  </value>
                  <value name="B">
                    <block type="math_number" id="5#c}BclPeXD9xA?*d*u_">
                      <field name="NUM">25</field>
                    </block>
                  </value>
                </block>
              </value>
              <statement name="DO0">
                <block type="comment" id="E6c,Dz{-d+No68M=DC)H">
                  <field name="COMMENT">1min warten um die Leistungsspitze nur einmal zu zählen</field>
                  <next>
                    <block type="timeouts_settimeout" id="4Qg?p*Z]DCF/!{)cK{Fx">
                      <field name="NAME">timeout</field>
                      <field name="DELAY">1</field>
                      <field name="UNIT">min</field>
                      <statement name="STATEMENT">
                        <block type="variables_set" id="t;/Zh{uMf(o],~-+OntM">
                          <field name="VAR" id="3okqS59VMsK+XDFh+0SE">impulse_alt</field>
                          <value name="VALUE">
                            <block type="get_value" id="?wTnwt0?K_8E%Tnk6.eq">
                              <field name="ATTR">val</field>
                              <field name="OID">javascript.0.Eigene_Datenpunkte.Garten.grundwasser_impulse_keller</field>
                            </block>
                          </value>
                          <next>
                            <block type="variables_set" id=":-/Kcx*z%P%epeF0:V$o">
                              <field name="VAR" id="RZI_u}?y}!ozy(dUH5QW">impulse_neu</field>
                              <value name="VALUE">
                                <block type="math_arithmetic" id="LJD1uV9)Doq@HNDZtfa5">
                                  <field name="OP">ADD</field>
                                  <value name="A">
                                    <shadow type="math_number" id="V[M.Om=|S,oi.((D{R!@">
                                      <field name="NUM">1</field>
                                    </shadow>
                                    <block type="variables_get" id="[G?ZEF:EN$JXinyHX$~b">
                                      <field name="VAR" id="3okqS59VMsK+XDFh+0SE">impulse_alt</field>
                                    </block>
                                  </value>
                                  <value name="B">
                                    <shadow type="math_number" id="e-?sbeL0_BQAkq]M_~Br">
                                      <field name="NUM">1</field>
                                    </shadow>
                                  </value>
                                </block>
                              </value>
                              <next>
                                <block type="update" id="SZ?cd/H@X{ZP^]M7vBgL">
                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                  <field name="OID">javascript.0.Eigene_Datenpunkte.Garten.grundwasser_impulse_keller</field>
                                  <field name="WITH_DELAY">FALSE</field>
                                  <value name="VALUE">
                                    <block type="variables_get" id="P!GBoAUR~j;[3B}t2|so">
                                      <field name="VAR" id="RZI_u}?y}!ozy(dUH5QW">impulse_neu</field>
                                    </block>
                                  </value>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </statement>
                    </block>
                  </next>
                </block>
              </statement>
            </block>
          </statement>
        </block>
      </xml>
      
      paul53 1 Reply Last reply Reply Quote 0
      • paul53
        paul53 @Aiouh last edited by paul53

        @aiouh sagte: Wo liegt mein Denkfehler?

        Die Leistung ist im Ein-Zustand nicht konstant, so dass der Timer mehrfach gestartet wird. Versuche es mal so:

        Bild_2021-06-19_163726.png

        Wert und vorheriger Wert findet man unter "Trigger".

        <xml xmlns="https://developers.google.com/blockly/xml">
         <variables>
           <variable id="*VAptc2Qdiz%tU,=oA?e">impulse</variable>
         </variables>
         <block type="variables_set" id="t;/Zh{uMf(o],~-+OntM" x="-712" y="-638">
           <field name="VAR" id="*VAptc2Qdiz%tU,=oA?e">impulse</field>
           <value name="VALUE">
             <block type="get_value" id="?wTnwt0?K_8E%Tnk6.eq">
               <field name="ATTR">val</field>
               <field name="OID">javascript.0.Eigene_Datenpunkte.Garten.grundwasser_impulse_keller</field>
             </block>
           </value>
           <next>
             <block type="on_ext" id="^O]{#X4cLVr,dxA8J+oZ">
               <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="?QVRfK`Km3@@7fspSI:1">
                   <field name="oid">hm-rpc.0.REQ0777466.2.POWER</field>
                 </shadow>
               </value>
               <statement name="STATEMENT">
                 <block type="controls_if" id="eKBgg_cLdvp!h%Wc06}0">
                   <value name="IF0">
                     <block type="logic_operation" id="+Ul+({MdXOiWPd3.nM=|">
                       <field name="OP">AND</field>
                       <value name="A">
                         <block type="logic_compare" id="*qAWBZj1_x(%/dw$7Eg=">
                           <field name="OP">GTE</field>
                           <value name="A">
                             <block type="on_source" id="ND%-}tl:nFpkZ05^ly:~">
                               <field name="ATTR">state.val</field>
                             </block>
                           </value>
                           <value name="B">
                             <block type="math_number" id="5#c}BclPeXD9xA?*d*u_">
                               <field name="NUM">25</field>
                             </block>
                           </value>
                         </block>
                       </value>
                       <value name="B">
                         <block type="logic_compare" id="Mt~$I$/p(#%f?RW[lz{p">
                           <field name="OP">LT</field>
                           <value name="A">
                             <block type="on_source" id="=!R6/R)gMzA9Dp-ORse_">
                               <field name="ATTR">oldState.val</field>
                             </block>
                           </value>
                           <value name="B">
                             <block type="math_number" id="s$p~vmX^c#!|*o+(Q[a[">
                               <field name="NUM">25</field>
                             </block>
                           </value>
                         </block>
                       </value>
                     </block>
                   </value>
                   <statement name="DO0">
                     <block type="math_change" id="AvV~2{]|#r{r3:@Ga4#l">
                       <field name="VAR" id="*VAptc2Qdiz%tU,=oA?e">impulse</field>
                       <value name="DELTA">
                         <shadow type="math_number" id="q3I#}JI?zj8W#WAmf{0;">
                           <field name="NUM">1</field>
                         </shadow>
                       </value>
                       <next>
                         <block type="update" id="SZ?cd/H@X{ZP^]M7vBgL">
                           <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                           <field name="OID">javascript.0.Eigene_Datenpunkte.Garten.grundwasser_impulse_keller</field>
                           <field name="WITH_DELAY">FALSE</field>
                           <value name="VALUE">
                             <block type="variables_get" id="P!GBoAUR~j;[3B}t2|so">
                               <field name="VAR" id="*VAptc2Qdiz%tU,=oA?e">impulse</field>
                             </block>
                           </value>
                         </block>
                       </next>
                     </block>
                   </statement>
                 </block>
               </statement>
             </block>
           </next>
         </block>
        </xml>
        

        A 1 Reply Last reply Reply Quote 1
        • A
          Aiouh @paul53 last edited by

          @paul53 Wieder was gelernt, klappt perfekt. Danke !

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

          Support us

          ioBroker
          Community Adapters
          Donate

          815
          Online

          32.0k
          Users

          80.5k
          Topics

          1.3m
          Posts

          2
          3
          229
          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