Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Timer auf Null setzen

    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

    Timer auf Null setzen

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

      Hallo,
      ich setze einen Timer mit 30 Minuten Laufzeit beim Einschalten einer Steckdose.
      Nach Ablauf des Timers wird die Steckdose ausgeschaltet.
      Schalte ich zwischendurch die Steckdose selber aus läuft der Timer aber weiter.
      Schalte ich nun wieder innerhalb der 30 Minuten ein wird die Steckdose nach der kurzen Restlaufzeit abgeschaltet.
      Ich möchte das beim Ausschalten der Steckdose der Timer auf Null gesetzt wird oder aber beim jedem Starten wieder auf 30 Minuten, egal ob der Timer noch läuft oder nicht.
      Wie mache ich das?

      FredF paul53 2 Replies Last reply Reply Quote 0
      • FredF
        FredF Most Active Forum Testing @actionbyte last edited by

        @actionbyte
        Zeig doch bitte dein Blockly

        actionbyte 1 Reply Last reply Reply Quote 0
        • S
          schdief last edited by

          Flankenauswertung der Steckdose:
          Pos. Flanke -> Timer auf 30

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

            @actionbyte sagte:

            Wie mache ich das?

            const idPlug = '...'; // Steckdose
            
            var timer = null;
            
            on(idPlug, function(dp) {
               if(dp.state.val) { // schaltet ein
                  timer = setTimeout(function() {
                     setState(dp.id, false); // Ausschalten
                  }, 30 * 60000);
               } else { // schaltet aus
                  if(timer) clearTimeout(timer);
               }
            });
            

            oder als Blockly

            Blockly_temp.JPG

            1 Reply Last reply Reply Quote 0
            • actionbyte
              actionbyte @FredF last edited by

              @FredF sagte in Timer auf Null setzen:

              @actionbyte
              Zeig doch bitte dein Blockly

              img_179.jpg

              <xml xmlns="http://www.w3.org/1999/xhtml">
               <variables>
                 <variable type="undefined" id="timeout">timeout</variable>
               </variables>
               <block type="on_ext" id="{M0^(xhgRrL/gPB|,c8c" x="-162" y="-112">
                 <mutation items="1"></mutation>
                 <field name="CONDITION">ne</field>
                 <field name="ACK_CONDITION"></field>
                 <value name="OID0">
                   <shadow type="field_oid" id=")n-ANGh`Cj=W6(*7_m5/">
                     <field name="oid">Meine_Geräte.0.Pumpe</field>
                   </shadow>
                 </value>
                 <statement name="STATEMENT">
                   <block type="controls_if" id="Y4];j?1cP%WToXM~aU8m">
                     <mutation elseif="1"></mutation>
                     <value name="IF0">
                       <block type="logic_compare" id="`0u!:-$sfLJSl2ZzN:6B">
                         <field name="OP">EQ</field>
                         <value name="A">
                           <block type="get_value" id="ql`Uk6q8n5(U$+N[Yt`Q">
                             <field name="ATTR">val</field>
                             <field name="OID">Meine_Geräte.0.Pumpe</field>
                           </block>
                         </value>
                         <value name="B">
                           <block type="logic_boolean" id="+kk#C^V!n`qZhYu~-}))">
                             <field name="BOOL">TRUE</field>
                           </block>
                         </value>
                       </block>
                     </value>
                     <statement name="DO0">
                       <block type="control" id="p,[oZ{9`DM/KhPaA70ZC">
                         <mutation delay_input="false"></mutation>
                         <field name="OID">alexa2.0.Smart-Home-Devices.3db51973-22a7-47b0-b6f0-074cd8a6ff68.powerState</field>
                         <field name="WITH_DELAY">FALSE</field>
                         <value name="VALUE">
                           <block type="logic_boolean" id="21,X5,=wO(2=R.]6I?m^">
                             <field name="BOOL">TRUE</field>
                           </block>
                         </value>
                         <next>
                           <block type="telegram" id="c)gxKi2w+6c*Z4TQ+TYT">
                             <field name="INSTANCE">.0</field>
                             <field name="LOG"></field>
                             <field name="SILENT">TRUE</field>
                             <field name="PARSEMODE">default</field>
                             <value name="MESSAGE">
                               <shadow type="text" id=".Cgq^//MHEy~`oY(-=;9">
                                 <field name="TEXT">Pumpe im Keller ist an.</field>
                               </shadow>
                             </value>
                             <next>
                               <block type="timeouts_settimeout" id="zhVWL7}2c;4`Z_c.HS_@">
                                 <field name="NAME">timeout</field>
                                 <field name="DELAY">30</field>
                                 <field name="UNIT">min</field>
                                 <statement name="STATEMENT">
                                   <block type="controls_if" id="qvq@%vgBeo3H1F6!8QRv">
                                     <value name="IF0">
                                       <block type="logic_compare" id=")Ujl:^-e0;+lU;$aSL^V">
                                         <field name="OP">EQ</field>
                                         <value name="A">
                                           <block type="get_value" id="O==zAoAkf69i#]3,+TPB">
                                             <field name="ATTR">val</field>
                                             <field name="OID">Meine_Geräte.0.Pumpe</field>
                                           </block>
                                         </value>
                                         <value name="B">
                                           <block type="logic_boolean" id="IIMg9)$txV^+aiGT[-)z">
                                             <field name="BOOL">TRUE</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                     <statement name="DO0">
                                       <block type="control" id="G._e_?|2]$N`Ox5lN2o_">
                                         <mutation delay_input="false"></mutation>
                                         <field name="OID">Meine_Geräte.0.Pumpe</field>
                                         <field name="WITH_DELAY">FALSE</field>
                                         <value name="VALUE">
                                           <block type="logic_boolean" id="bB_t}W;E91QnHE~0IEc]">
                                             <field name="BOOL">FALSE</field>
                                           </block>
                                         </value>
                                         <next>
                                           <block type="telegram" id="Y*^DQjnc*mK#wd=[1_:#">
                                             <field name="INSTANCE">.0</field>
                                             <field name="LOG"></field>
                                             <field name="SILENT">TRUE</field>
                                             <field name="PARSEMODE">default</field>
                                             <value name="MESSAGE">
                                               <shadow type="text" id=":M=n#Ld{,0VG8:A;U[zO">
                                                 <field name="TEXT">Pumpe im Keller ist 30 Minuten an.</field>
                                               </shadow>
                                             </value>
                                           </block>
                                         </next>
                                       </block>
                                     </statement>
                                   </block>
                                 </statement>
                               </block>
                             </next>
                           </block>
                         </next>
                       </block>
                     </statement>
                     <value name="IF1">
                       <block type="logic_compare" id="G*TS4Oc%,H-75z*]s52[">
                         <field name="OP">EQ</field>
                         <value name="A">
                           <block type="get_value" id="5-mirSU43!_6|MZbXmcM">
                             <field name="ATTR">val</field>
                             <field name="OID">Meine_Geräte.0.Pumpe</field>
                           </block>
                         </value>
                         <value name="B">
                           <block type="logic_boolean" id="FCW170kZXq(}#*Vjon~Y">
                             <field name="BOOL">FALSE</field>
                           </block>
                         </value>
                       </block>
                     </value>
                     <statement name="DO1">
                       <block type="control" id="fTe;--ugkZnyV1@k(bcj">
                         <mutation delay_input="false"></mutation>
                         <field name="OID">alexa2.0.Smart-Home-Devices.3db51973-22a7-47b0-b6f0-074cd8a6ff68.powerState</field>
                         <field name="WITH_DELAY">FALSE</field>
                         <value name="VALUE">
                           <block type="logic_boolean" id="rd.]b`jaSO}jNYNJiHVo">
                             <field name="BOOL">FALSE</field>
                           </block>
                         </value>
                         <next>
                           <block type="telegram" id="DnLH3$oV2?2+eQp2J^b/">
                             <field name="INSTANCE">.0</field>
                             <field name="LOG"></field>
                             <field name="SILENT">TRUE</field>
                             <field name="PARSEMODE">default</field>
                             <value name="MESSAGE">
                               <shadow type="text" id="Kguwg%a4M77rjw5ZVcji">
                                 <field name="TEXT">Pumpe im Keller ist aus.</field>
                               </shadow>
                             </value>
                           </block>
                         </next>
                       </block>
                     </statement>
                   </block>
                 </statement>
               </block>
              </xml>
              

              dslraser 1 Reply Last reply Reply Quote 0
              • dslraser
                dslraser Forum Testing Most Active @actionbyte last edited by dslraser

                Edit:
                im falschen Beitrag geschrieben....

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

                Support us

                ioBroker
                Community Adapters
                Donate

                786
                Online

                31.9k
                Users

                80.3k
                Topics

                1.3m
                Posts

                5
                6
                292
                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