Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Wiederholen von Befehlen. Wie geht das

    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

    Wiederholen von Befehlen. Wie geht das

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

      Sorry, verstehe ich nicht. Gezeigt ist ja nur der Timeout für einen Befehl. Was soll ich mit dem zweiten machen?

      Ich habe zwei Screenshots gepostet, welcher ist jetzt der richtige Weg?

      paul53 1 Reply Last reply Reply Quote 0
      • paul53
        paul53 @G.Hawk last edited by

        @Martin-0 sagte:

        Gezeigt ist ja nur der Timeout für einen Befehl

        Das ist nicht ein Befehl, sondern der Aufruf einer Funktion, die wiederum alles enthält, was in der ersten Version vor dem Timeout und dann im Timeout passiert.

        Vorgehen: Du erstellst eine Funktion, verschiebst alles, was innerhalb des Timeouts ist, in die Funktion und in das leere Timeout kommt dann der Funktionsaufruf. Die Alexa-Befehle über dem Timeout werden dann durch einen weiteren Funktionsaufruf ersetzt.

        1 Reply Last reply Reply Quote 0
        • G
          G.Hawk last edited by

          Anmerkung 2019-12-11 174032.png

          1 Reply Last reply Reply Quote 0
          • G
            G.Hawk last edited by

            Oder

            so:

            2019-12-11 174032.png

            paul53 1 Reply Last reply Reply Quote 0
            • paul53
              paul53 @G.Hawk last edited by paul53

              @Martin-0 sagte:

              Oder
              so:

              Beide Varianten unterscheiden sich im Ergebnis nicht, allerdings würde ich die zweite Variante mit nur einem Timeout bevorzugen.

              Poste mal den XML-Export des Blocklys (mit nur einem Timeout) in Code tags. Dann kann ich es leicht modifizieren und zurück schicken.

              1 Reply Last reply Reply Quote 0
              • G
                G.Hawk last edited by G.Hawk

                var timeout;

                schedule('{"time":{"exactTime":true,"start":"23:00"},"period":{"days":1}}', function () {
                if (getState("hm-rpc.0.JEQ0068443.1.STATE").val == true) {
                // Echo Wohnzimmer
                // mit Bluetooth
                if (getState("alexa2.0.Echo-Devices.G090U509847625MD.Bluetooth.3db393472f177440184a264d10ab21eaa3a40b727da721dacafdc36d7c924828.connected").val == true) {
                setState("alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak-volume"/Volume to use for speak commands/, '100');
                setState("alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak"/speak/, 'Sicherheitswarnung. Das Garagentor ist noch geöffnet');
                } else {
                setState("alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak-volume"/Volume to use for speak commands/, '80');
                setState("alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak"/speak/, 'Sicherheitswarnung. Das Garagentor ist noch geöffnet');
                }
                // Echo Badezimmer
                setState("alexa2.0.Echo-Devices.G090U50984653CEF.Commands.speak"/speak/, 'Sicherheitswarnung. Das Garagentor ist noch geöffnet');
                // Echo Wintergarten rechts
                setState("alexa2.0.Echo-Devices.G090U50991860QSL.Commands.speak-volume"/Volume to use for speak commands/, '50');
                setState("alexa2.0.Echo-Devices.G090U50991860QSL.Commands.speak"/speak/, 'Sicherheitswarnung. Das Garagentor ist noch geöffnet');
                // Echo Werkstatt
                setState("alexa2.0.Echo-Devices.G090XG07930531PU.Commands.speak"/speak/, 'Sicherheitswarnung. Das Garagentor ist noch geöffnet');
                // Echo Schlafzimmer
                setState("alexa2.0.Echo-Devices.G090U50784360US6.Commands.speak-volume"/Volume to use for speak commands/, '40');
                setState("alexa2.0.Echo-Devices.G090U50784360US6.Commands.speak"/speak/, 'Sicherheitswarnung. Das Garagentor ist noch geöffnet');
                timeout = setTimeout(function () {
                // Echo Wohnzimmer
                if (getState("alexa2.0.Echo-Devices.G090U509847625MD.Bluetooth.3db393472f177440184a264d10ab21eaa3a40b727da721dacafdc36d7c924828.connected").val == true) {
                setState("alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak-volume"/Volume to use for speak commands/, '100');
                setState("alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak"/speak/, 'Sicherheitswarnung. Das Garagentor ist noch geöffnet');
                } else {
                setState("alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak-volume"/Volume to use for speak commands/, '80');
                setState("alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak"/speak/, 'Sicherheitswarnung. Das Garagentor ist noch geöffnet');
                }
                // Echo Badezimmer
                setState("alexa2.0.Echo-Devices.G090U50984653CEF.Commands.speak"/speak/, 'Sicherheitswarnung. Das Garagentor ist noch geöffnet');
                // Echo Wintergarten rechts
                setState("alexa2.0.Echo-Devices.G090U50991860QSL.Commands.speak-volume"/Volume to use for speak commands/, '50');
                setState("alexa2.0.Echo-Devices.G090U50991860QSL.Commands.speak"/speak/, 'Sicherheitswarnung. Das Garagentor ist noch geöffnet');
                // Echo Werkstatt
                setState("alexa2.0.Echo-Devices.G090XG07930531PU.Commands.speak"/speak/, 'Sicherheitswarnung. Das Garagentor ist noch geöffnet');
                // Echo Schlafzimmer
                setState("alexa2.0.Echo-Devices.G090U50784360US6.Commands.speak-volume"/Volume to use for speak commands/, '40');
                setState("alexa2.0.Echo-Devices.G090U50784360US6.Commands.speak"/speak/, 'Sicherheitswarnung. Das Garagentor ist noch geöffnet');
                }, 10000);
                }
                });

                paul53 1 Reply Last reply Reply Quote 0
                • paul53
                  paul53 @G.Hawk last edited by

                  @Martin-0
                  Das ist nicht der XML-Export von Blockly, sondern der erzeugte Javascript-Code. Das linke Symbol oben rechts erzeugt den Export. Bitte in Code tags (</> Symbol oben) posten.

                  1 Reply Last reply Reply Quote 0
                  • G
                    G.Hawk last edited by

                    <xml xmlns="http://www.w3.org/1999/xhtml">
                    <variables>
                    <variable type="undefined" id="timeout">timeout</variable>
                    </variables>
                    <block type="schedule" id="I4$lt{y={6ktxUOFUAUp" x="-1062" y="-988">
                    <field name="SCHEDULE">{"time":{"exactTime":true,"start":"23:00"},"period":{"days":1}}</field>
                    <statement name="STATEMENT">
                    <block type="controls_if" id="+5B75]y|H0xaV^k}nzN#">
                    <value name="IF0">
                    <block type="logic_compare" id=":g^t/wOP@Eyn8Ps}y*;:">
                    <field name="OP">EQ</field>
                    <value name="A">
                    <block type="get_value" id="K[j1v-@LyMurc%MVd:Qj">
                    <field name="ATTR">val</field>
                    <field name="OID">hm-rpc.0.JEQ0068443.1.STATE</field>
                    </block>
                    </value>
                    <value name="B">
                    <block type="logic_boolean" id="CGp0Xup1{gaa=LN-p)V">
                    <field name="BOOL">TRUE</field>
                    </block>
                    </value>
                    </block>
                    </value>
                    <statement name="DO0">
                    <block type="comment" id="#a6CqObU980oj_+jN;va">
                    <field name="COMMENT">Echo Wohnzimmer</field>
                    <next>
                    <block type="comment" id="~MfNhQGcG5-eodj/Ag$/">
                    <field name="COMMENT">mit Bluetooth</field>
                    <next>
                    <block type="controls_if" id="Sa@D_Q}pR0un/ZL#_g5Y">
                    <mutation else="1"></mutation>
                    <value name="IF0">
                    <block type="logic_compare" id=")5oGRI;zacH
                    W%(xtMCA">
                    <field name="OP">EQ</field>
                    <value name="A">
                    <block type="get_value" id="%L!7BNil_:j$$v-/HB5;">
                    <field name="ATTR">val</field>
                    <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Bluetooth.3db393472f177440184a264d10ab21eaa3a40b727da721dacafdc36d7c924828.connected</field>
                    </block>
                    </value>
                    <value name="B">
                    <block type="logic_boolean" id="r3RrA0!BG9HErLI10+Gi">
                    <field name="BOOL">TRUE</field>
                    </block>
                    </value>
                    </block>
                    </value>
                    <statement name="DO0">
                    <block type="control" id="YN/F]|V8jV^q2^rkjfq">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak-volume</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                    <block type="text" id="ssnF/8[n]OT}5q_NF1fC">
                    <field name="TEXT">100</field>
                    </block>
                    </value>
                    <next>
                    <block type="control" id="1kd^IJMa~xjhk/in4g/"> <mutation delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text" id="2wFdJ]Ku|O=k-t(mi~s}"> <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field> </block> </value> </block> </next> </block> </statement> <statement name="ELSE"> <block type="control" id="456o(v0t,!9Pty]^$Nab"> <mutation delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak-volume</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text" id="]L]{t#x=u%j]%;m18k^t"> <field name="TEXT">80</field> </block> </value> <next> <block type="control" id=";QN|_Yq9@aD[a*_C{ukc"> <mutation delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text" id="x%H-#:N03mu2ABh1sA1">
                    <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field>
                    </block>
                    </value>
                    </block>
                    </next>
                    </block>
                    </statement>
                    <next>
                    <block type="comment" id="v[0Drg.U
                    64ZRqvA;=5"> <field name="COMMENT">Echo Badezimmer</field> <next> <block type="control" id="HSi=j(%sTDAKr?##.xd">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">alexa2.0.Echo-Devices.G090U50984653CEF.Commands.speak</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                    <block type="text" id="U~W8VXo$DkbtBSgtE7?c">
                    <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field>
                    </block>
                    </value>
                    <next>
                    <block type="comment" id="5vVI?(=4i),Vx@;%[4~">
                    <field name="COMMENT">Echo Wintergarten rechts</field>
                    <next>
                    <block type="control" id=".;a7k%koIj1$Og=qj[?y">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">alexa2.0.Echo-Devices.G090U50991860QSL.Commands.speak-volume</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                    <block type="text" id="5iFhLmvjYvFqy3RaE(N">
                    <field name="TEXT">50</field>
                    </block>
                    </value>
                    <next>
                    <block type="control" id="E)s;fE+FKe;OmVJ6HH!Q">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">alexa2.0.Echo-Devices.G090U50991860QSL.Commands.speak</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                    <block type="text" id="OyH6w3SSbrse9@K1O0p7">
                    <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field>
                    </block>
                    </value>
                    <next>
                    <block type="comment" id="4N%z;b.Vph^QV}:].I3]">
                    <field name="COMMENT">Echo Werkstatt</field>
                    <next>
                    <block type="control" id="sXob%i4YEM-H@#wn|gns">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">alexa2.0.Echo-Devices.G090XG07930531PU.Commands.speak</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                    <block type="text" id="0PS%cft}7288H.C#]26D">
                    <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field>
                    </block>
                    </value>
                    <next>
                    <block type="comment" id="^H8jD(8nqF(j)gz:y?P"> <field name="COMMENT">Echo Schlafzimmer</field> <next> <block type="control" id="#2~KZ2gr5;Aw,$Nvh,jj"> <mutation delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G090U50784360US6.Commands.speak-volume</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text" id="@ob#{]|aCDU2-he=FE,k"> <field name="TEXT">40</field> </block> </value> <next> <block type="control" id="nJzG=cD{s|=u7[a7^wPL"> <mutation delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G090U50784360US6.Commands.speak</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text" id="yMG?ET?+@ku@wk2:BA1H"> <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field> </block> </value> <next> <block type="timeouts_settimeout" id="^MQc)RrII$IK?vh7[oBh"> <field name="NAME">timeout</field> <field name="DELAY">10</field> <field name="UNIT">sec</field> <statement name="STATEMENT"> <block type="comment" id="CazBpF8s^39B=V2!u|(P"> <field name="COMMENT">Echo Wohnzimmer</field> <next> <block type="controls_if" id="hZ~V,z25PwxAgScWkEG5"> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_compare" id="}V^09Y3*p=0?g^!t8WIn"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="a+yjeHL8Bq
                    .Gw,Ooru">
                    <field name="ATTR">val</field>
                    <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Bluetooth.3db393472f177440184a264d10ab21eaa3a40b727da721dacafdc36d7c924828.connected</field>
                    </block>
                    </value>
                    <value name="B">
                    <block type="logic_boolean" id="iL;.^qKRI/EvT__-ijX0">
                    <field name="BOOL">TRUE</field>
                    </block>
                    </value>
                    </block>
                    </value>
                    <statement name="DO0">
                    <block type="control" id="o1v=umqvl[o$Cv|;f]S-">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak-volume</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                    <block type="text" id="i3ku|QIY+,p5sKUz$tok">
                    <field name="TEXT">100</field>
                    </block>
                    </value>
                    <next>
                    <block type="control" id="N/JW|@/%ImTm,eNq6On,">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                    <block type="text" id="{AiP(D{1D[#^P@^BYu3"> <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field> </block> </value> </block> </next> </block> </statement> <statement name="ELSE"> <block type="control" id="M%o@@T68jp?jm4shN%!b"> <mutation delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak-volume</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text" id="?%K^o[D*RD1O7/dctrsL"> <field name="TEXT">80</field> </block> </value> <next> <block type="control" id="bof(^Kc6*HkP+s:j[6#_"> <mutation delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text" id="Zg.26|*7@*QXlQ0+s:j0"> <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field> </block> </value> </block> </next> </block> </statement> <next> <block type="comment" id="})*dm=K.%!t}u%{{lOOo"> <field name="COMMENT">Echo Badezimmer</field> <next> <block type="control" id="=Bdy1/j[B-XGezQyz^hF"> <mutation delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G090U50984653CEF.Commands.speak</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text" id="S|yEcx6C#zvb-j)/k27">
                    <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field>
                    </block>
                    </value>
                    <next>
                    <block type="comment" id="I7D#-CK31A(.9PL{OIrS">
                    <field name="COMMENT">Echo Wintergarten rechts</field>
                    <next>
                    <block type="control" id="N-z_H{7CHOH?f6BF_fBH">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">alexa2.0.Echo-Devices.G090U50991860QSL.Commands.speak-volume</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                    <block type="text" id="Y[**e(JPeIK`iIvbIrOt">
                    <field name="TEXT">50</field>
                    </block>
                    </value>
                    <next>
                    <block type="control" id="T8r(PQcs.=m8,Z37N;-y">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">alexa2.0.Echo-Devices.G090U50991860QSL.Commands.speak</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                    <block type="text" id="~z
                    $.B^I!-OrhLnIM{H6">
                    <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field>
                    </block>
                    </value>
                    <next>
                    <block type="comment" id="h7VHm$s|m_^_/_nyScx.">
                    <field name="COMMENT">Echo Werkstatt</field>
                    <next>
                    <block type="control" id="YEdU^w}S1+:gN%81VAQ@">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">alexa2.0.Echo-Devices.G090XG07930531PU.Commands.speak</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                    <block type="text" id="Z+dfSsT@UU6foNz|/p+d">
                    <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field>
                    </block>
                    </value>
                    <next>
                    <block type="comment" id="F1(av/Fq.7jObTX.yG[">
                    <field name="COMMENT">Echo Schlafzimmer</field>
                    <next>
                    <block type="control" id="Nj@c?9:P,d?puaw0vMfz">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">alexa2.0.Echo-Devices.G090U50784360US6.Commands.speak-volume</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                    <block type="text" id="m!!hO]X%6vvn=%DIjF}">
                    <field name="TEXT">40</field>
                    </block>
                    </value>
                    <next>
                    <block type="control" id="J?BofaiaB2V!fQ$cGc3^">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">alexa2.0.Echo-Devices.G090U50784360US6.Commands.speak</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                    <block type="text" id="4S
                    9Zmgr#-y
                    nXmvr7yY">
                    <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field>
                    </block>
                    </value>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </statement>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </next>
                    </block>
                    </statement>
                    </block>
                    </statement>
                    </block>
                    </xml>

                    paul53 1 Reply Last reply Reply Quote 0
                    • paul53
                      paul53 @G.Hawk last edited by

                      @Martin-0
                      Hier mit Funktion zum Importieren.

                      <xml xmlns="http://www.w3.org/1999/xhtml">
                       <variables>
                         <variable type="undefined" id="timeout">timeout</variable>
                       </variables>
                       <block type="schedule" id="I4$lt{y={6ktxUOFUAUp" x="-1412" y="-262">
                         <field name="SCHEDULE">{"time":{"exactTime":true,"start":"23:00"},"period":{"days":1}}</field>
                         <statement name="STATEMENT">
                           <block type="controls_if" id="+5B75]y|H0xaV^k}nzN#">
                             <value name="IF0">
                               <block type="logic_compare" id=":g^t/wOP@Eyn8Ps}y*;:">
                                 <field name="OP">EQ</field>
                                 <value name="A">
                                   <block type="get_value" id="K[j1v-@LyMurc%MVd:Qj">
                                     <field name="ATTR">val</field>
                                     <field name="OID">hm-rpc.0.JEQ0068443.1.STATE</field>
                                   </block>
                                 </value>
                                 <value name="B">
                                   <block type="logic_boolean" id="CGp0Xup1{gaa=LN-p)V">
                                     <field name="BOOL">TRUE</field>
                                   </block>
                                 </value>
                               </block>
                             </value>
                             <statement name="DO0">
                               <block type="procedures_callnoreturn" id="w4~^`UYw#c/AZ16*;^2/">
                                 <mutation name="ansagen"></mutation>
                                 <next>
                                   <block type="timeouts_settimeout" id="^MQc)RrII$IK?vh7[oBh">
                                     <field name="NAME">timeout</field>
                                     <field name="DELAY">15</field>
                                     <field name="UNIT">sec</field>
                                     <statement name="STATEMENT">
                                       <block type="procedures_callnoreturn" id="j8Oy$h)lMTDBgfh%5,uK">
                                         <mutation name="ansagen"></mutation>
                                       </block>
                                     </statement>
                                   </block>
                                 </next>
                               </block>
                             </statement>
                           </block>
                         </statement>
                       </block>
                       <block type="procedures_defnoreturn" id="y~$bl!}zW6vkdw}!z!~Q" x="-1013" y="-137">
                         <field name="NAME">ansagen</field>
                         <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
                         <statement name="STACK">
                           <block type="comment" id="CazBpF8s^39B=V2!u|(P">
                             <field name="COMMENT">Echo Wohnzimmer</field>
                             <next>
                               <block type="controls_if" id="hZ~V,z25PwxAgScWkEG5">
                                 <mutation else="1"></mutation>
                                 <value name="IF0">
                                   <block type="logic_compare" id="}V^09Y3*p=0?g^!t8WIn">
                                     <field name="OP">EQ</field>
                                     <value name="A">
                                       <block type="get_value" id="a+yjeHL8Bq.Gw,Ooru">
                                         <field name="ATTR">val</field>
                                         <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Bluetooth.3db393472f177440184a264d10ab21eaa3a40b727da721dacafdc36d7c924828.connected</field>
                                       </block>
                                     </value>
                                     <value name="B">
                                       <block type="logic_boolean" id="iL;.^qKRI/EvT__-ijX0">
                                         <field name="BOOL">TRUE</field>
                                       </block>
                                     </value>
                                   </block>
                                 </value>
                                 <statement name="DO0">
                                   <block type="control" id="o1v=umqvl[o$Cv|;f]S-">
                                     <mutation delay_input="false"></mutation>
                                     <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak-volume</field>
                                     <field name="WITH_DELAY">FALSE</field>
                                     <value name="VALUE">
                                       <block type="text" id="i3ku|QIY+,p5sKUz$tok">
                                         <field name="TEXT">100</field>
                                       </block>
                                     </value>
                                     <next>
                                       <block type="control" id="N/JW|@/%ImTm,eNq6On,">
                                         <mutation delay_input="false"></mutation>
                                         <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak</field>
                                         <field name="WITH_DELAY">FALSE</field>
                                         <value name="VALUE">
                                           <block type="text" id="{AiP(D{1D[#^P@^BYu3">
                                             <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field>
                                           </block>
                                         </value>
                                       </block>
                                     </next>
                                   </block>
                                 </statement>
                                 <statement name="ELSE">
                                   <block type="control" id="M%o@@T68jp?jm4shN%!b">
                                     <mutation delay_input="false"></mutation>
                                     <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak-volume</field>
                                     <field name="WITH_DELAY">FALSE</field>
                                     <value name="VALUE">
                                       <block type="text" id="?%K^o[D*RD1O7/dctrsL">
                                         <field name="TEXT">80</field>
                                       </block>
                                     </value>
                                     <next>
                                       <block type="control" id="bof(^Kc6*HkP+s:j[6#_">
                                         <mutation delay_input="false"></mutation>
                                         <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak</field>
                                         <field name="WITH_DELAY">FALSE</field>
                                         <value name="VALUE">
                                           <block type="text" id="Zg.26|*7@*QXlQ0+s:j0">
                                             <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field>
                                           </block>
                                         </value>
                                       </block>
                                     </next>
                                   </block>
                                 </statement>
                                 <next>
                                   <block type="comment" id="})*dm=K.%!t}u%{{lOOo">
                                     <field name="COMMENT">Echo Badezimmer</field>
                                     <next>
                                       <block type="control" id="=Bdy1/j[B-XGezQyz^hF">
                                         <mutation delay_input="false"></mutation>
                                         <field name="OID">alexa2.0.Echo-Devices.G090U50984653CEF.Commands.speak</field>
                                         <field name="WITH_DELAY">FALSE</field>
                                         <value name="VALUE">
                                           <block type="text" id="S|yEcx6C#zvb-j)/k27">
                                             <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field>
                                           </block>
                                         </value>
                                         <next>
                                           <block type="comment" id="I7D#-CK31A(.9PL{OIrS">
                                             <field name="COMMENT">Echo Wintergarten rechts</field>
                                             <next>
                                               <block type="control" id="N-z_H{7CHOH?f6BF_fBH">
                                                 <mutation delay_input="false"></mutation>
                                                 <field name="OID">alexa2.0.Echo-Devices.G090U50991860QSL.Commands.speak-volume</field>
                                                 <field name="WITH_DELAY">FALSE</field>
                                                 <value name="VALUE">
                                                   <block type="text" id="Y[**e(JPeIK`iIvbIrOt">
                                                     <field name="TEXT">50</field>
                                                   </block>
                                                 </value>
                                                 <next>
                                                   <block type="control" id="T8r(PQcs.=m8,Z37N;-y">
                                                     <mutation delay_input="false"></mutation>
                                                     <field name="OID">alexa2.0.Echo-Devices.G090U50991860QSL.Commands.speak</field>
                                                     <field name="WITH_DELAY">FALSE</field>
                                                     <value name="VALUE">
                                                       <block type="text" id="~z$.B^I!-OrhLnIM{H6">
                                                         <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field>
                                                       </block>
                                                     </value>
                                                     <next>
                                                       <block type="comment" id="h7VHm$s|m_^_/_nyScx.">
                                                         <field name="COMMENT">Echo Werkstatt</field>
                                                         <next>
                                                           <block type="control" id="YEdU^w}S1+:gN%81VAQ@">
                                                             <mutation delay_input="false"></mutation>
                                                             <field name="OID">alexa2.0.Echo-Devices.G090XG07930531PU.Commands.speak</field>
                                                             <field name="WITH_DELAY">FALSE</field>
                                                             <value name="VALUE">
                                                               <block type="text" id="Z+dfSsT@UU6foNz|/p+d">
                                                                 <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field>
                                                               </block>
                                                             </value>
                                                             <next>
                                                               <block type="comment" id="F1(av/Fq.7jObTX.yG[">
                                                                 <field name="COMMENT">Echo Schlafzimmer</field>
                                                                 <next>
                                                                   <block type="control" id="Nj@c?9:P,d?puaw0vMfz">
                                                                     <mutation delay_input="false"></mutation>
                                                                     <field name="OID">alexa2.0.Echo-Devices.G090U50784360US6.Commands.speak-volume</field>
                                                                     <field name="WITH_DELAY">FALSE</field>
                                                                     <value name="VALUE">
                                                                       <block type="text" id="m!!hO]X%6vvn=%DIjF}">
                                                                         <field name="TEXT">40</field>
                                                                       </block>
                                                                     </value>
                                                                     <next>
                                                                       <block type="control" id="J?BofaiaB2V!fQ$cGc3^">
                                                                         <mutation delay_input="false"></mutation>
                                                                         <field name="OID">alexa2.0.Echo-Devices.G090U50784360US6.Commands.speak</field>
                                                                         <field name="WITH_DELAY">FALSE</field>
                                                                         <value name="VALUE">
                                                                           <block type="text" id="4S9Zmgr#-ynXmvr7yY">
                                                                             <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field>
                                                                           </block>
                                                                         </value>
                                                                       </block>
                                                                     </next>
                                                                   </block>
                                                                 </next>
                                                               </block>
                                                             </next>
                                                           </block>
                                                         </next>
                                                       </block>
                                                     </next>
                                                   </block>
                                                 </next>
                                               </block>
                                             </next>
                                           </block>
                                         </next>
                                       </block>
                                     </next>
                                   </block>
                                 </next>
                               </block>
                             </next>
                           </block>
                         </statement>
                       </block>
                      </xml>
                      

                      1 Reply Last reply Reply Quote 0
                      • G
                        G.Hawk last edited by

                        Das sieht ja super aus.
                        Also ich mache das ganze seit Vorgestern, deshalb noch etwas holprig.

                        Ich habe mir das jetzt mal angeschaut.

                        Sind die "ansagen" jetzt dadurch verknüpft, dass die jeweils in den Textfeldern stehen?
                        Da muss ich ja garnicht jedesmal den Befehl überall reinschreiben, sondern kann das benennen und dann einfügen, richtig?

                        paul53 1 Reply Last reply Reply Quote 0
                        • paul53
                          paul53 @G.Hawk last edited by paul53

                          @Martin-0 sagte in Wiederholen von Befehlen. Wie geht das:

                          Da muss ich ja garnicht jedesmal den Befehl überall reinschreiben, sondern kann das benennen und dann einfügen

                          Da der Ansagetext überall gleich ist, habe ich eine Variante mit Variable erstellt.

                          <xml xmlns="http://www.w3.org/1999/xhtml">
                           <variables>
                             <variable type="" id="B:u)*5n*7e-b$$/6xA5S">ansage</variable>
                             <variable type="undefined" id="timeout">timeout</variable>
                           </variables>
                           <block type="schedule" id="I4$lt{y={6ktxUOFUAUp" x="-1412" y="-262">
                             <field name="SCHEDULE">{"time":{"exactTime":true,"start":"23:00"},"period":{"days":1}}</field>
                             <statement name="STATEMENT">
                               <block type="controls_if" id="+5B75]y|H0xaV^k}nzN#">
                                 <value name="IF0">
                                   <block type="logic_compare" id=":g^t/wOP@Eyn8Ps}y*;:">
                                     <field name="OP">EQ</field>
                                     <value name="A">
                                       <block type="get_value" id="K[j1v-@LyMurc%MVd:Qj">
                                         <field name="ATTR">val</field>
                                         <field name="OID">hm-rpc.0.JEQ0068443.1.STATE</field>
                                       </block>
                                     </value>
                                     <value name="B">
                                       <block type="logic_boolean" id="CGp0Xup1{gaa=LN-p)V">
                                         <field name="BOOL">TRUE</field>
                                       </block>
                                     </value>
                                   </block>
                                 </value>
                                 <statement name="DO0">
                                   <block type="procedures_callnoreturn" id="w4~^`UYw#c/AZ16*;^2/">
                                     <mutation name="ansagen"></mutation>
                                     <next>
                                       <block type="timeouts_settimeout" id="^MQc)RrII$IK?vh7[oBh">
                                         <field name="NAME">timeout</field>
                                         <field name="DELAY">15</field>
                                         <field name="UNIT">sec</field>
                                         <statement name="STATEMENT">
                                           <block type="procedures_callnoreturn" id="j8Oy$h)lMTDBgfh%5,uK">
                                             <mutation name="ansagen"></mutation>
                                           </block>
                                         </statement>
                                       </block>
                                     </next>
                                   </block>
                                 </statement>
                               </block>
                             </statement>
                           </block>
                           <block type="procedures_defnoreturn" id="y~$bl!}zW6vkdw}!z!~Q" x="-1013" y="-137">
                             <field name="NAME">ansagen</field>
                             <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
                             <statement name="STACK">
                               <block type="variables_set" id="W|IJXCI4558gbk(A5N9B">
                                 <field name="VAR" id="B:u)*5n*7e-b$$/6xA5S" variabletype="">ansage</field>
                                 <value name="VALUE">
                                   <block type="text" id="{AiP(D{1D[#^P@^BYu3">
                                     <field name="TEXT">Sicherheitswarnung. Das Garagentor ist noch geöffnet</field>
                                   </block>
                                 </value>
                                 <next>
                                   <block type="comment" id="CazBpF8s^39B=V2!u|(P">
                                     <field name="COMMENT">Echo Wohnzimmer</field>
                                     <next>
                                       <block type="controls_if" id="hZ~V,z25PwxAgScWkEG5">
                                         <mutation else="1"></mutation>
                                         <value name="IF0">
                                           <block type="logic_compare" id="}V^09Y3*p=0?g^!t8WIn">
                                             <field name="OP">EQ</field>
                                             <value name="A">
                                               <block type="get_value" id="a+yjeHL8Bq.Gw,Ooru">
                                                 <field name="ATTR">val</field>
                                                 <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Bluetooth.3db393472f177440184a264d10ab21eaa3a40b727da721dacafdc36d7c924828.connected</field>
                                               </block>
                                             </value>
                                             <value name="B">
                                               <block type="logic_boolean" id="iL;.^qKRI/EvT__-ijX0">
                                                 <field name="BOOL">TRUE</field>
                                               </block>
                                             </value>
                                           </block>
                                         </value>
                                         <statement name="DO0">
                                           <block type="control" id="o1v=umqvl[o$Cv|;f]S-">
                                             <mutation delay_input="false"></mutation>
                                             <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak-volume</field>
                                             <field name="WITH_DELAY">FALSE</field>
                                             <value name="VALUE">
                                               <block type="math_number" id="vY5vPPdyzFj-q_dcX/ZN">
                                                 <field name="NUM">100</field>
                                               </block>
                                             </value>
                                           </block>
                                         </statement>
                                         <statement name="ELSE">
                                           <block type="control" id="M%o@@T68jp?jm4shN%!b">
                                             <mutation delay_input="false"></mutation>
                                             <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak-volume</field>
                                             <field name="WITH_DELAY">FALSE</field>
                                             <value name="VALUE">
                                               <block type="math_number" id="ZGA8#%bU^)/:!Ez8L7T(">
                                                 <field name="NUM">80</field>
                                               </block>
                                             </value>
                                           </block>
                                         </statement>
                                         <next>
                                           <block type="control" id="bof(^Kc6*HkP+s:j[6#_">
                                             <mutation delay_input="false"></mutation>
                                             <field name="OID">alexa2.0.Echo-Devices.G090U509847625MD.Commands.speak</field>
                                             <field name="WITH_DELAY">FALSE</field>
                                             <value name="VALUE">
                                               <block type="variables_get" id="*DQWI2k9B|SkYa/74okS">
                                                 <field name="VAR" id="B:u)*5n*7e-b$$/6xA5S" variabletype="">ansage</field>
                                               </block>
                                             </value>
                                             <next>
                                               <block type="comment" id="})*dm=K.%!t}u%{{lOOo">
                                                 <field name="COMMENT">Echo Badezimmer</field>
                                                 <next>
                                                   <block type="control" id="=Bdy1/j[B-XGezQyz^hF">
                                                     <mutation delay_input="false"></mutation>
                                                     <field name="OID">alexa2.0.Echo-Devices.G090U50984653CEF.Commands.speak</field>
                                                     <field name="WITH_DELAY">FALSE</field>
                                                     <value name="VALUE">
                                                       <block type="variables_get" id="E?5h:!sz7m8*ji%it%A)">
                                                         <field name="VAR" id="B:u)*5n*7e-b$$/6xA5S" variabletype="">ansage</field>
                                                       </block>
                                                     </value>
                                                     <next>
                                                       <block type="comment" id="I7D#-CK31A(.9PL{OIrS">
                                                         <field name="COMMENT">Echo Wintergarten rechts</field>
                                                         <next>
                                                           <block type="control" id="N-z_H{7CHOH?f6BF_fBH">
                                                             <mutation delay_input="false"></mutation>
                                                             <field name="OID">alexa2.0.Echo-Devices.G090U50991860QSL.Commands.speak-volume</field>
                                                             <field name="WITH_DELAY">FALSE</field>
                                                             <value name="VALUE">
                                                               <block type="math_number" id="Kd3~Ov)}hdWwo7Gvfc+[">
                                                                 <field name="NUM">50</field>
                                                               </block>
                                                             </value>
                                                             <next>
                                                               <block type="control" id="T8r(PQcs.=m8,Z37N;-y">
                                                                 <mutation delay_input="false"></mutation>
                                                                 <field name="OID">alexa2.0.Echo-Devices.G090U50991860QSL.Commands.speak</field>
                                                                 <field name="WITH_DELAY">FALSE</field>
                                                                 <value name="VALUE">
                                                                   <block type="variables_get" id="=kAFSjZsN4M?M0I0-31x">
                                                                     <field name="VAR" id="B:u)*5n*7e-b$$/6xA5S" variabletype="">ansage</field>
                                                                   </block>
                                                                 </value>
                                                                 <next>
                                                                   <block type="comment" id="h7VHm$s|m_^_/_nyScx.">
                                                                     <field name="COMMENT">Echo Werkstatt</field>
                                                                     <next>
                                                                       <block type="control" id="YEdU^w}S1+:gN%81VAQ@">
                                                                         <mutation delay_input="false"></mutation>
                                                                         <field name="OID">alexa2.0.Echo-Devices.G090XG07930531PU.Commands.speak</field>
                                                                         <field name="WITH_DELAY">FALSE</field>
                                                                         <value name="VALUE">
                                                                           <block type="variables_get" id="yx%~c34X+TwOxqzY`Dyx">
                                                                             <field name="VAR" id="B:u)*5n*7e-b$$/6xA5S" variabletype="">ansage</field>
                                                                           </block>
                                                                         </value>
                                                                         <next>
                                                                           <block type="comment" id="F1(av/Fq.7jObTX.yG[">
                                                                             <field name="COMMENT">Echo Schlafzimmer</field>
                                                                             <next>
                                                                               <block type="control" id="Nj@c?9:P,d?puaw0vMfz">
                                                                                 <mutation delay_input="false"></mutation>
                                                                                 <field name="OID">alexa2.0.Echo-Devices.G090U50784360US6.Commands.speak-volume</field>
                                                                                 <field name="WITH_DELAY">FALSE</field>
                                                                                 <value name="VALUE">
                                                                                   <block type="math_number" id="3_!yO=%_o^`B!)]y2EI)">
                                                                                     <field name="NUM">40</field>
                                                                                   </block>
                                                                                 </value>
                                                                                 <next>
                                                                                   <block type="control" id="J?BofaiaB2V!fQ$cGc3^">
                                                                                     <mutation delay_input="false"></mutation>
                                                                                     <field name="OID">alexa2.0.Echo-Devices.G090U50784360US6.Commands.speak</field>
                                                                                     <field name="WITH_DELAY">FALSE</field>
                                                                                     <value name="VALUE">
                                                                                       <block type="variables_get" id="/!$YP$T$bnrp5d[a}x,|">
                                                                                         <field name="VAR" id="B:u)*5n*7e-b$$/6xA5S" variabletype="">ansage</field>
                                                                                       </block>
                                                                                     </value>
                                                                                   </block>
                                                                                 </next>
                                                                               </block>
                                                                             </next>
                                                                           </block>
                                                                         </next>
                                                                       </block>
                                                                     </next>
                                                                   </block>
                                                                 </next>
                                                               </block>
                                                             </next>
                                                           </block>
                                                         </next>
                                                       </block>
                                                     </next>
                                                   </block>
                                                 </next>
                                               </block>
                                             </next>
                                           </block>
                                         </next>
                                       </block>
                                     </next>
                                   </block>
                                 </next>
                               </block>
                             </statement>
                           </block>
                          </xml>
                          

                          Ist "Commands.speak-volume" tatsächlich ein String-Datenpunkt oder ein Zahl-Datenpunkt ?

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

                          Support us

                          ioBroker
                          Community Adapters
                          Donate

                          628
                          Online

                          31.9k
                          Users

                          80.1k
                          Topics

                          1.3m
                          Posts

                          2
                          27
                          1600
                          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