Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. [gelöst] Zeitverzögerung und Timer

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    [gelöst] Zeitverzögerung und Timer

    This topic has been deleted. Only users with topic management privileges can see it.
    • Humidor
      Humidor @Asgothian last edited by Humidor

      @Asgothian
      Danke!!
      schön langsam verstehe ich dein Blocky, beim unteren Kommentar hat mich der Text verwirrt (copy-paste)

      Humidor 1 Reply Last reply Reply Quote 0
      • Humidor
        Humidor @Humidor last edited by Humidor

        (bei mir is Deutsch), stimmt das für die Feuchtigkeit?

        Bild Text

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

          @Humidor sagte:

          stimmt das für die Feuchtigkeit?

          Nein, so ist die Bedingung für Befeuchten nie erfüllt. Außerdem darf man timeAktiv nicht stoppen, weil dann das Ausschalten verhindert wird. Die erste Verzögerung beträgt 6 Minuten (1 + 5 Minuten).
          Versuche es mal so:

          Blockly_temp.JPG

          <xml xmlns="https://developers.google.com/blockly/xml">
           <variables>
             <variable type="timeout" id="timeout">timeout</variable>
             <variable id="vi`~*b?jfI6T5u5eYjh/">Tuer_offen</variable>
             <variable type="interval" id="Intervall">Intervall</variable>
           </variables>
           <block type="on_ext" id="WJz~?8!GV4cmJVI_*ANE" x="62" y="12">
             <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="-k:HD_d{[8F0a%f/M4h{">
                 <field name="oid">default</field>
               </shadow>
             </value>
             <statement name="STATEMENT">
               <block type="controls_if" id="8*lv4A4N~*(y@kGYO]NK">
                 <mutation elseif="1"></mutation>
                 <value name="IF0">
                   <block type="logic_compare" id="{=@l=W]Iu-.B2s[9*gut">
                     <field name="OP">GT</field>
                     <value name="A">
                       <block type="on_source" id="*wm(1XbT:{j}suy(!G?!">
                         <field name="ATTR">state.val</field>
                       </block>
                     </value>
                     <value name="B">
                       <block type="math_number" id="T9@L(h%[j1`~%BE%Lxo#">
                         <field name="NUM">68</field>
                       </block>
                     </value>
                   </block>
                 </value>
                 <statement name="DO0">
                   <block type="timeouts_cleartimeout" id="[ZvNrnB.Ie98JVPr/5yN">
                     <field name="NAME">timeout</field>
                     <next>
                       <block type="timeouts_clearinterval" id=")S5e27$7R1438t!#$.yk">
                         <field name="NAME">Intervall</field>
                       </block>
                     </next>
                   </block>
                 </statement>
                 <value name="IF1">
                   <block type="logic_operation" id="w}izu#p!s~,v`I0s3KJU">
                     <field name="OP">AND</field>
                     <value name="A">
                       <block type="logic_negate" id="6b=h3C]=e(,Bgm}:$G=~">
                         <value name="BOOL">
                           <block type="variables_get" id="_%!6BI0~fzXn3q(DEpX~">
                             <field name="VAR" id="vi`~*b?jfI6T5u5eYjh/">Tuer_offen</field>
                           </block>
                         </value>
                       </block>
                     </value>
                     <value name="B">
                       <block type="logic_negate" id="v@*j-JARjPFC,;=}gEpT">
                         <value name="BOOL">
                           <block type="variables_get" id="n#n(Dq.~fo*Q|F$%C$%P">
                             <field name="VAR" id="timeout" variabletype="timeout">timeout</field>
                           </block>
                         </value>
                       </block>
                     </value>
                   </block>
                 </value>
                 <statement name="DO1">
                   <block type="timeouts_settimeout" id="mlu=pP)DBv~Xm4vP:oO`">
                     <field name="NAME">timeout</field>
                     <field name="DELAY">1</field>
                     <field name="UNIT">min</field>
                     <statement name="STATEMENT">
                       <block type="control" id="23_I~jA*:BDa;!dz!((y">
                         <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                         <field name="OID">Object ID</field>
                         <field name="WITH_DELAY">FALSE</field>
                         <value name="VALUE">
                           <block type="logic_boolean" id="ctr55tYpLKci4?1{;,zF">
                             <field name="BOOL">TRUE</field>
                           </block>
                         </value>
                         <next>
                           <block type="control" id="lrD0]og^Y}e~eVR[z*+3">
                             <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
                             <field name="OID">Object ID</field>
                             <field name="WITH_DELAY">TRUE</field>
                             <field name="DELAY_MS">30</field>
                             <field name="UNIT">sec</field>
                             <field name="CLEAR_RUNNING">TRUE</field>
                             <value name="VALUE">
                               <block type="logic_boolean" id="Jtl7J1bQV%wl9$t~=Hj?">
                                 <field name="BOOL">FALSE</field>
                               </block>
                             </value>
                             <next>
                               <block type="timeouts_setinterval" id="EbjytT5-{Y_)r{CK7?#R">
                                 <field name="NAME">Intervall</field>
                                 <field name="INTERVAL">5</field>
                                 <field name="UNIT">min</field>
                                 <statement name="STATEMENT">
                                   <block type="control" id=",J;b:5-OCTYeK/+T_rdw">
                                     <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                     <field name="OID">Object ID</field>
                                     <field name="WITH_DELAY">FALSE</field>
                                     <value name="VALUE">
                                       <block type="logic_boolean" id="w?;ejb5pP.JP*2XvXhsI">
                                         <field name="BOOL">TRUE</field>
                                       </block>
                                     </value>
                                     <next>
                                       <block type="control" id="_hO`,wLTI4Pm;Kj$0Hes">
                                         <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
                                         <field name="OID">Object ID</field>
                                         <field name="WITH_DELAY">TRUE</field>
                                         <field name="DELAY_MS">30</field>
                                         <field name="UNIT">sec</field>
                                         <field name="CLEAR_RUNNING">TRUE</field>
                                         <value name="VALUE">
                                           <block type="logic_boolean" id="2U%:K;F(VHb/#$gwtDuF">
                                             <field name="BOOL">FALSE</field>
                                           </block>
                                         </value>
                                       </block>
                                     </next>
                                   </block>
                                 </statement>
                               </block>
                             </next>
                           </block>
                         </next>
                       </block>
                     </statement>
                   </block>
                 </statement>
               </block>
             </statement>
             <next>
               <block type="on_ext" id="573=NVS=9[G/oapopVWo">
                 <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="[g3X3#[Oq4l}or*kG^U#">
                     <field name="oid">default</field>
                   </shadow>
                 </value>
                 <statement name="STATEMENT">
                   <block type="variables_set" id="B[S2!OmW5q+Rk%ZXxHQ,">
                     <field name="VAR" id="vi`~*b?jfI6T5u5eYjh/">Tuer_offen</field>
                     <value name="VALUE">
                       <block type="on_source" id="zOduV;CBlT2bb`|h),v0">
                         <field name="ATTR">state.val</field>
                       </block>
                     </value>
                     <next>
                       <block type="controls_if" id="}dV?O[=?3HOw=|49o!PD">
                         <value name="IF0">
                           <block type="variables_get" id="O1?Qb;o=wdG[RE)80cKG">
                             <field name="VAR" id="vi`~*b?jfI6T5u5eYjh/">Tuer_offen</field>
                           </block>
                         </value>
                         <statement name="DO0">
                           <block type="timeouts_cleartimeout" id="0V5b85xUat3*3z=*{l!I">
                             <field name="NAME">timeout</field>
                             <next>
                               <block type="timeouts_clearinterval" id=",I(/V7/FaPpN*60(mWxZ">
                                 <field name="NAME">Intervall</field>
                               </block>
                             </next>
                           </block>
                         </statement>
                       </block>
                     </next>
                   </block>
                 </statement>
               </block>
             </next>
           </block>
          </xml>
          

          Humidor 1 Reply Last reply Reply Quote 1
          • Humidor
            Humidor @paul53 last edited by Humidor

            @paul53
            Danke!

            wie kann ich den Export hier runterladen?
            was ich nciht verstehe ist, wie ich im Blocky den "Wert" (rot), "Tür_offen" (rot) und "timeout" (rot) so auswählen kann ??
            und was bewirkt "timeout" im sonst falls Zweig?

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

              @Humidor sagte:

              "Wert" (rot), "Tür_offen" (rot) und "timeout" (rot)

              Wert findet man unter "Trigger"
              Tuer_offen ist eine selbst erstellte Variable
              timeout ist eine Variable, die mit "Ausführen timeout" erstellt wird.

              @Humidor sagte in Zeitverzögerung und Timer:

              was bewirkt "timeout" im sonst falls Zweig?

              Es verhindert, dass weitere Timer gestartet werden, wenn bei Wertänderungen unter 68 erneut getriggert wird.

              @Humidor sagte in Zeitverzögerung und Timer:

              wie kann ich den Export hier runterladen?

              Copy (^C) aus dem Forum & Paste (^V) in den Blockly-Import.

              Humidor 1 Reply Last reply Reply Quote 1
              • Humidor
                Humidor @paul53 last edited by

                @paul53 sagte in Zeitverzögerung und Timer:

                @Humidor sagte:

                "Wert" (rot), "Tür_offen" (rot) und "timeout" (rot)

                Wert findet man unter "Trigger"
                Tuer_offen ist eine selbst erstellte Variable
                timeout ist eine Variable, die mit "Ausführen timeout" erstellt wird.

                @Humidor sagte in Zeitverzögerung und Timer:

                was bewirkt "timeout" im sonst falls Zweig?

                Es verhindert, dass weitere Timer gestartet werden, wenn bei Wertänderungen unter 68 erneut getriggert wird.

                @Humidor sagte in Zeitverzögerung und Timer:

                wie kann ich den Export hier runterladen?

                Copy (^C) aus dem Forum & Paste (^V) in den Blockly-Import.

                gefunden!

                ist im falls wenn der Timeout bei 0 erfüllt oder bei einem Wert?

                Bild Text

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

                  @Humidor sagte:

                  gefunden!

                  Der untere Trigger-Datenpunkt ist falsch: Es muss die Tür sein.

                  @Humidor sagte in Zeitverzögerung und Timer:

                  wenn der Timeout bei 0 erfüllt oder bei einem Wert?

                  nicht timeout ist erfüllt, wenn timeout den Wert null (wird bei stop timeout gesetzt) oder den Wert undefined (wird bei Scriptstart gesetzt) enthält. Wenn der Timer gestartet ist, enthält die Variable timeout ein Timer-Objekt.

                  Anmerkung: Anstelle von nicht timeout könnte man auch auf vorheriger Wert > 68 prüfen, so wie es @Asgothian vorgesehen hatte.

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

                    @paul53

                    so richtig ?
                    Bild Text

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

                      @Humidor sagte:

                      so richtig ?

                      Der Trigger ja, die Abfrage nicht: vorheriger Wert > 68 (vorheriger Wert unter "Trigger").
                      Die Bedingung Wert <= 68 ist bereits im sonst enthalten.

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

                        @paul53
                        das mit dem "vorherigen Wert" verstehe ich nicht, soll das eine Zwischenvariable sein?

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

                          @Humidor sagte:

                          das mit dem "vorherigen Wert" verstehe ich nicht, soll das eine Zwischenvariable sein?

                          Nein, das ist eine Eigenschaft des Trigger-Datenpunktes (deshalb unter Blöcke "Trigger")

                          Blockly_temp.JPG

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

                            @paul53
                            das hab ich nicht ?
                            Bild Text

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

                              @Humidor sagte:

                              das hab ich nicht ?

                              Runter scrollen.

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

                                @paul53
                                gefunden, danke!

                                aber kapier ich nicht was der vorherige Wert mit der Abfrage zu tun hat?

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

                                  @Humidor
                                  Bild Text

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

                                    @Humidor sagte:

                                    aber kapier ich nicht was der vorherige Wert mit der Abfrage zu tun hat?

                                    Es soll die Verzögerung nur gestartet werden, wenn

                                    • der Wert <= 68 ist (sonst)
                                    • der vorherige Wert > 68 ist
                                    • die Tür geschlossen ist

                                    Die Prüfung auf vorheriger Wert > 68 verhindert, dass ein weiterer Timer gestartet wird, wenn sich der Wert z.B. von 68 auf 67 ändert.

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

                                      @paul53 sagte in Zeitverzögerung und Timer:

                                      @Humidor sagte:

                                      aber kapier ich nicht was der vorherige Wert mit der Abfrage zu tun hat?

                                      Es soll die Verzögerung nur gestartet werden, wenn

                                      • der Wert <= 68 ist (sonst)
                                      • der vorherige Wert > 68 ist
                                      • die Tür geschlossen ist

                                      Die Prüfung auf vorheriger Wert > 68 verhindert, dass ein weiterer Timer gestartet wird, wenn sich der Wert z.B. von 68 auf 67 ändert.

                                      d.h. dass er den "mach" Zweig nur 1x beschreitet, darin aber die Timer laufen bis die Feuchte >68 wird ?

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

                                        @Humidor
                                        Im oberen mache-Zweig werden die Timer gelöscht, wenn die Feuchte > 68 ist.
                                        Der sonst-Zweig wird ausgeführt, wenn die Feuchte <= 68 ist. falls bei sonst falls prüft weitere Bedingungen.

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

                                          @paul53 sagte in Zeitverzögerung und Timer:

                                          @Humidor
                                          Im mache-Zweig werden die Timer gelöscht, wenn die Feuchte > 68 ist.
                                          Der sonst-falls-Zweig wird ausgeführt, wenn die Feuchte <= 68 ist.

                                          ja richtig im sonst falls, dort muss die Tür zu sein und der vorige Wert <=68

                                          ich kapiers nicht, warum voriger Wert <= 68 ?

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

                                            @Humidor sagte:

                                            ich kapiers nicht, warum voriger Wert <= 68 ?

                                            Das würde ich auch nicht kapieren, denn die richtige Bedingung ist vorheriger Wert > 68, wie schon mehrmals geschrieben.

                                            Blockly_temp.JPG

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            402
                                            Online

                                            32.0k
                                            Users

                                            80.4k
                                            Topics

                                            1.3m
                                            Posts

                                            blockly
                                            3
                                            34
                                            1380
                                            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