Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Einsteigerfragen
    4. GPI wird mehrfach geloggt

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    GPI wird mehrfach geloggt

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

      Hi,

      ich habe mir nach diversen Anleitungen im Netz einen Gaszähler gebastelt. Es handelt sich um einen einfachen Reedkontakt der an einen GPI eines Raspberry angeschlossen ist. Nun habe ich gesehen, dass die Impulse (True) teilweise direkt hintereinander geloggt werden ohne ein False dazwischen.
      Die beiden Werte für True haben einen abstand von ca 40s.
      Hat jemand eine Idee, was da los ist?

      VG Schmidti

      PS: Falls ich im falschen Unterforum gelandet bin, gerne verschieben.
      Bildschirm­foto 2022-11-02 um 07.50.05.png

      <xml xmlns="https://developers.google.com/blockly/xml">
        <block type="create" id="Z%NzZ.a@$%Q58Ee~J8T+" x="-313" y="62">
          <field name="NAME">GaszählerStand</field>
          <value name="VALUE">
            <block type="math_number" id="N;KE}kpuR#pWKI/uS_v@">
              <field name="NUM">0</field>
            </block>
          </value>
          <value name="COMMON">
            <block type="text" id="YUabK4ncqu.r8m69O|m]">
              <field name="TEXT">{"type":"number","unit":"m³"}</field>
            </block>
          </value>
          <next>
            <block type="create" id="wQ.JIo;:4qFY^Ve/{_#$">
              <field name="NAME">GaszählerStandkWh</field>
              <value name="VALUE">
                <block type="math_number" id="JDj4hSv@MakI~~gq4Q#1">
                  <field name="NUM">0</field>
                </block>
              </value>
              <value name="COMMON">
                <block type="text" id=",g,:JZBAlf}H(G72%j]3">
                  <field name="TEXT">{"type":"number","unit":"kWh"}</field>
                </block>
              </value>
              <next>
                <block type="on" id="q#pjV~=(qF0Y.KbtZ;yg">
                  <field name="OID">rpi2.0.gpio.22.state</field>
                  <field name="CONDITION">true</field>
                  <field name="ACK_CONDITION"></field>
                  <statement name="STATEMENT">
                    <block type="update" id="5mGQ~.#?}B,L+{i0KTzw" inline="false">
                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                      <field name="OID">javascript.0.GaszählerStand</field>
                      <field name="WITH_DELAY">FALSE</field>
                      <value name="VALUE">
                        <block type="math_rndfixed" id="xL8Y(ws;7EE;8v[x5^+h">
                          <field name="n">2</field>
                          <value name="x">
                            <shadow type="math_number" id="q`@SnMU4I$:e#j~`$0h/">
                              <field name="NUM">3.1234</field>
                            </shadow>
                            <block type="math_arithmetic" id="e_KkJKDHsRM*6Ika;v0D" inline="false">
                              <field name="OP">ADD</field>
                              <value name="A">
                                <shadow type="math_number" id="CLQC7!$DtI3y*H*8mo3|">
                                  <field name="NUM">1</field>
                                </shadow>
                                <block type="get_value" id="(]2!|YxY}6(A*HJ7V$[6">
                                  <field name="ATTR">val</field>
                                  <field name="OID">javascript.0.GaszählerStand</field>
                                </block>
                              </value>
                              <value name="B">
                                <shadow type="math_number" id="T8VS}{!pKuZ~~v*zDpYK">
                                  <field name="NUM">0.01</field>
                                </shadow>
                              </value>
                            </block>
                          </value>
                        </block>
                      </value>
                      <next>
                        <block type="debug" id="bL=V0canwtIPBrNniX:k">
                          <field name="Severity">log</field>
                          <value name="TEXT">
                            <shadow type="text" id="[7@D#7I3vZkm.8g|n+7y">
                              <field name="TEXT">Zähler + 0.01</field>
                            </shadow>
                          </value>
                        </block>
                      </next>
                    </block>
                  </statement>
                  <next>
                    <block type="on" id="QGxvG[?Oq:JxqEk/7ALV">
                      <field name="OID">javascript.0.GaszählerStand</field>
                      <field name="CONDITION">ne</field>
                      <field name="ACK_CONDITION"></field>
                      <statement name="STATEMENT">
                        <block type="update" id="$!:k6vFc/r=V/b:-y$ln" inline="false">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                          <field name="OID">javascript.0.GaszählerStandkWh</field>
                          <field name="WITH_DELAY">FALSE</field>
                          <value name="VALUE">
                            <block type="math_rndfixed" id="u~i4,ZS%8P;Dv2cw#7%1">
                              <field name="n">2</field>
                              <value name="x">
                                <shadow type="math_number" id="wN(t!Y}Ft{JWQlPJwl?C">
                                  <field name="NUM">3.1234</field>
                                </shadow>
                                <block type="math_arithmetic" id="k#vw#tApZ/FA]{c]bLYw" inline="false">
                                  <field name="OP">MULTIPLY</field>
                                  <value name="A">
                                    <shadow type="math_number">
                                      <field name="NUM">1</field>
                                    </shadow>
                                    <block type="math_arithmetic" id="%eaxf);%gdJFZEkn9?}N" inline="false">
                                      <field name="OP">MULTIPLY</field>
                                      <value name="A">
                                        <shadow type="math_number">
                                          <field name="NUM">1</field>
                                        </shadow>
                                        <block type="on_source" id="Kfkm[GU=SPY-lixX@2eM">
                                          <field name="ATTR">state.val</field>
                                        </block>
                                      </value>
                                      <value name="B">
                                        <shadow type="math_number" id="ODgtvQ/7*ekgypm+:X06">
                                          <field name="NUM">0.9683</field>
                                        </shadow>
                                      </value>
                                    </block>
                                  </value>
                                  <value name="B">
                                    <shadow type="math_number" id="FTF1yFHod6!BzTn)wM9g">
                                      <field name="NUM">11.39</field>
                                    </shadow>
                                  </value>
                                </block>
                              </value>
                            </block>
                          </value>
                        </block>
                      </statement>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </next>
        </block>
      </xml>
      
      Codierknecht 1 Reply Last reply Reply Quote 0
      • Codierknecht
        Codierknecht Developer Most Active @schmidti last edited by Codierknecht

        @schmidti
        Hast Du es mal so versucht?
        52642aa7-11a0-413e-9652-e6475446db42-image.png

        Der DP könnte durch andere Einflüsse als den Impulsgeber aktualisiert werden.
        Dann reagiert Dein Trigger ebenfalls und zählt zu viel.

        Hatte ich bei mir zunächst auch. Seitdem ich das umgestellt habe, zählt mein Script zuverlässig.

        P.S.: Außerdem habe ich noch einen Timeout (1 s) zum Entprellen eingebaut (nach dem Debug).

        S 2 Replies Last reply Reply Quote 0
        • S
          schmidti @Codierknecht last edited by

          @codierknecht Ahhhhh, das werde ich mal probieren.
          Danke dir!

          1 Reply Last reply Reply Quote 0
          • S
            schmidti @Codierknecht last edited by

            @codierknecht ICh ahbe es ausprobiert. Leider hat es immer noch ab und zu doppelte Impulse gegeben. Ich habe noch mal den Trigger auf: "ist größer als letztes" gesetzt. Nun is - bis jetzt - alles gut.....

            Danke dir nochmal für die Hilfe!

            VG
            Schmidti

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

            Support us

            ioBroker
            Community Adapters
            Donate

            779
            Online

            31.9k
            Users

            80.3k
            Topics

            1.3m
            Posts

            2
            4
            216
            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