Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Multimedia abschalten mit rücksetzbare Verzögerung

    NEWS

    • Monatsrückblick – September 2025

    • Neues Video "KI im Smart Home" - ioBroker plus n8n

    • Neues Video über Aliase, virtuelle Geräte und Kategorien

    Multimedia abschalten mit rücksetzbare Verzögerung

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

      Hallo,

      Seit einiger Zeit schlage ich mich mit Blockly rum, komme aber irgendwie mit den Zeitfunktionen/verzögerungen nicht klar. Hier mal mein letzter kläglicher Versuch das umzusetzen:
      2445ef6b-0557-4727-8134-160642cfd34f-image.png

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable type="timeout" id="timeout">timeout</variable>
        </variables>
        <block type="on_ext" id="A=X:{0d[$G+Gmf7AlgyQ" x="-563" y="-637">
          <mutation xmlns="http://www.w3.org/1999/xhtml" items="3"></mutation>
          <field name="CONDITION">ne</field>
          <field name="ACK_CONDITION"></field>
          <value name="OID0">
            <shadow type="field_oid" id="8DWGNY^7/~$(C0CYb%pF">
              <field name="oid">hue.0.Hauptschalter.lastupdated</field>
            </shadow>
          </value>
          <value name="OID1">
            <shadow type="field_oid" id="`ofvx2GAj@ebBgf/Swg`">
              <field name="oid">fb-checkpresence.0.20X.presence</field>
            </shadow>
          </value>
          <value name="OID2">
            <shadow type="field_oid" id="[,RdpN|WeLI6Ui5+IGeR">
              <field name="oid">fb-checkpresence.0.M5.presence</field>
            </shadow>
          </value>
          <statement name="STATEMENT">
            <block type="debug" id=":#EqZ6*yp2pRg7$Dh{)!">
              <field name="Severity">log</field>
              <value name="TEXT">
                <shadow type="text" id="+|2O@J]G?h~+j`%t-Zj$">
                  <field name="TEXT">getriggert</field>
                </shadow>
              </value>
              <next>
                <block type="controls_if" id="9Zk%=YXP(6RZhvV*M1Z_">
                  <mutation elseif="2"></mutation>
                  <value name="IF0">
                    <block type="logic_operation" id="QZW;#86T)8o*,X`Wz#z(" inline="false">
                      <field name="OP">OR</field>
                      <value name="A">
                        <block type="logic_compare" id="zw6OEM,w8^9WtpQKA09n">
                          <field name="OP">EQ</field>
                          <comment pinned="false" h="45" w="156">Hier nog den wert Bewegung rein</comment>
                          <value name="A">
                            <block type="get_value" id="Z*Vf(dG;r6`Urf+cfuxA">
                              <field name="ATTR">val</field>
                              <field name="OID">fb-checkpresence.0.20X.presence</field>
                            </block>
                          </value>
                          <value name="B">
                            <block type="logic_boolean" id="|jLQ*tQbZ*~l@KrxX=vA">
                              <field name="BOOL">FALSE</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <value name="B">
                        <block type="logic_compare" id="x_Z#qb|,`3@EQ]CUX;y{">
                          <field name="OP">EQ</field>
                          <comment pinned="false" h="45" w="156">Hier nog den wert Bewegung rein</comment>
                          <value name="A">
                            <block type="get_value" id="h2X87=Z2e~-|Z0,Q{.8F">
                              <field name="ATTR">val</field>
                              <field name="OID">fb-checkpresence.0.M5.presence</field>
                            </block>
                          </value>
                          <value name="B">
                            <block type="logic_boolean" id="}()m9QL2%s=aW6w!1{RZ">
                              <field name="BOOL">FALSE</field>
                            </block>
                          </value>
                        </block>
                      </value>
                    </block>
                  </value>
                  <statement name="DO0">
                    <block type="timeouts_settimeout" id="e4z(]RSu-d6rE+vH%L?H">
                      <field name="NAME">timeout</field>
                      <field name="DELAY">10</field>
                      <field name="UNIT">sec</field>
                      <statement name="STATEMENT">
                        <block type="debug" id="pRVGpU{)FHz}R#,qV9Sw">
                          <field name="Severity">log</field>
                          <value name="TEXT">
                            <shadow type="text" id="pP[?27NHvdrS?SH.JI~s">
                              <field name="TEXT">Alles verzögert ausschalten</field>
                            </shadow>
                          </value>
                          <next>
                            <block type="comment" id="l@q9:1ju8Aot^?Pa8rvn">
                              <field name="COMMENT">Musik Bad aus</field>
                              <next>
                                <block type="control" id="+mvj}*j^5PL20h.enCT{">
                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                  <field name="OID">musiccast.0.WX-021_08F41523.main.power</field>
                                  <field name="WITH_DELAY">FALSE</field>
                                  <value name="VALUE">
                                    <block type="logic_boolean" id=".^hwgeD3SS%yuIgq3HHh">
                                      <field name="BOOL">FALSE</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="comment" id="S!/F.R4NQ($!+?`{g@T]">
                                      <field name="COMMENT">Musik Schlafen aus</field>
                                      <next>
                                        <block type="control" id="vQ@qgGlCe)=BTq@T9K:}">
                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                          <field name="OID">musiccast.0.WX-021_099AD703.main.power</field>
                                          <field name="WITH_DELAY">FALSE</field>
                                          <value name="VALUE">
                                            <block type="logic_boolean" id="6+Z,nCg5-)nn6gI{_@8g">
                                              <field name="BOOL">FALSE</field>
                                            </block>
                                          </value>
                                          <next>
                                            <block type="comment" id="X/F|cQT7OyiZYpMv|]B5">
                                              <field name="COMMENT">Musik Wohnen aus</field>
                                              <next>
                                                <block type="control" id="W|Rt7oo.3|oH^w0!k,s4">
                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                  <field name="OID">musiccast.0.RX-A1070_0DBCE863.main.power</field>
                                                  <field name="WITH_DELAY">FALSE</field>
                                                  <value name="VALUE">
                                                    <block type="logic_boolean" id="*!ZR+#..TU2O:M(t;B0C">
                                                      <field name="BOOL">FALSE</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </statement>
                    </block>
                  </statement>
                  <value name="IF1">
                    <block type="logic_operation" id="9j9~v,f6!(,}q+Q*$I^Y" inline="false">
                      <field name="OP">OR</field>
                      <value name="A">
                        <block type="logic_compare" id="yQc]LA73DREAg:CUUgeF">
                          <field name="OP">EQ</field>
                          <comment pinned="false" h="45" w="156">Hier nog den wert Bewegung rein</comment>
                          <value name="A">
                            <block type="get_value" id="]9(]Mr5{wgk^3I{oD).W">
                              <field name="ATTR">val</field>
                              <field name="OID">fb-checkpresence.0.20X.presence</field>
                            </block>
                          </value>
                          <value name="B">
                            <block type="logic_boolean" id="piG7SZk(j_`*quM(ymib">
                              <field name="BOOL">TRUE</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <value name="B">
                        <block type="logic_compare" id="=z1Td#+.PHvptA$x#MXs">
                          <field name="OP">EQ</field>
                          <comment pinned="false" h="45" w="156">Hier nog den wert Bewegung rein</comment>
                          <value name="A">
                            <block type="get_value" id="C)H=2BO|7$hN_B+e0ugr">
                              <field name="ATTR">val</field>
                              <field name="OID">fb-checkpresence.0.M5.presence</field>
                            </block>
                          </value>
                          <value name="B">
                            <block type="logic_boolean" id="J1=@.l`ymSn^g%@ikM[e">
                              <field name="BOOL">TRUE</field>
                            </block>
                          </value>
                        </block>
                      </value>
                    </block>
                  </value>
                  <statement name="DO1">
                    <block type="timeouts_cleartimeout" id=")z?9E)5[hn+UK^pv+vSV">
                      <field name="NAME">timeout</field>
                      <next>
                        <block type="debug" id="6f,q7+JU^8=)`CSt8::D">
                          <field name="Severity">log</field>
                          <value name="TEXT">
                            <shadow type="text" id="Io/3fB99j[)f}a-$U0,:">
                              <field name="TEXT">stop timeout</field>
                            </shadow>
                          </value>
                        </block>
                      </next>
                    </block>
                  </statement>
                  <value name="IF2">
                    <block type="logic_compare" id="*Qz%1DHR/{E;Y(*yV?E]">
                      <field name="OP">EQ</field>
                      <comment pinned="false" h="45" w="156">Hier nog den wert Bewegung rein</comment>
                      <value name="A">
                        <block type="get_value" id="1WFT#RrLI)+qr`!4Z_c~">
                          <field name="ATTR">val</field>
                          <field name="OID">hue.0.Hauptschalter.buttonevent</field>
                        </block>
                      </value>
                      <value name="B">
                        <block type="math_number" id="mY.VoWP@nz|iLS48E^nh">
                          <field name="NUM">4002</field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <statement name="DO2">
                    <block type="comment" id="UM-2M%vO%eN@t(m.6U$S">
                      <field name="COMMENT">Musik Bad aus</field>
                      <next>
                        <block type="control" id=",[XMJO8CWw-T`1{Ie56l">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                          <field name="OID">musiccast.0.WX-021_08F41523.main.power</field>
                          <field name="WITH_DELAY">FALSE</field>
                          <value name="VALUE">
                            <block type="logic_boolean" id="z|Nvab]-u/}D?329=@tM">
                              <field name="BOOL">FALSE</field>
                            </block>
                          </value>
                          <next>
                            <block type="comment" id="$0B184mp5d;PKvXM?[nB">
                              <field name="COMMENT">Musik Schlafen aus</field>
                              <next>
                                <block type="control" id="2OiUZYXF4d1s_MkdZ/6s">
                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                  <field name="OID">musiccast.0.WX-021_099AD703.main.power</field>
                                  <field name="WITH_DELAY">FALSE</field>
                                  <value name="VALUE">
                                    <block type="logic_boolean" id="`7xz=JACuCY7#yP!)PIH">
                                      <field name="BOOL">FALSE</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="comment" id="^%vxK,e}6rDzVm*;O9KO">
                                      <field name="COMMENT">Musik Wohnen aus</field>
                                      <next>
                                        <block type="control" id="hROs11nFkncFhjnv#.gB">
                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                          <field name="OID">musiccast.0.RX-A1070_0DBCE863.main.power</field>
                                          <field name="WITH_DELAY">FALSE</field>
                                          <value name="VALUE">
                                            <block type="logic_boolean" id="vScL7iHPDy^ApUmLqF*B">
                                              <field name="BOOL">FALSE</field>
                                            </block>
                                          </value>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </statement>
                </block>
              </next>
            </block>
          </statement>
        </block>
      </xml>
      

      Das Ziel sollte folgendes sein: Wenn P20.presence oder M5.presence false (also ausser Haus) sollen alle Multimediageräte abschalten. Damit die Multimediageräte nicht abgeschalten werden wenn nur kurz mal das WLAN von P20 oder M5 inaktiv ist und somit das auf false wechselt (bei Neustart von P20 oder M5 z.B.) soll das erst 2 Minuten verzögert passieren, aber nicht wenn innerhalb dieser 2 Minuten presence wieder auf true wechselt.

      Der Hauptschalter soll, egal ob P20 und M5.presence true oder false sind, ohne Verzögerung abschalten.

      Wo muss ich nun den Timeout und stop timeut setzen damit das so funktioniert?

      Danke

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

        @urs sagte: Der Hauptschalter soll, egal ob P20 und M5.presence true oder false sind, ohne Verzögerung abschalten.

        Dann verwende dafür einen separaten Trigger-Block.

        @urs sagte in Multimedia abschalten mit rücksetzbare Verzögerung:

        nicht wenn innerhalb dieser 2 Minuten presence wieder auf true wechselt.

        Bild_2021-04-30_134308.png

        <xml xmlns="https://developers.google.com/blockly/xml">
         <variables>
           <variable type="timeout" id="timeout">timeout</variable>
         </variables>
         <block type="on_ext" id="A=X:{0d[$G+Gmf7AlgyQ" x="-180" y="-1029">
           <mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation>
           <field name="CONDITION">ne</field>
           <field name="ACK_CONDITION"></field>
           <value name="OID0">
             <shadow type="field_oid" id="Xv8O59%mU`8as#A?!0C%">
               <field name="oid">hue.0.Hauptschalter.lastupdated</field>
             </shadow>
             <block type="text" id="UMcjnf|cC.kFvc9t+x%9">
               <field name="TEXT">fb-checkpresence.0.M5.presence</field>
             </block>
           </value>
           <value name="OID1">
             <shadow type="field_oid" id="@DgBoXMi@kP1oCqR.L_/">
               <field name="oid">fb-checkpresence.0.20X.presence</field>
             </shadow>
           </value>
           <statement name="STATEMENT">
             <block type="debug" id=":#EqZ6*yp2pRg7$Dh{)!">
               <field name="Severity">log</field>
               <value name="TEXT">
                 <shadow type="text" id="+|2O@J]G?h~+j`%t-Zj$">
                   <field name="TEXT">getriggert</field>
                 </shadow>
               </value>
               <next>
                 <block type="controls_if" id="9Zk%=YXP(6RZhvV*M1Z_">
                   <mutation else="1"></mutation>
                   <value name="IF0">
                     <block type="logic_operation" id="QZW;#86T)8o*,X`Wz#z(" inline="false">
                       <field name="OP">OR</field>
                       <value name="A">
                         <block type="get_value" id="Z*Vf(dG;r6`Urf+cfuxA">
                           <field name="ATTR">val</field>
                           <field name="OID">fb-checkpresence.0.20X.presence</field>
                         </block>
                       </value>
                       <value name="B">
                         <block type="get_value" id="h2X87=Z2e~-|Z0,Q{.8F">
                           <field name="ATTR">val</field>
                           <field name="OID">fb-checkpresence.0.M5.presence</field>
                         </block>
                       </value>
                     </block>
                   </value>
                   <statement name="DO0">
                     <block type="timeouts_cleartimeout" id=")z?9E)5[hn+UK^pv+vSV">
                       <field name="NAME">timeout</field>
                       <next>
                         <block type="debug" id="6f,q7+JU^8=)`CSt8::D">
                           <field name="Severity">log</field>
                           <value name="TEXT">
                             <shadow type="text" id="Io/3fB99j[)f}a-$U0,:">
                               <field name="TEXT">stop timeout</field>
                             </shadow>
                           </value>
                         </block>
                       </next>
                     </block>
                   </statement>
                   <statement name="ELSE">
                     <block type="timeouts_settimeout" id="e4z(]RSu-d6rE+vH%L?H">
                       <field name="NAME">timeout</field>
                       <field name="DELAY">10</field>
                       <field name="UNIT">sec</field>
                       <statement name="STATEMENT">
                         <block type="debug" id="pRVGpU{)FHz}R#,qV9Sw">
                           <field name="Severity">log</field>
                           <value name="TEXT">
                             <shadow type="text" id="pP[?27NHvdrS?SH.JI~s">
                               <field name="TEXT">Alles verzögert ausschalten</field>
                             </shadow>
                           </value>
                           <next>
                             <block type="procedures_callnoreturn" id="jH`OS~6_^$ukX5{T:@Xd">
                               <mutation name="ausschalten"></mutation>
                             </block>
                           </next>
                         </block>
                       </statement>
                     </block>
                   </statement>
                 </block>
               </next>
             </block>
           </statement>
           <next>
             <block type="on_ext" id="@~a^xLiZ~O3wt[~wLCW0">
               <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="13(0kU5;}xS8O$aH@?;+">
                   <field name="oid">default</field>
                 </shadow>
                 <block type="text" id="d^+d]yAg3~i)GSTv%LC~">
                   <field name="TEXT">hue.0.Hauptschalter.buttonevent</field>
                 </block>
               </value>
               <statement name="STATEMENT">
                 <block type="controls_if" id="[4@2K=)-Tx#lNr+b@bd*">
                   <value name="IF0">
                     <block type="logic_compare" id="*Qz%1DHR/{E;Y(*yV?E]">
                       <field name="OP">EQ</field>
                       <comment pinned="false" h="45" w="156">Hier nog den wert Bewegung rein</comment>
                       <value name="A">
                         <block type="on_source" id="sACSBh~Qx^o$VhSBb*%6">
                           <field name="ATTR">state.val</field>
                         </block>
                       </value>
                       <value name="B">
                         <block type="math_number" id="mY.VoWP@nz|iLS48E^nh">
                           <field name="NUM">4002</field>
                         </block>
                       </value>
                     </block>
                   </value>
                   <statement name="DO0">
                     <block type="procedures_callnoreturn" id="nI+J:gFA0+m^LVRX55;V">
                       <mutation name="ausschalten"></mutation>
                     </block>
                   </statement>
                 </block>
               </statement>
             </block>
           </next>
         </block>
         <block type="procedures_defnoreturn" id="$h%;q1SO!Ip`_BjOvT}|" x="188" y="-513">
           <field name="NAME">ausschalten</field>
           <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
           <statement name="STACK">
             <block type="comment" id="l@q9:1ju8Aot^?Pa8rvn">
               <field name="COMMENT">Musik Bad aus</field>
               <next>
                 <block type="control" id="+mvj}*j^5PL20h.enCT{">
                   <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                   <field name="OID">musiccast.0.WX-021_08F41523.main.power</field>
                   <field name="WITH_DELAY">FALSE</field>
                   <value name="VALUE">
                     <block type="logic_boolean" id=".^hwgeD3SS%yuIgq3HHh">
                       <field name="BOOL">FALSE</field>
                     </block>
                   </value>
                   <next>
                     <block type="comment" id="S!/F.R4NQ($!+?`{g@T]">
                       <field name="COMMENT">Musik Schlafen aus</field>
                       <next>
                         <block type="control" id="vQ@qgGlCe)=BTq@T9K:}">
                           <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                           <field name="OID">musiccast.0.WX-021_099AD703.main.power</field>
                           <field name="WITH_DELAY">FALSE</field>
                           <value name="VALUE">
                             <block type="logic_boolean" id="6+Z,nCg5-)nn6gI{_@8g">
                               <field name="BOOL">FALSE</field>
                             </block>
                           </value>
                           <next>
                             <block type="comment" id="X/F|cQT7OyiZYpMv|]B5">
                               <field name="COMMENT">Musik Wohnen aus</field>
                               <next>
                                 <block type="control" id="W|Rt7oo.3|oH^w0!k,s4">
                                   <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                   <field name="OID">musiccast.0.RX-A1070_0DBCE863.main.power</field>
                                   <field name="WITH_DELAY">FALSE</field>
                                   <value name="VALUE">
                                     <block type="logic_boolean" id="*!ZR+#..TU2O:M(t;B0C">
                                       <field name="BOOL">FALSE</field>
                                     </block>
                                   </value>
                                 </block>
                               </next>
                             </block>
                           </next>
                         </block>
                       </next>
                     </block>
                   </next>
                 </block>
               </next>
             </block>
           </statement>
         </block>
        </xml>
        

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

          @paul53 Vielen Dank. Damit bin ich weiter gekommen

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

          Support us

          ioBroker
          Community Adapters
          Donate

          650
          Online

          32.2k
          Users

          80.8k
          Topics

          1.3m
          Posts

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