Skip to content
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. Blockly
  5. [Vorlage] Blockly Änderungen innerhalt eines Zeitraums erkennen.

NEWS

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    11
    1
    501

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    24
    1
    1.7k

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    9.6k

[Vorlage] Blockly Änderungen innerhalt eines Zeitraums erkennen.

Geplant Angeheftet Gesperrt Verschoben Blockly
blocklytemplate
1 Beiträge 1 Kommentatoren 844 Aufrufe 5 Watching
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • rantanplanR Offline
    rantanplanR Offline
    rantanplan
    schrieb am zuletzt editiert von
    #1

    Wer erkennen möchte/muss, wie oft ein Aktor innerhalb eines Zeitraums auslöst und bei einer bestimmten Anzahl von Auslösungen etwas starten möchte, kann vielleicht dieses Blockly gebrauchen.

    Parameter: (in der Funktion "initVar" zu setzen)
    maxSekunden -> Zeit in Sekunden in denen die Ereignisse summiert werden
    maxAktionen -> maximale Ereignisse die in "maxSekunden" stattfinden dürfen.

    ForumAktionInZeitraum.png

    Export:

    <xml xmlns="http://www.w3.org/1999/xhtml">
      <variables>
        <variable type="" id="W=tjkG/xj`ZS6uuvcM0;">erstesAusloesen</variable>
        <variable type="" id="qRJ$=yoz?*hYz,ah4.@|">weiteresAusloesen</variable>
        <variable type="" id=",ulmYVfAeGQl9RCaj};9">count</variable>
        <variable type="" id="?gk9(--6?7oeB),xAPnZ">Sekunden</variable>
        <variable type="" id=";q`4gX#-!^r.C5vYW|.y">maxSekunden</variable>
        <variable type="" id="w26ULW#O6mrD}GeW}P$=">maxAktionen</variable>
      </variables>
      <block type="procedures_defnoreturn" id="eJH/DyNr0iKb}/[Gl!HE" x="463" y="-62">
        <field name="NAME">initvAR</field>
        <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
        <statement name="STACK">
          <block type="variables_set" id="AQ6z=^ocF/=ddh+c$5b,">
            <field name="VAR" id="W=tjkG/xj`ZS6uuvcM0;" variabletype="">erstesAusloesen</field>
            <value name="VALUE">
              <block type="math_number" id="/DkC#gnF@b(MJ[=fbN|L">
                <field name="NUM">0</field>
              </block>
            </value>
            <next>
              <block type="variables_set" id="+8E?d7bjFw{S!YLq,)f/">
                <field name="VAR" id="qRJ$=yoz?*hYz,ah4.@|" variabletype="">weiteresAusloesen</field>
                <value name="VALUE">
                  <block type="math_number" id="`TxtzW;{nj$9;+d/o;~Y">
                    <field name="NUM">0</field>
                  </block>
                </value>
                <next>
                  <block type="variables_set" id="yL!-4OOTA./$,4ee(Cds">
                    <field name="VAR" id=",ulmYVfAeGQl9RCaj};9" variabletype="">count</field>
                    <value name="VALUE">
                      <block type="math_number" id="gZ0gtUg26~h%#eyM+kyc">
                        <field name="NUM">0</field>
                      </block>
                    </value>
                    <next>
                      <block type="comment" id="{Q*]tChd7q-wh@0YGdaQ">
                        <field name="COMMENT">Parameter für Aktion</field>
                        <next>
                          <block type="variables_set" id="-KJQnkRFTYWODY2M=P[}">
                            <field name="VAR" id=";q`4gX#-!^r.C5vYW|.y" variabletype="">maxSekunden</field>
                            <value name="VALUE">
                              <block type="math_number" id="JU3qzz12bdJy7;w_wC]i">
                                <field name="NUM">900</field>
                              </block>
                            </value>
                            <next>
                              <block type="variables_set" id="}qNk8Tr-w:ELO1u4f(wO">
                                <field name="VAR" id="w26ULW#O6mrD}GeW}P$=" variabletype="">maxAktionen</field>
                                <value name="VALUE">
                                  <block type="math_number" id=";o%!f-T(8Xy[`mAo29q`">
                                    <field name="NUM">3</field>
                                  </block>
                                </value>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </statement>
      </block>
      <block type="procedures_callnoreturn" id="Oy?5l{.zD(@$40hb|l:-" x="63" y="13">
        <mutation name="initvAR"></mutation>
        <next>
          <block type="on_ext" id="YYCsbU7xie.u2:Jbzn}z">
            <mutation items="1"></mutation>
            <field name="CONDITION">true</field>
            <field name="ACK_CONDITION"></field>
            <value name="OID0">
              <shadow type="field_oid" id="H]z6nzSBT`HJx2NBjfx0">
                <field name="oid">default</field>
              </shadow>
            </value>
            <statement name="STATEMENT">
              <block type="controls_if" id="0z9~9=VF=-5^l0kKUe/Q">
                <mutation else="1"></mutation>
                <value name="IF0">
                  <block type="logic_compare" id="P]oBnwC[+of1+Zy5e{jh">
                    <field name="OP">EQ</field>
                    <value name="A">
                      <block type="variables_get" id="%mE7$1.5TRuNtkeA~07I">
                        <field name="VAR" id="W=tjkG/xj`ZS6uuvcM0;" variabletype="">erstesAusloesen</field>
                      </block>
                    </value>
                    <value name="B">
                      <block type="math_number" id="`{qE|mEhR^(/ejldjo~c">
                        <field name="NUM">0</field>
                      </block>
                    </value>
                  </block>
                </value>
                <statement name="DO0">
                  <block type="variables_set" id="`vyqmlTjii_?E_rJTEIZ">
                    <field name="VAR" id="W=tjkG/xj`ZS6uuvcM0;" variabletype="">erstesAusloesen</field>
                    <value name="VALUE">
                      <block type="time_get" id="pkuVf1;[ehasqK+_GO~=">
                        <mutation format="false" language="false"></mutation>
                        <field name="OPTION">object</field>
                      </block>
                    </value>
                  </block>
                </statement>
                <statement name="ELSE">
                  <block type="variables_set" id="0WZSoT)tXYYf;|_bwj,3">
                    <field name="VAR" id="qRJ$=yoz?*hYz,ah4.@|" variabletype="">weiteresAusloesen</field>
                    <value name="VALUE">
                      <block type="time_get" id="B8$i.jJG4Fi`.qEp].I?">
                        <mutation format="false" language="false"></mutation>
                        <field name="OPTION">object</field>
                      </block>
                    </value>
                    <next>
                      <block type="variables_set" id="m4^:{{K@hvL*lmi)6{2H">
                        <field name="VAR" id="?gk9(--6?7oeB),xAPnZ" variabletype="">Sekunden</field>
                        <value name="VALUE">
                          <block type="convert_from_date" id="+^#ztyEb][`tUdEwrQ+H" inline="false">
                            <mutation format="false" language="false"></mutation>
                            <field name="OPTION">s</field>
                            <value name="VALUE">
                              <block type="math_arithmetic" id="nfS|lSpf@X6R=M)oT3|C">
                                <field name="OP">MINUS</field>
                                <value name="A">
                                  <shadow type="math_number" id="|%?p~CA0bzjR|1)f4:]j">
                                    <field name="NUM">1</field>
                                  </shadow>
                                  <block type="variables_get" id="nQRSVq@C#nW1HPfZ~Rh6">
                                    <field name="VAR" id="qRJ$=yoz?*hYz,ah4.@|" variabletype="">weiteresAusloesen</field>
                                  </block>
                                </value>
                                <value name="B">
                                  <shadow type="math_number" id="1L}]Fn;7,{C7@eA)/qb6">
                                    <field name="NUM">1</field>
                                  </shadow>
                                  <block type="variables_get" id="VXtglw3pM]Rz!.v2N9(;">
                                    <field name="VAR" id="W=tjkG/xj`ZS6uuvcM0;" variabletype="">erstesAusloesen</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                          </block>
                        </value>
                        <next>
                          <block type="controls_if" id="YrXcjy{d[+o$-*/E`F`2">
                            <mutation else="1"></mutation>
                            <value name="IF0">
                              <block type="logic_compare" id="ek6F}GY+F.s%FIH0E~hZ">
                                <field name="OP">LT</field>
                                <value name="A">
                                  <block type="variables_get" id="H;H+l`dvgWiPu4Fj=N^_">
                                    <field name="VAR" id="?gk9(--6?7oeB),xAPnZ" variabletype="">Sekunden</field>
                                  </block>
                                </value>
                                <value name="B">
                                  <block type="variables_get" id="g%8|E/;y%`xCci$t!d8-">
                                    <field name="VAR" id=";q`4gX#-!^r.C5vYW|.y" variabletype="">maxSekunden</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <statement name="DO0">
                              <block type="math_change" id="OykB3%82xmoe5zf0YA=2">
                                <field name="VAR" id=",ulmYVfAeGQl9RCaj};9" variabletype="">count</field>
                                <value name="DELTA">
                                  <shadow type="math_number" id="lGT(C@g**7NKpwt8iS)I">
                                    <field name="NUM">1</field>
                                  </shadow>
                                </value>
                                <next>
                                  <block type="controls_if" id="(e?c.R8:QwQv%gh}mW:H">
                                    <value name="IF0">
                                      <block type="logic_compare" id="ZJJJ^jL[ZP*?CS6v`!h{">
                                        <field name="OP">EQ</field>
                                        <value name="A">
                                          <block type="variables_get" id="t49[Oj#s7+fcE7k{SmAM">
                                            <field name="VAR" id=",ulmYVfAeGQl9RCaj};9" variabletype="">count</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="variables_get" id="b1uoaE.4{uaV7T@dx[$m">
                                            <field name="VAR" id="w26ULW#O6mrD}GeW}P$=" variabletype="">maxAktionen</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <statement name="DO0">
                                      <block type="comment" id="[O{y8xakx@f$rm`^W:4v">
                                        <field name="COMMENT">Action</field>
                                        <next>
                                          <block type="debug" id="pC%ZL=Qr^_}C.2il[mCL">
                                            <field name="Severity">log</field>
                                            <value name="TEXT">
                                              <shadow type="text" id="N+F}TNK3S{t#1%EmbB{S">
                                                <field name="TEXT">Aktion ist notwendig!!!</field>
                                              </shadow>
                                            </value>
                                            <next>
                                              <block type="comment" id="X}kGeEyP@IH4mWHQAq7m">
                                                <field name="COMMENT">Alles auf 0</field>
                                                <next>
                                                  <block type="procedures_callnoreturn" id="|![qE]#wGPs5ay`6,ion">
                                                    <mutation name="initvAR"></mutation>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </statement>
                                  </block>
                                </next>
                              </block>
                            </statement>
                            <statement name="ELSE">
                              <block type="comment" id="`+h;ql,CkezwSL61`+wH">
                                <field name="COMMENT">Alles auf 0</field>
                                <next>
                                  <block type="procedures_callnoreturn" id="j-1nhr8wT:bxU8xHOcV(">
                                    <mutation name="initvAR"></mutation>
                                  </block>
                                </next>
                              </block>
                            </statement>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </statement>
              </block>
            </statement>
          </block>
        </next>
      </block>
    </xml>
    

    Grüße

    Rantanplan

    CCU3 / MS Server 2019(VM) / Scripten mit Blockly

    1 Antwort Letzte Antwort
    5
    Antworten
    • In einem neuen Thema antworten
    Anmelden zum Antworten
    • Älteste zuerst
    • Neuste zuerst
    • Meiste Stimmen


    Support us

    ioBroker
    Community Adapters
    Donate

    675

    Online

    32.5k

    Benutzer

    81.8k

    Themen

    1.3m

    Beiträge
    Community
    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
    ioBroker Community 2014-2025
    logo
    • Anmelden

    • Du hast noch kein Konto? Registrieren

    • Anmelden oder registrieren, um zu suchen
    • Erster Beitrag
      Letzter Beitrag
    0
    • Home
    • Aktuell
    • Tags
    • Ungelesen 0
    • Kategorien
    • Unreplied
    • Beliebt
    • GitHub
    • Docu
    • Hilfe