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

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

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. Blockly
  5. Zeitfenster in dem Script ausgeführt werden soll

NEWS

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    16
    1
    928

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    689

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    25
    1
    2.0k

Zeitfenster in dem Script ausgeführt werden soll

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

    Hi,

    ich bin neu in der Blockly Programmierung und möchte das ein Script nur in einem bestimmten Zeitfenster ausgeführt wird. Und zwar in der Woche von 17:00 Uhr bis 20:00 Uhr und am Wochenende von 10:00 Uhr bis 22:00 Uhr. Einen Trigger kann ich nicht verwenden. Mit "aktuelle Zeit ist kleiner bzw grösser" könnte ich die Zeit zwischen 17:00 Uhr bis 20 Uhr abfackeln. Aber wie mache ich das mit dem Wochenende, das ist mir noch nicht ganz klar. Ich könnte noch ein falls sonst einfügen und oben neben dem falls noch das "aktuelle Zeit ist kleiner bzw grösser" hinzufügen aber weiter komme ich gerade nicht.
    Jemand eine Idee ?
    Hier einmal das Script wie es im Moment ist:

    <xml xmlns="http://www.w3.org/1999/xhtml">
      <variables>
        <variable type="" id="3d}EB@SqB|hB+,zAp}%K">Zufall</variable>
        <variable type="undefined" id="timeout2">timeout2</variable>
        <variable type="undefined" id="timeout">timeout</variable>
        <variable type="undefined" id="timeout3">timeout3</variable>
      </variables>
      <block type="comment" id="b!|pe^OFH/rH,4^g-#%+" x="-162" y="-188">
        <field name="COMMENT">Sonos im Bad über Pir ( Steckdose ) einschalten und Musik abspielenn </field>
        <next>
          <block type="on_ext" id="~lMbB0:Q*jP#]=nk?Gn2">
            <mutation items="1"></mutation>
            <field name="CONDITION">ne</field>
            <field name="ACK_CONDITION"></field>
            <value name="OID0">
              <shadow type="field_oid" id="wA*u?Z)9(r%N`CB={YyB">
                <field name="oid">tuya.0.0120036768c63a8690e1.1</field>
              </shadow>
            </value>
            <statement name="STATEMENT">
              <block type="comment" id="%DyjIDZ=o5oI~S)mcT5R">
                <field name="COMMENT">Prüfe ob die Änderung die Dose ein oder aus geschaltet hat.</field>
                <next>
                  <block type="controls_if" id="%_JMBf~%RB,U7hvJPSro">
                    <mutation else="1"></mutation>
                    <value name="IF0">
                      <block type="logic_compare" id=",K/J@/~_3,|w-$hujonP">
                        <field name="OP">EQ</field>
                        <value name="A">
                          <block type="get_value" id="rRsD?zs7I7xPzS#5dYoj">
                            <field name="ATTR">val</field>
                            <field name="OID">tuya.0.0120036768c63a8690e1.1</field>
                          </block>
                        </value>
                        <value name="B">
                          <block type="logic_boolean" id="JA[VZwmH:T)t=:r!f%sT">
                            <field name="BOOL">TRUE</field>
                          </block>
                        </value>
                      </block>
                    </value>
                    <statement name="DO0">
                      <block type="comment" id="tNK.LFOipiXt=ka)]o0,">
                        <field name="COMMENT">Wähle eine von drei Playlisten</field>
                        <next>
                          <block type="variables_set" id="UJ4*^Ms.t4xXA}e5+gGQ">
                            <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                            <value name="VALUE">
                              <block type="math_random_int" id="M^S)YBi_[T#YlweQqYN`">
                                <value name="FROM">
                                  <shadow type="math_number" id="3g0-fSTB;}+YaTw]a9DI">
                                    <field name="NUM">1</field>
                                  </shadow>
                                </value>
                                <value name="TO">
                                  <shadow type="math_number" id="QF)fsNwM][mV]x[(^QkC">
                                    <field name="NUM">3</field>
                                  </shadow>
                                </value>
                              </block>
                            </value>
                            <next>
                              <block type="debug" id="iY`wo=F02sG=Tn3i|M)[">
                                <field name="Severity">log</field>
                                <value name="TEXT">
                                  <shadow type="text" id="@DVofOcXZk@PnTjN4yZ5">
                                    <field name="TEXT">test</field>
                                  </shadow>
                                  <block type="text_join" id="-q#[,s~|J?aNb^?~2AR]">
                                    <mutation items="2"></mutation>
                                    <value name="ADD0">
                                      <block type="text" id="h7]?0SOylTL]b`ggQH5k">
                                        <field name="TEXT">Zufallszahl ist: </field>
                                      </block>
                                    </value>
                                    <value name="ADD1">
                                      <block type="variables_get" id="oxL73oh[p)bc6EDYQhEn">
                                        <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <next>
                                  <block type="comment" id="zS.B29tn^G!}|5U@h{@B">
                                    <field name="COMMENT">Warte 45 Sek. bis Play One fertig mit booten ist. </field>
                                    <next>
                                      <block type="timeouts_settimeout" id="N.Zi:Z;-D33=!0DG5#Vd">
                                        <field name="NAME">timeout2</field>
                                        <field name="DELAY">45</field>
                                        <field name="UNIT">sec</field>
                                        <statement name="STATEMENT">
                                          <block type="comment" id="go/7rv@xc]^18T7R$w6d">
                                            <field name="COMMENT">Setze ausgewählte Playlist</field>
                                            <next>
                                              <block type="controls_if" id="Qb0=j:cXfp%TH1G%:I=F">
                                                <value name="IF0">
                                                  <block type="logic_compare" id="#]:^ZgN{}wS7muvJYQ.I">
                                                    <field name="OP">EQ</field>
                                                    <value name="A">
                                                      <block type="variables_get" id="!.zW%7Y?M-3_9FpP}IBJ">
                                                        <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                                      </block>
                                                    </value>
                                                    <value name="B">
                                                      <block type="math_number" id="WO^a|evF2CR@HgiAYh-S">
                                                        <field name="NUM">1</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <statement name="DO0">
                                                  <block type="control" id="jDt:n8DD^NlQ3i^DdU]z">
                                                    <mutation delay_input="false"></mutation>
                                                    <field name="OID">sonos.0.root.192_168_168_125.favorites_set</field>
                                                    <field name="WITH_DELAY">FALSE</field>
                                                    <value name="VALUE">
                                                      <block type="text" id="HGj3X=hh=0i.SZyYw?VY">
                                                        <field name="TEXT">Soundeo Latest Uploads</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </statement>
                                                <next>
                                                  <block type="controls_if" id="R438`n-MJ:pn0;K,S`W@">
                                                    <value name="IF0">
                                                      <block type="logic_compare" id=":*6%AW~C|iwJWpD*saaN">
                                                        <field name="OP">EQ</field>
                                                        <value name="A">
                                                          <block type="variables_get" id="Iob~pV;+6t(tgb7BUqhy">
                                                            <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                                          </block>
                                                        </value>
                                                        <value name="B">
                                                          <block type="math_number" id=":)K6X|d2rOR$.m^n)Wom">
                                                            <field name="NUM">2</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <statement name="DO0">
                                                      <block type="control" id="It@G^~kq@jIOhOp:lfbp">
                                                        <mutation delay_input="false"></mutation>
                                                        <field name="OID">sonos.0.root.192_168_168_125.favorites_set</field>
                                                        <field name="WITH_DELAY">FALSE</field>
                                                        <value name="VALUE">
                                                          <block type="text" id="c[ujuGYUt^`~.]`6|E;p">
                                                            <field name="TEXT">Sax4Love</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </statement>
                                                    <next>
                                                      <block type="controls_if" id="9kEJp*e);]^n`|N,wkVe">
                                                        <value name="IF0">
                                                          <block type="logic_compare" id="2(g#B?$4w=cAsXz:v9Z{">
                                                            <field name="OP">EQ</field>
                                                            <value name="A">
                                                              <block type="variables_get" id="HF|p(uwAnEd!2f1%B$L0">
                                                                <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                                              </block>
                                                            </value>
                                                            <value name="B">
                                                              <block type="math_number" id="^fW$`8+-#W9$SLZ6S7lr">
                                                                <field name="NUM">3</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <statement name="DO0">
                                                          <block type="control" id="6ucPT6:(wt`)ve}[l}O2">
                                                            <mutation delay_input="false"></mutation>
                                                            <field name="OID">sonos.0.root.192_168_168_125.favorites_set</field>
                                                            <field name="WITH_DELAY">FALSE</field>
                                                            <value name="VALUE">
                                                              <block type="text" id="r}1@#}8:($3U@M|9]+u?">
                                                                <field name="TEXT">80 Verschiedenes</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </statement>
                                                        <next>
                                                          <block type="comment" id="U(nj#85emc.fPwHj(x/v">
                                                            <field name="COMMENT">Play Button drücken und Zufallswiedergabe einschalten</field>
                                                            <next>
                                                              <block type="control" id="7Ha=#+jIwIv@WIQ,dpTe">
                                                                <mutation delay_input="false"></mutation>
                                                                <field name="OID">sonos.0.root.192_168_168_125.state</field>
                                                                <field name="WITH_DELAY">FALSE</field>
                                                                <value name="VALUE">
                                                                  <block type="text" id="O,Cgm-[?73_7.e,,Kawg">
                                                                    <field name="TEXT">Play</field>
                                                                  </block>
                                                                </value>
                                                                <next>
                                                                  <block type="control" id="Vj|M=jqHN2Vw;ldl|1}q">
                                                                    <mutation delay_input="false"></mutation>
                                                                    <field name="OID">sonos.0.root.192_168_168_125.shuffle</field>
                                                                    <field name="WITH_DELAY">FALSE</field>
                                                                    <value name="VALUE">
                                                                      <block type="logic_boolean" id="b!OyfmSS@hb*^%g-Bja*">
                                                                        <field name="BOOL">TRUE</field>
                                                                      </block>
                                                                    </value>
                                                                    <next>
                                                                      <block type="control" id="~W,)6;jC%L6v}H}E19vi">
                                                                        <mutation delay_input="false"></mutation>
                                                                        <field name="OID">sonos.0.root.192_168_168_125.play</field>
                                                                        <field name="WITH_DELAY">FALSE</field>
                                                                        <value name="VALUE">
                                                                          <block type="logic_boolean" id="p@Tq4NGT_+`ZDz9OmxG?">
                                                                            <field name="BOOL">TRUE</field>
                                                                          </block>
                                                                        </value>
                                                                        <next>
                                                                          <block type="control" id="WT|N}iScao.)0C_fmw0l">
                                                                            <mutation delay_input="false"></mutation>
                                                                            <field name="OID">sonos.0.root.192_168_168_125.stop</field>
                                                                            <field name="WITH_DELAY">FALSE</field>
                                                                            <value name="VALUE">
                                                                              <block type="logic_boolean" id="+DQ#k_:Fc/$4Wx,@w3sb">
                                                                                <field name="BOOL">FALSE</field>
                                                                              </block>
                                                                            </value>
                                                                          </block>
                                                                        </next>
                                                                      </block>
                                                                    </next>
                                                                  </block>
                                                                </next>
                                                              </block>
                                                            </next>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </statement>
                                        <next>
                                          <block type="timeouts_settimeout" id="]i?*`tzPK8Q1G)Ax#Kjh">
                                            <field name="NAME">timeout</field>
                                            <field name="DELAY">25</field>
                                            <field name="UNIT">min</field>
                                            <statement name="STATEMENT">
                                              <block type="comment" id="ept9::Rg-9s.[S8EeZE]">
                                                <field name="COMMENT">Einstellungen zurück setzten</field>
                                                <next>
                                                  <block type="control" id="$A{l6=9dWC7_+uoc]2dC">
                                                    <mutation delay_input="false"></mutation>
                                                    <field name="OID">sonos.0.root.192_168_168_125.state</field>
                                                    <field name="WITH_DELAY">FALSE</field>
                                                    <value name="VALUE">
                                                      <block type="text" id=",uKPRE_tI2MG|xNU(F2p">
                                                        <field name="TEXT">Stop</field>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="control" id="3=j[ET#(yu~nkt*be[Xi">
                                                        <mutation delay_input="false"></mutation>
                                                        <field name="OID">sonos.0.root.192_168_168_125.play</field>
                                                        <field name="WITH_DELAY">FALSE</field>
                                                        <value name="VALUE">
                                                          <block type="logic_boolean" id="W@q$#~nA$oZ[@,ht8GL6">
                                                            <field name="BOOL">FALSE</field>
                                                          </block>
                                                        </value>
                                                        <next>
                                                          <block type="control" id="Xj?P}6q?rLh|@~U_M7nP">
                                                            <mutation delay_input="false"></mutation>
                                                            <field name="OID">sonos.0.root.192_168_168_125.stop</field>
                                                            <field name="WITH_DELAY">FALSE</field>
                                                            <value name="VALUE">
                                                              <block type="logic_boolean" id="nH$L.VhS?|.jh$aL3F_#">
                                                                <field name="BOOL">TRUE</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </statement>
                                            <next>
                                              <block type="timeouts_settimeout" id="7SOnzWgj4to;E{`mGM+_">
                                                <field name="NAME">timeout3</field>
                                                <field name="DELAY">26</field>
                                                <field name="UNIT">min</field>
                                                <statement name="STATEMENT">
                                                  <block type="comment" id="njZoiNzr71$8Bbnrf|w?">
                                                    <field name="COMMENT">Strom der Play One ausschalten</field>
                                                    <next>
                                                      <block type="control" id="DdS9,DFxM}r92DB,~{+]">
                                                        <mutation delay_input="false"></mutation>
                                                        <field name="OID">tuya.0.0120036768c63a8690e1.1</field>
                                                        <field name="WITH_DELAY">FALSE</field>
                                                        <value name="VALUE">
                                                          <block type="logic_boolean" id="z(Q-|1XuV*G:y4l)p*NA">
                                                            <field name="BOOL">FALSE</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </statement>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </next>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </statement>
                    <statement name="ELSE">
                      <block type="debug" id="{9O.pL-u+9SQQS9jPVKa">
                        <field name="Severity">log</field>
                        <value name="TEXT">
                          <shadow type="text" id="!hH#.aoebG)35y0~vMCR">
                            <field name="TEXT">test</field>
                          </shadow>
                          <block type="text" id="s:i]N[!E_Q(dr})-b:MH">
                            <field name="TEXT">Bedezimmer Sonos Script wurde richtig beendet</field>
                          </block>
                        </value>
                      </block>
                    </statement>
                  </block>
                </next>
              </block>
            </statement>
          </block>
        </next>
      </block>
    </xml>
    

    2019-11-14 19_49_16-Window.jpg

    BBTownB paul53P 2 Antworten Letzte Antwort
    0
    • S Spitfire4all

      Hi,

      ich bin neu in der Blockly Programmierung und möchte das ein Script nur in einem bestimmten Zeitfenster ausgeführt wird. Und zwar in der Woche von 17:00 Uhr bis 20:00 Uhr und am Wochenende von 10:00 Uhr bis 22:00 Uhr. Einen Trigger kann ich nicht verwenden. Mit "aktuelle Zeit ist kleiner bzw grösser" könnte ich die Zeit zwischen 17:00 Uhr bis 20 Uhr abfackeln. Aber wie mache ich das mit dem Wochenende, das ist mir noch nicht ganz klar. Ich könnte noch ein falls sonst einfügen und oben neben dem falls noch das "aktuelle Zeit ist kleiner bzw grösser" hinzufügen aber weiter komme ich gerade nicht.
      Jemand eine Idee ?
      Hier einmal das Script wie es im Moment ist:

      <xml xmlns="http://www.w3.org/1999/xhtml">
        <variables>
          <variable type="" id="3d}EB@SqB|hB+,zAp}%K">Zufall</variable>
          <variable type="undefined" id="timeout2">timeout2</variable>
          <variable type="undefined" id="timeout">timeout</variable>
          <variable type="undefined" id="timeout3">timeout3</variable>
        </variables>
        <block type="comment" id="b!|pe^OFH/rH,4^g-#%+" x="-162" y="-188">
          <field name="COMMENT">Sonos im Bad über Pir ( Steckdose ) einschalten und Musik abspielenn </field>
          <next>
            <block type="on_ext" id="~lMbB0:Q*jP#]=nk?Gn2">
              <mutation items="1"></mutation>
              <field name="CONDITION">ne</field>
              <field name="ACK_CONDITION"></field>
              <value name="OID0">
                <shadow type="field_oid" id="wA*u?Z)9(r%N`CB={YyB">
                  <field name="oid">tuya.0.0120036768c63a8690e1.1</field>
                </shadow>
              </value>
              <statement name="STATEMENT">
                <block type="comment" id="%DyjIDZ=o5oI~S)mcT5R">
                  <field name="COMMENT">Prüfe ob die Änderung die Dose ein oder aus geschaltet hat.</field>
                  <next>
                    <block type="controls_if" id="%_JMBf~%RB,U7hvJPSro">
                      <mutation else="1"></mutation>
                      <value name="IF0">
                        <block type="logic_compare" id=",K/J@/~_3,|w-$hujonP">
                          <field name="OP">EQ</field>
                          <value name="A">
                            <block type="get_value" id="rRsD?zs7I7xPzS#5dYoj">
                              <field name="ATTR">val</field>
                              <field name="OID">tuya.0.0120036768c63a8690e1.1</field>
                            </block>
                          </value>
                          <value name="B">
                            <block type="logic_boolean" id="JA[VZwmH:T)t=:r!f%sT">
                              <field name="BOOL">TRUE</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <statement name="DO0">
                        <block type="comment" id="tNK.LFOipiXt=ka)]o0,">
                          <field name="COMMENT">Wähle eine von drei Playlisten</field>
                          <next>
                            <block type="variables_set" id="UJ4*^Ms.t4xXA}e5+gGQ">
                              <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                              <value name="VALUE">
                                <block type="math_random_int" id="M^S)YBi_[T#YlweQqYN`">
                                  <value name="FROM">
                                    <shadow type="math_number" id="3g0-fSTB;}+YaTw]a9DI">
                                      <field name="NUM">1</field>
                                    </shadow>
                                  </value>
                                  <value name="TO">
                                    <shadow type="math_number" id="QF)fsNwM][mV]x[(^QkC">
                                      <field name="NUM">3</field>
                                    </shadow>
                                  </value>
                                </block>
                              </value>
                              <next>
                                <block type="debug" id="iY`wo=F02sG=Tn3i|M)[">
                                  <field name="Severity">log</field>
                                  <value name="TEXT">
                                    <shadow type="text" id="@DVofOcXZk@PnTjN4yZ5">
                                      <field name="TEXT">test</field>
                                    </shadow>
                                    <block type="text_join" id="-q#[,s~|J?aNb^?~2AR]">
                                      <mutation items="2"></mutation>
                                      <value name="ADD0">
                                        <block type="text" id="h7]?0SOylTL]b`ggQH5k">
                                          <field name="TEXT">Zufallszahl ist: </field>
                                        </block>
                                      </value>
                                      <value name="ADD1">
                                        <block type="variables_get" id="oxL73oh[p)bc6EDYQhEn">
                                          <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="comment" id="zS.B29tn^G!}|5U@h{@B">
                                      <field name="COMMENT">Warte 45 Sek. bis Play One fertig mit booten ist. </field>
                                      <next>
                                        <block type="timeouts_settimeout" id="N.Zi:Z;-D33=!0DG5#Vd">
                                          <field name="NAME">timeout2</field>
                                          <field name="DELAY">45</field>
                                          <field name="UNIT">sec</field>
                                          <statement name="STATEMENT">
                                            <block type="comment" id="go/7rv@xc]^18T7R$w6d">
                                              <field name="COMMENT">Setze ausgewählte Playlist</field>
                                              <next>
                                                <block type="controls_if" id="Qb0=j:cXfp%TH1G%:I=F">
                                                  <value name="IF0">
                                                    <block type="logic_compare" id="#]:^ZgN{}wS7muvJYQ.I">
                                                      <field name="OP">EQ</field>
                                                      <value name="A">
                                                        <block type="variables_get" id="!.zW%7Y?M-3_9FpP}IBJ">
                                                          <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                                        </block>
                                                      </value>
                                                      <value name="B">
                                                        <block type="math_number" id="WO^a|evF2CR@HgiAYh-S">
                                                          <field name="NUM">1</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <statement name="DO0">
                                                    <block type="control" id="jDt:n8DD^NlQ3i^DdU]z">
                                                      <mutation delay_input="false"></mutation>
                                                      <field name="OID">sonos.0.root.192_168_168_125.favorites_set</field>
                                                      <field name="WITH_DELAY">FALSE</field>
                                                      <value name="VALUE">
                                                        <block type="text" id="HGj3X=hh=0i.SZyYw?VY">
                                                          <field name="TEXT">Soundeo Latest Uploads</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </statement>
                                                  <next>
                                                    <block type="controls_if" id="R438`n-MJ:pn0;K,S`W@">
                                                      <value name="IF0">
                                                        <block type="logic_compare" id=":*6%AW~C|iwJWpD*saaN">
                                                          <field name="OP">EQ</field>
                                                          <value name="A">
                                                            <block type="variables_get" id="Iob~pV;+6t(tgb7BUqhy">
                                                              <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                                            </block>
                                                          </value>
                                                          <value name="B">
                                                            <block type="math_number" id=":)K6X|d2rOR$.m^n)Wom">
                                                              <field name="NUM">2</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                      <statement name="DO0">
                                                        <block type="control" id="It@G^~kq@jIOhOp:lfbp">
                                                          <mutation delay_input="false"></mutation>
                                                          <field name="OID">sonos.0.root.192_168_168_125.favorites_set</field>
                                                          <field name="WITH_DELAY">FALSE</field>
                                                          <value name="VALUE">
                                                            <block type="text" id="c[ujuGYUt^`~.]`6|E;p">
                                                              <field name="TEXT">Sax4Love</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </statement>
                                                      <next>
                                                        <block type="controls_if" id="9kEJp*e);]^n`|N,wkVe">
                                                          <value name="IF0">
                                                            <block type="logic_compare" id="2(g#B?$4w=cAsXz:v9Z{">
                                                              <field name="OP">EQ</field>
                                                              <value name="A">
                                                                <block type="variables_get" id="HF|p(uwAnEd!2f1%B$L0">
                                                                  <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                                                </block>
                                                              </value>
                                                              <value name="B">
                                                                <block type="math_number" id="^fW$`8+-#W9$SLZ6S7lr">
                                                                  <field name="NUM">3</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                          <statement name="DO0">
                                                            <block type="control" id="6ucPT6:(wt`)ve}[l}O2">
                                                              <mutation delay_input="false"></mutation>
                                                              <field name="OID">sonos.0.root.192_168_168_125.favorites_set</field>
                                                              <field name="WITH_DELAY">FALSE</field>
                                                              <value name="VALUE">
                                                                <block type="text" id="r}1@#}8:($3U@M|9]+u?">
                                                                  <field name="TEXT">80 Verschiedenes</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </statement>
                                                          <next>
                                                            <block type="comment" id="U(nj#85emc.fPwHj(x/v">
                                                              <field name="COMMENT">Play Button drücken und Zufallswiedergabe einschalten</field>
                                                              <next>
                                                                <block type="control" id="7Ha=#+jIwIv@WIQ,dpTe">
                                                                  <mutation delay_input="false"></mutation>
                                                                  <field name="OID">sonos.0.root.192_168_168_125.state</field>
                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                  <value name="VALUE">
                                                                    <block type="text" id="O,Cgm-[?73_7.e,,Kawg">
                                                                      <field name="TEXT">Play</field>
                                                                    </block>
                                                                  </value>
                                                                  <next>
                                                                    <block type="control" id="Vj|M=jqHN2Vw;ldl|1}q">
                                                                      <mutation delay_input="false"></mutation>
                                                                      <field name="OID">sonos.0.root.192_168_168_125.shuffle</field>
                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                      <value name="VALUE">
                                                                        <block type="logic_boolean" id="b!OyfmSS@hb*^%g-Bja*">
                                                                          <field name="BOOL">TRUE</field>
                                                                        </block>
                                                                      </value>
                                                                      <next>
                                                                        <block type="control" id="~W,)6;jC%L6v}H}E19vi">
                                                                          <mutation delay_input="false"></mutation>
                                                                          <field name="OID">sonos.0.root.192_168_168_125.play</field>
                                                                          <field name="WITH_DELAY">FALSE</field>
                                                                          <value name="VALUE">
                                                                            <block type="logic_boolean" id="p@Tq4NGT_+`ZDz9OmxG?">
                                                                              <field name="BOOL">TRUE</field>
                                                                            </block>
                                                                          </value>
                                                                          <next>
                                                                            <block type="control" id="WT|N}iScao.)0C_fmw0l">
                                                                              <mutation delay_input="false"></mutation>
                                                                              <field name="OID">sonos.0.root.192_168_168_125.stop</field>
                                                                              <field name="WITH_DELAY">FALSE</field>
                                                                              <value name="VALUE">
                                                                                <block type="logic_boolean" id="+DQ#k_:Fc/$4Wx,@w3sb">
                                                                                  <field name="BOOL">FALSE</field>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </next>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </statement>
                                          <next>
                                            <block type="timeouts_settimeout" id="]i?*`tzPK8Q1G)Ax#Kjh">
                                              <field name="NAME">timeout</field>
                                              <field name="DELAY">25</field>
                                              <field name="UNIT">min</field>
                                              <statement name="STATEMENT">
                                                <block type="comment" id="ept9::Rg-9s.[S8EeZE]">
                                                  <field name="COMMENT">Einstellungen zurück setzten</field>
                                                  <next>
                                                    <block type="control" id="$A{l6=9dWC7_+uoc]2dC">
                                                      <mutation delay_input="false"></mutation>
                                                      <field name="OID">sonos.0.root.192_168_168_125.state</field>
                                                      <field name="WITH_DELAY">FALSE</field>
                                                      <value name="VALUE">
                                                        <block type="text" id=",uKPRE_tI2MG|xNU(F2p">
                                                          <field name="TEXT">Stop</field>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="control" id="3=j[ET#(yu~nkt*be[Xi">
                                                          <mutation delay_input="false"></mutation>
                                                          <field name="OID">sonos.0.root.192_168_168_125.play</field>
                                                          <field name="WITH_DELAY">FALSE</field>
                                                          <value name="VALUE">
                                                            <block type="logic_boolean" id="W@q$#~nA$oZ[@,ht8GL6">
                                                              <field name="BOOL">FALSE</field>
                                                            </block>
                                                          </value>
                                                          <next>
                                                            <block type="control" id="Xj?P}6q?rLh|@~U_M7nP">
                                                              <mutation delay_input="false"></mutation>
                                                              <field name="OID">sonos.0.root.192_168_168_125.stop</field>
                                                              <field name="WITH_DELAY">FALSE</field>
                                                              <value name="VALUE">
                                                                <block type="logic_boolean" id="nH$L.VhS?|.jh$aL3F_#">
                                                                  <field name="BOOL">TRUE</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </statement>
                                              <next>
                                                <block type="timeouts_settimeout" id="7SOnzWgj4to;E{`mGM+_">
                                                  <field name="NAME">timeout3</field>
                                                  <field name="DELAY">26</field>
                                                  <field name="UNIT">min</field>
                                                  <statement name="STATEMENT">
                                                    <block type="comment" id="njZoiNzr71$8Bbnrf|w?">
                                                      <field name="COMMENT">Strom der Play One ausschalten</field>
                                                      <next>
                                                        <block type="control" id="DdS9,DFxM}r92DB,~{+]">
                                                          <mutation delay_input="false"></mutation>
                                                          <field name="OID">tuya.0.0120036768c63a8690e1.1</field>
                                                          <field name="WITH_DELAY">FALSE</field>
                                                          <value name="VALUE">
                                                            <block type="logic_boolean" id="z(Q-|1XuV*G:y4l)p*NA">
                                                              <field name="BOOL">FALSE</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </statement>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </statement>
                      <statement name="ELSE">
                        <block type="debug" id="{9O.pL-u+9SQQS9jPVKa">
                          <field name="Severity">log</field>
                          <value name="TEXT">
                            <shadow type="text" id="!hH#.aoebG)35y0~vMCR">
                              <field name="TEXT">test</field>
                            </shadow>
                            <block type="text" id="s:i]N[!E_Q(dr})-b:MH">
                              <field name="TEXT">Bedezimmer Sonos Script wurde richtig beendet</field>
                            </block>
                          </value>
                        </block>
                      </statement>
                    </block>
                  </next>
                </block>
              </statement>
            </block>
          </next>
        </block>
      </xml>
      

      2019-11-14 19_49_16-Window.jpg

      BBTownB Offline
      BBTownB Offline
      BBTown
      schrieb am zuletzt editiert von BBTown
      #2

      @Spitfire4all
      was soll denn passieren wenn der Schalter auf "aus" gestellt wird?

      So wie derzeit dein Script aufgebaut ist, wird gnadenlos nun 25 (24) Minuten Musik abgespielt, ganz gleich was zwischendurch passiert ...eine Unterbrechung ist nicht vorgesehen(??)

      ich würde es wohl mit einer Funktion versuchen.
      so in etwa
      e02acfa3-8cd1-404f-a7c8-f03db2d7d286-image.png

      <xml xmlns="http://www.w3.org/1999/xhtml">
       <variables>
         <variable type="" id="!v7{U.VSh6/azeW{Jaqg">Zeitfenster</variable>
         <variable type="" id="m=ypi^k)0W;c(`cat^!g">sonos_ein</variable>
         <variable type="" id="3d}EB@SqB|hB+,zAp}%K">Zufall</variable>
         <variable type="undefined" id="timeout2">timeout2</variable>
         <variable type="undefined" id="timeout">timeout</variable>
         <variable type="undefined" id="timeout3">timeout3</variable>
       </variables>
       <block type="variables_set" id="eZV]K1Ff|:hJE{FM_UQx" x="-263" y="-212">
         <field name="VAR" id="!v7{U.VSh6/azeW{Jaqg" variabletype="">Zeitfenster</field>
         <value name="VALUE">
           <block type="logic_boolean" id="rt(4wwhlD_tjt`zG:+Ep">
             <field name="BOOL">TRUE</field>
           </block>
         </value>
         <next>
           <block type="on_ext" id="~lMbB0:Q*jP#]=nk?Gn2">
             <mutation items="1"></mutation>
             <field name="CONDITION">ne</field>
             <field name="ACK_CONDITION"></field>
             <value name="OID0">
               <shadow type="field_oid" id="wA*u?Z)9(r%N`CB={YyB">
                 <field name="oid">tuya.0.0120036768c63a8690e1.1</field>
               </shadow>
             </value>
             <statement name="STATEMENT">
               <block type="variables_set" id="np2(3?{z8,1J*[:`.FcV">
                 <field name="VAR" id="m=ypi^k)0W;c(`cat^!g" variabletype="">sonos_ein</field>
                 <value name="VALUE">
                   <block type="on_source" id="{)WIi5VwdU]sSc`f:*CR">
                     <field name="ATTR">state.val</field>
                   </block>
                 </value>
                 <next>
                   <block type="procedures_callnoreturn" id="{dr){-z!-b~KK$9,g-GG">
                     <mutation name="Musik"></mutation>
                   </block>
                 </next>
               </block>
             </statement>
             <next>
               <block type="schedule" id="VL+d]%cE]e?Dh-0Jq}%!">
                 <field name="SCHEDULE">0 10 * * 0,6</field>
                 <statement name="STATEMENT">
                   <block type="variables_set" id="nGdb1?L~epE))y%(;AqO">
                     <field name="VAR" id="!v7{U.VSh6/azeW{Jaqg" variabletype="">Zeitfenster</field>
                     <value name="VALUE">
                       <block type="logic_boolean" id="i8@_w582B-)Axf|WCgrg">
                         <field name="BOOL">TRUE</field>
                       </block>
                     </value>
                   </block>
                 </statement>
                 <next>
                   <block type="schedule" id="2F{AW$Xk9T4[Vm|#i/FS">
                     <field name="SCHEDULE">0 22 * * 0,6</field>
                     <statement name="STATEMENT">
                       <block type="variables_set" id="GzJ~Xz873(i5t[0LK[!k">
                         <field name="VAR" id="!v7{U.VSh6/azeW{Jaqg" variabletype="">Zeitfenster</field>
                         <value name="VALUE">
                           <block type="logic_boolean" id="XCQUg39KI*,fuQ)huz)M">
                             <field name="BOOL">FALSE</field>
                           </block>
                         </value>
                       </block>
                     </statement>
                     <next>
                       <block type="schedule" id="Jgut%gD9oAcae+{Af=,n">
                         <field name="SCHEDULE">{"time":{"exactTime":true,"start":"17:00"},"period":{"days":1,"dows":"[1, 2, 3, 4, 5]"},"valid":{"from":"14.11.2019","to":""}}</field>
                         <statement name="STATEMENT">
                           <block type="variables_set" id="^!G-}e=0i`$6L8@G||tY">
                             <field name="VAR" id="!v7{U.VSh6/azeW{Jaqg" variabletype="">Zeitfenster</field>
                             <value name="VALUE">
                               <block type="logic_boolean" id=")~0r|WDHErVDuSP;3Qxy">
                                 <field name="BOOL">TRUE</field>
                               </block>
                             </value>
                           </block>
                         </statement>
                         <next>
                           <block type="schedule" id=":K{sc1PRj:9W)oy~1zj0">
                             <field name="SCHEDULE">{"time":{"exactTime":true,"start":"20:00"},"period":{"days":1,"dows":"[1, 2, 3, 4, 5]"}}</field>
                             <statement name="STATEMENT">
                               <block type="variables_set" id="C92F%Pi9mWKrj##]j!P?">
                                 <field name="VAR" id="!v7{U.VSh6/azeW{Jaqg" variabletype="">Zeitfenster</field>
                                 <value name="VALUE">
                                   <block type="logic_boolean" id="H)|Sq)a.w,`mL??}vlP+">
                                     <field name="BOOL">FALSE</field>
                                   </block>
                                 </value>
                               </block>
                             </statement>
                           </block>
                         </next>
                       </block>
                     </next>
                   </block>
                 </next>
               </block>
             </next>
           </block>
         </next>
       </block>
       <block type="procedures_defnoreturn" id="FEehSnae$vKz2R@)GQw]" x="288" y="-212">
         <field name="NAME">Musik</field>
         <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
         <statement name="STACK">
           <block type="controls_if" id="%_JMBf~%RB,U7hvJPSro">
             <mutation else="1"></mutation>
             <value name="IF0">
               <block type="logic_operation" id="fS00F{j0HSxjoye=$f49" inline="false">
                 <field name="OP">AND</field>
                 <value name="A">
                   <block type="variables_get" id="VXiqTf*11Zc+Ov2Y?Gre">
                     <field name="VAR" id="m=ypi^k)0W;c(`cat^!g" variabletype="">sonos_ein</field>
                   </block>
                 </value>
                 <value name="B">
                   <block type="variables_get" id="b8?R$}B:-DG.JUsFiS(t">
                     <field name="VAR" id="!v7{U.VSh6/azeW{Jaqg" variabletype="">Zeitfenster</field>
                   </block>
                 </value>
               </block>
             </value>
             <statement name="DO0">
               <block type="comment" id="tNK.LFOipiXt=ka)]o0,">
                 <field name="COMMENT">Wähle eine von drei Playlisten</field>
                 <next>
                   <block type="variables_set" id="UJ4*^Ms.t4xXA}e5+gGQ">
                     <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                     <value name="VALUE">
                       <block type="math_random_int" id="M^S)YBi_[T#YlweQqYN`">
                         <value name="FROM">
                           <shadow type="math_number" id="3g0-fSTB;}+YaTw]a9DI">
                             <field name="NUM">1</field>
                           </shadow>
                         </value>
                         <value name="TO">
                           <shadow type="math_number" id="QF)fsNwM][mV]x[(^QkC">
                             <field name="NUM">3</field>
                           </shadow>
                         </value>
                       </block>
                     </value>
                     <next>
                       <block type="debug" id="iY`wo=F02sG=Tn3i|M)[">
                         <field name="Severity">log</field>
                         <value name="TEXT">
                           <shadow type="text" id="@DVofOcXZk@PnTjN4yZ5">
                             <field name="TEXT">test</field>
                           </shadow>
                           <block type="text_join" id="-q#[,s~|J?aNb^?~2AR]">
                             <mutation items="2"></mutation>
                             <value name="ADD0">
                               <block type="text" id="h7]?0SOylTL]b`ggQH5k">
                                 <field name="TEXT">Zufallszahl ist: </field>
                               </block>
                             </value>
                             <value name="ADD1">
                               <block type="variables_get" id="oxL73oh[p)bc6EDYQhEn">
                                 <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                               </block>
                             </value>
                           </block>
                         </value>
                         <next>
                           <block type="comment" id="zS.B29tn^G!}|5U@h{@B">
                             <field name="COMMENT">Warte 45 Sek. bis Play One fertig mit booten ist. </field>
                             <next>
                               <block type="timeouts_settimeout" id="N.Zi:Z;-D33=!0DG5#Vd">
                                 <field name="NAME">timeout2</field>
                                 <field name="DELAY">45</field>
                                 <field name="UNIT">sec</field>
                                 <statement name="STATEMENT">
                                   <block type="comment" id="go/7rv@xc]^18T7R$w6d">
                                     <field name="COMMENT">Setze ausgewählte Playlist</field>
                                     <next>
                                       <block type="controls_if" id="Qb0=j:cXfp%TH1G%:I=F">
                                         <value name="IF0">
                                           <block type="logic_compare" id="#]:^ZgN{}wS7muvJYQ.I">
                                             <field name="OP">EQ</field>
                                             <value name="A">
                                               <block type="variables_get" id="!.zW%7Y?M-3_9FpP}IBJ">
                                                 <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                               </block>
                                             </value>
                                             <value name="B">
                                               <block type="math_number" id="WO^a|evF2CR@HgiAYh-S">
                                                 <field name="NUM">1</field>
                                               </block>
                                             </value>
                                           </block>
                                         </value>
                                         <statement name="DO0">
                                           <block type="control" id="jDt:n8DD^NlQ3i^DdU]z">
                                             <mutation delay_input="false"></mutation>
                                             <field name="OID">sonos.0.root.192_168_168_125.favorites_set</field>
                                             <field name="WITH_DELAY">FALSE</field>
                                             <value name="VALUE">
                                               <block type="text" id="HGj3X=hh=0i.SZyYw?VY">
                                                 <field name="TEXT">Soundeo Latest Uploads</field>
                                               </block>
                                             </value>
                                           </block>
                                         </statement>
                                         <next>
                                           <block type="controls_if" id="R438`n-MJ:pn0;K,S`W@">
                                             <value name="IF0">
                                               <block type="logic_compare" id=":*6%AW~C|iwJWpD*saaN">
                                                 <field name="OP">EQ</field>
                                                 <value name="A">
                                                   <block type="variables_get" id="Iob~pV;+6t(tgb7BUqhy">
                                                     <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                                   </block>
                                                 </value>
                                                 <value name="B">
                                                   <block type="math_number" id=":)K6X|d2rOR$.m^n)Wom">
                                                     <field name="NUM">2</field>
                                                   </block>
                                                 </value>
                                               </block>
                                             </value>
                                             <statement name="DO0">
                                               <block type="control" id="It@G^~kq@jIOhOp:lfbp">
                                                 <mutation delay_input="false"></mutation>
                                                 <field name="OID">sonos.0.root.192_168_168_125.favorites_set</field>
                                                 <field name="WITH_DELAY">FALSE</field>
                                                 <value name="VALUE">
                                                   <block type="text" id="c[ujuGYUt^`~.]`6|E;p">
                                                     <field name="TEXT">Sax4Love</field>
                                                   </block>
                                                 </value>
                                               </block>
                                             </statement>
                                             <next>
                                               <block type="controls_if" id="9kEJp*e);]^n`|N,wkVe">
                                                 <value name="IF0">
                                                   <block type="logic_compare" id="2(g#B?$4w=cAsXz:v9Z{">
                                                     <field name="OP">EQ</field>
                                                     <value name="A">
                                                       <block type="variables_get" id="HF|p(uwAnEd!2f1%B$L0">
                                                         <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                                       </block>
                                                     </value>
                                                     <value name="B">
                                                       <block type="math_number" id="^fW$`8+-#W9$SLZ6S7lr">
                                                         <field name="NUM">3</field>
                                                       </block>
                                                     </value>
                                                   </block>
                                                 </value>
                                                 <statement name="DO0">
                                                   <block type="control" id="6ucPT6:(wt`)ve}[l}O2">
                                                     <mutation delay_input="false"></mutation>
                                                     <field name="OID">sonos.0.root.192_168_168_125.favorites_set</field>
                                                     <field name="WITH_DELAY">FALSE</field>
                                                     <value name="VALUE">
                                                       <block type="text" id="r}1@#}8:($3U@M|9]+u?">
                                                         <field name="TEXT">80 Verschiedenes</field>
                                                       </block>
                                                     </value>
                                                   </block>
                                                 </statement>
                                                 <next>
                                                   <block type="comment" id="U(nj#85emc.fPwHj(x/v">
                                                     <field name="COMMENT">Play Button drücken und Zufallswiedergabe einschalten</field>
                                                     <next>
                                                       <block type="control" id="7Ha=#+jIwIv@WIQ,dpTe">
                                                         <mutation delay_input="false"></mutation>
                                                         <field name="OID">sonos.0.root.192_168_168_125.state</field>
                                                         <field name="WITH_DELAY">FALSE</field>
                                                         <value name="VALUE">
                                                           <block type="text" id="O,Cgm-[?73_7.e,,Kawg">
                                                             <field name="TEXT">Play</field>
                                                           </block>
                                                         </value>
                                                         <next>
                                                           <block type="control" id="Vj|M=jqHN2Vw;ldl|1}q">
                                                             <mutation delay_input="false"></mutation>
                                                             <field name="OID">sonos.0.root.192_168_168_125.shuffle</field>
                                                             <field name="WITH_DELAY">FALSE</field>
                                                             <value name="VALUE">
                                                               <block type="logic_boolean" id="b!OyfmSS@hb*^%g-Bja*">
                                                                 <field name="BOOL">TRUE</field>
                                                               </block>
                                                             </value>
                                                             <next>
                                                               <block type="control" id="~W,)6;jC%L6v}H}E19vi">
                                                                 <mutation delay_input="false"></mutation>
                                                                 <field name="OID">sonos.0.root.192_168_168_125.play</field>
                                                                 <field name="WITH_DELAY">FALSE</field>
                                                                 <value name="VALUE">
                                                                   <block type="logic_boolean" id="p@Tq4NGT_+`ZDz9OmxG?">
                                                                     <field name="BOOL">TRUE</field>
                                                                   </block>
                                                                 </value>
                                                                 <next>
                                                                   <block type="control" id="WT|N}iScao.)0C_fmw0l">
                                                                     <mutation delay_input="false"></mutation>
                                                                     <field name="OID">sonos.0.root.192_168_168_125.stop</field>
                                                                     <field name="WITH_DELAY">FALSE</field>
                                                                     <value name="VALUE">
                                                                       <block type="logic_boolean" id="+DQ#k_:Fc/$4Wx,@w3sb">
                                                                         <field name="BOOL">FALSE</field>
                                                                       </block>
                                                                     </value>
                                                                   </block>
                                                                 </next>
                                                               </block>
                                                             </next>
                                                           </block>
                                                         </next>
                                                       </block>
                                                     </next>
                                                   </block>
                                                 </next>
                                               </block>
                                             </next>
                                           </block>
                                         </next>
                                       </block>
                                     </next>
                                   </block>
                                 </statement>
                                 <next>
                                   <block type="timeouts_settimeout" id="]i?*`tzPK8Q1G)Ax#Kjh">
                                     <field name="NAME">timeout</field>
                                     <field name="DELAY">25</field>
                                     <field name="UNIT">min</field>
                                     <statement name="STATEMENT">
                                       <block type="comment" id="ept9::Rg-9s.[S8EeZE]">
                                         <field name="COMMENT">Einstellungen zurück setzten</field>
                                         <next>
                                           <block type="control" id="$A{l6=9dWC7_+uoc]2dC">
                                             <mutation delay_input="false"></mutation>
                                             <field name="OID">sonos.0.root.192_168_168_125.state</field>
                                             <field name="WITH_DELAY">FALSE</field>
                                             <value name="VALUE">
                                               <block type="text" id=",uKPRE_tI2MG|xNU(F2p">
                                                 <field name="TEXT">Stop</field>
                                               </block>
                                             </value>
                                             <next>
                                               <block type="control" id="3=j[ET#(yu~nkt*be[Xi">
                                                 <mutation delay_input="false"></mutation>
                                                 <field name="OID">sonos.0.root.192_168_168_125.play</field>
                                                 <field name="WITH_DELAY">FALSE</field>
                                                 <value name="VALUE">
                                                   <block type="logic_boolean" id="W@q$#~nA$oZ[@,ht8GL6">
                                                     <field name="BOOL">FALSE</field>
                                                   </block>
                                                 </value>
                                                 <next>
                                                   <block type="control" id="Xj?P}6q?rLh|@~U_M7nP">
                                                     <mutation delay_input="false"></mutation>
                                                     <field name="OID">sonos.0.root.192_168_168_125.stop</field>
                                                     <field name="WITH_DELAY">FALSE</field>
                                                     <value name="VALUE">
                                                       <block type="logic_boolean" id="nH$L.VhS?|.jh$aL3F_#">
                                                         <field name="BOOL">TRUE</field>
                                                       </block>
                                                     </value>
                                                   </block>
                                                 </next>
                                               </block>
                                             </next>
                                           </block>
                                         </next>
                                       </block>
                                     </statement>
                                     <next>
                                       <block type="timeouts_settimeout" id="7SOnzWgj4to;E{`mGM+_">
                                         <field name="NAME">timeout3</field>
                                         <field name="DELAY">26</field>
                                         <field name="UNIT">min</field>
                                         <statement name="STATEMENT">
                                           <block type="comment" id="njZoiNzr71$8Bbnrf|w?">
                                             <field name="COMMENT">Strom der Play One ausschalten</field>
                                             <next>
                                               <block type="control" id="DdS9,DFxM}r92DB,~{+]">
                                                 <mutation delay_input="false"></mutation>
                                                 <field name="OID">tuya.0.0120036768c63a8690e1.1</field>
                                                 <field name="WITH_DELAY">FALSE</field>
                                                 <value name="VALUE">
                                                   <block type="logic_boolean" id="z(Q-|1XuV*G:y4l)p*NA">
                                                     <field name="BOOL">FALSE</field>
                                                   </block>
                                                 </value>
                                                 <next>
                                                   <block type="debug" id="kzHrF=0*[KR{p.H~3bJE">
                                                     <field name="Severity">log</field>
                                                     <value name="TEXT">
                                                       <shadow type="text" id="!hH#.aoebG)35y0~vMCR">
                                                         <field name="TEXT">test</field>
                                                       </shadow>
                                                       <block type="text" id="dHOz$*nyW2d.%zSw=@i*">
                                                         <field name="TEXT">Bedezimmer Sonos Script wurde richtig beendet</field>
                                                       </block>
                                                     </value>
                                                   </block>
                                                 </next>
                                               </block>
                                             </next>
                                           </block>
                                         </statement>
                                       </block>
                                     </next>
                                   </block>
                                 </next>
                               </block>
                             </next>
                           </block>
                         </next>
                       </block>
                     </next>
                   </block>
                 </next>
               </block>
             </statement>
             <statement name="ELSE">
               <block type="timeouts_cleartimeout" id="55b_bTF@d%,P]dVmssmd">
                 <field name="NAME">timeout</field>
                 <next>
                   <block type="timeouts_cleartimeout" id="hjz0.$|x5stGpmC?[?hc">
                     <field name="NAME">timeout2</field>
                     <next>
                       <block type="timeouts_cleartimeout" id=".y8ZUSEG?JxRkM}MA@nj">
                         <field name="NAME">timeout3</field>
                         <next>
                           <block type="debug" id="{9O.pL-u+9SQQS9jPVKa">
                             <field name="Severity">log</field>
                             <value name="TEXT">
                               <shadow type="text" id="!hH#.aoebG)35y0~vMCR">
                                 <field name="TEXT">test</field>
                               </shadow>
                               <block type="text" id="s:i]N[!E_Q(dr})-b:MH">
                                 <field name="TEXT">Bedezimmer Sonos wurde unterbrochen</field>
                               </block>
                             </value>
                           </block>
                         </next>
                       </block>
                     </next>
                   </block>
                 </next>
               </block>
             </statement>
           </block>
         </statement>
       </block>
      </xml>
      

      ioBroker auf NUC (VM debian v13 (Trixie ), node v22.21.0 npm v10.9.4, js-controller v7.1.0 jsonl/jsonl / HomeMatic CCU-2 (Wired und Funk) / Philips HUE / echo.DOT / Broadlink RM pro / SONOS

      S 1 Antwort Letzte Antwort
      0
      • BBTownB BBTown

        @Spitfire4all
        was soll denn passieren wenn der Schalter auf "aus" gestellt wird?

        So wie derzeit dein Script aufgebaut ist, wird gnadenlos nun 25 (24) Minuten Musik abgespielt, ganz gleich was zwischendurch passiert ...eine Unterbrechung ist nicht vorgesehen(??)

        ich würde es wohl mit einer Funktion versuchen.
        so in etwa
        e02acfa3-8cd1-404f-a7c8-f03db2d7d286-image.png

        <xml xmlns="http://www.w3.org/1999/xhtml">
         <variables>
           <variable type="" id="!v7{U.VSh6/azeW{Jaqg">Zeitfenster</variable>
           <variable type="" id="m=ypi^k)0W;c(`cat^!g">sonos_ein</variable>
           <variable type="" id="3d}EB@SqB|hB+,zAp}%K">Zufall</variable>
           <variable type="undefined" id="timeout2">timeout2</variable>
           <variable type="undefined" id="timeout">timeout</variable>
           <variable type="undefined" id="timeout3">timeout3</variable>
         </variables>
         <block type="variables_set" id="eZV]K1Ff|:hJE{FM_UQx" x="-263" y="-212">
           <field name="VAR" id="!v7{U.VSh6/azeW{Jaqg" variabletype="">Zeitfenster</field>
           <value name="VALUE">
             <block type="logic_boolean" id="rt(4wwhlD_tjt`zG:+Ep">
               <field name="BOOL">TRUE</field>
             </block>
           </value>
           <next>
             <block type="on_ext" id="~lMbB0:Q*jP#]=nk?Gn2">
               <mutation items="1"></mutation>
               <field name="CONDITION">ne</field>
               <field name="ACK_CONDITION"></field>
               <value name="OID0">
                 <shadow type="field_oid" id="wA*u?Z)9(r%N`CB={YyB">
                   <field name="oid">tuya.0.0120036768c63a8690e1.1</field>
                 </shadow>
               </value>
               <statement name="STATEMENT">
                 <block type="variables_set" id="np2(3?{z8,1J*[:`.FcV">
                   <field name="VAR" id="m=ypi^k)0W;c(`cat^!g" variabletype="">sonos_ein</field>
                   <value name="VALUE">
                     <block type="on_source" id="{)WIi5VwdU]sSc`f:*CR">
                       <field name="ATTR">state.val</field>
                     </block>
                   </value>
                   <next>
                     <block type="procedures_callnoreturn" id="{dr){-z!-b~KK$9,g-GG">
                       <mutation name="Musik"></mutation>
                     </block>
                   </next>
                 </block>
               </statement>
               <next>
                 <block type="schedule" id="VL+d]%cE]e?Dh-0Jq}%!">
                   <field name="SCHEDULE">0 10 * * 0,6</field>
                   <statement name="STATEMENT">
                     <block type="variables_set" id="nGdb1?L~epE))y%(;AqO">
                       <field name="VAR" id="!v7{U.VSh6/azeW{Jaqg" variabletype="">Zeitfenster</field>
                       <value name="VALUE">
                         <block type="logic_boolean" id="i8@_w582B-)Axf|WCgrg">
                           <field name="BOOL">TRUE</field>
                         </block>
                       </value>
                     </block>
                   </statement>
                   <next>
                     <block type="schedule" id="2F{AW$Xk9T4[Vm|#i/FS">
                       <field name="SCHEDULE">0 22 * * 0,6</field>
                       <statement name="STATEMENT">
                         <block type="variables_set" id="GzJ~Xz873(i5t[0LK[!k">
                           <field name="VAR" id="!v7{U.VSh6/azeW{Jaqg" variabletype="">Zeitfenster</field>
                           <value name="VALUE">
                             <block type="logic_boolean" id="XCQUg39KI*,fuQ)huz)M">
                               <field name="BOOL">FALSE</field>
                             </block>
                           </value>
                         </block>
                       </statement>
                       <next>
                         <block type="schedule" id="Jgut%gD9oAcae+{Af=,n">
                           <field name="SCHEDULE">{"time":{"exactTime":true,"start":"17:00"},"period":{"days":1,"dows":"[1, 2, 3, 4, 5]"},"valid":{"from":"14.11.2019","to":""}}</field>
                           <statement name="STATEMENT">
                             <block type="variables_set" id="^!G-}e=0i`$6L8@G||tY">
                               <field name="VAR" id="!v7{U.VSh6/azeW{Jaqg" variabletype="">Zeitfenster</field>
                               <value name="VALUE">
                                 <block type="logic_boolean" id=")~0r|WDHErVDuSP;3Qxy">
                                   <field name="BOOL">TRUE</field>
                                 </block>
                               </value>
                             </block>
                           </statement>
                           <next>
                             <block type="schedule" id=":K{sc1PRj:9W)oy~1zj0">
                               <field name="SCHEDULE">{"time":{"exactTime":true,"start":"20:00"},"period":{"days":1,"dows":"[1, 2, 3, 4, 5]"}}</field>
                               <statement name="STATEMENT">
                                 <block type="variables_set" id="C92F%Pi9mWKrj##]j!P?">
                                   <field name="VAR" id="!v7{U.VSh6/azeW{Jaqg" variabletype="">Zeitfenster</field>
                                   <value name="VALUE">
                                     <block type="logic_boolean" id="H)|Sq)a.w,`mL??}vlP+">
                                       <field name="BOOL">FALSE</field>
                                     </block>
                                   </value>
                                 </block>
                               </statement>
                             </block>
                           </next>
                         </block>
                       </next>
                     </block>
                   </next>
                 </block>
               </next>
             </block>
           </next>
         </block>
         <block type="procedures_defnoreturn" id="FEehSnae$vKz2R@)GQw]" x="288" y="-212">
           <field name="NAME">Musik</field>
           <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
           <statement name="STACK">
             <block type="controls_if" id="%_JMBf~%RB,U7hvJPSro">
               <mutation else="1"></mutation>
               <value name="IF0">
                 <block type="logic_operation" id="fS00F{j0HSxjoye=$f49" inline="false">
                   <field name="OP">AND</field>
                   <value name="A">
                     <block type="variables_get" id="VXiqTf*11Zc+Ov2Y?Gre">
                       <field name="VAR" id="m=ypi^k)0W;c(`cat^!g" variabletype="">sonos_ein</field>
                     </block>
                   </value>
                   <value name="B">
                     <block type="variables_get" id="b8?R$}B:-DG.JUsFiS(t">
                       <field name="VAR" id="!v7{U.VSh6/azeW{Jaqg" variabletype="">Zeitfenster</field>
                     </block>
                   </value>
                 </block>
               </value>
               <statement name="DO0">
                 <block type="comment" id="tNK.LFOipiXt=ka)]o0,">
                   <field name="COMMENT">Wähle eine von drei Playlisten</field>
                   <next>
                     <block type="variables_set" id="UJ4*^Ms.t4xXA}e5+gGQ">
                       <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                       <value name="VALUE">
                         <block type="math_random_int" id="M^S)YBi_[T#YlweQqYN`">
                           <value name="FROM">
                             <shadow type="math_number" id="3g0-fSTB;}+YaTw]a9DI">
                               <field name="NUM">1</field>
                             </shadow>
                           </value>
                           <value name="TO">
                             <shadow type="math_number" id="QF)fsNwM][mV]x[(^QkC">
                               <field name="NUM">3</field>
                             </shadow>
                           </value>
                         </block>
                       </value>
                       <next>
                         <block type="debug" id="iY`wo=F02sG=Tn3i|M)[">
                           <field name="Severity">log</field>
                           <value name="TEXT">
                             <shadow type="text" id="@DVofOcXZk@PnTjN4yZ5">
                               <field name="TEXT">test</field>
                             </shadow>
                             <block type="text_join" id="-q#[,s~|J?aNb^?~2AR]">
                               <mutation items="2"></mutation>
                               <value name="ADD0">
                                 <block type="text" id="h7]?0SOylTL]b`ggQH5k">
                                   <field name="TEXT">Zufallszahl ist: </field>
                                 </block>
                               </value>
                               <value name="ADD1">
                                 <block type="variables_get" id="oxL73oh[p)bc6EDYQhEn">
                                   <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                 </block>
                               </value>
                             </block>
                           </value>
                           <next>
                             <block type="comment" id="zS.B29tn^G!}|5U@h{@B">
                               <field name="COMMENT">Warte 45 Sek. bis Play One fertig mit booten ist. </field>
                               <next>
                                 <block type="timeouts_settimeout" id="N.Zi:Z;-D33=!0DG5#Vd">
                                   <field name="NAME">timeout2</field>
                                   <field name="DELAY">45</field>
                                   <field name="UNIT">sec</field>
                                   <statement name="STATEMENT">
                                     <block type="comment" id="go/7rv@xc]^18T7R$w6d">
                                       <field name="COMMENT">Setze ausgewählte Playlist</field>
                                       <next>
                                         <block type="controls_if" id="Qb0=j:cXfp%TH1G%:I=F">
                                           <value name="IF0">
                                             <block type="logic_compare" id="#]:^ZgN{}wS7muvJYQ.I">
                                               <field name="OP">EQ</field>
                                               <value name="A">
                                                 <block type="variables_get" id="!.zW%7Y?M-3_9FpP}IBJ">
                                                   <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                                 </block>
                                               </value>
                                               <value name="B">
                                                 <block type="math_number" id="WO^a|evF2CR@HgiAYh-S">
                                                   <field name="NUM">1</field>
                                                 </block>
                                               </value>
                                             </block>
                                           </value>
                                           <statement name="DO0">
                                             <block type="control" id="jDt:n8DD^NlQ3i^DdU]z">
                                               <mutation delay_input="false"></mutation>
                                               <field name="OID">sonos.0.root.192_168_168_125.favorites_set</field>
                                               <field name="WITH_DELAY">FALSE</field>
                                               <value name="VALUE">
                                                 <block type="text" id="HGj3X=hh=0i.SZyYw?VY">
                                                   <field name="TEXT">Soundeo Latest Uploads</field>
                                                 </block>
                                               </value>
                                             </block>
                                           </statement>
                                           <next>
                                             <block type="controls_if" id="R438`n-MJ:pn0;K,S`W@">
                                               <value name="IF0">
                                                 <block type="logic_compare" id=":*6%AW~C|iwJWpD*saaN">
                                                   <field name="OP">EQ</field>
                                                   <value name="A">
                                                     <block type="variables_get" id="Iob~pV;+6t(tgb7BUqhy">
                                                       <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                                     </block>
                                                   </value>
                                                   <value name="B">
                                                     <block type="math_number" id=":)K6X|d2rOR$.m^n)Wom">
                                                       <field name="NUM">2</field>
                                                     </block>
                                                   </value>
                                                 </block>
                                               </value>
                                               <statement name="DO0">
                                                 <block type="control" id="It@G^~kq@jIOhOp:lfbp">
                                                   <mutation delay_input="false"></mutation>
                                                   <field name="OID">sonos.0.root.192_168_168_125.favorites_set</field>
                                                   <field name="WITH_DELAY">FALSE</field>
                                                   <value name="VALUE">
                                                     <block type="text" id="c[ujuGYUt^`~.]`6|E;p">
                                                       <field name="TEXT">Sax4Love</field>
                                                     </block>
                                                   </value>
                                                 </block>
                                               </statement>
                                               <next>
                                                 <block type="controls_if" id="9kEJp*e);]^n`|N,wkVe">
                                                   <value name="IF0">
                                                     <block type="logic_compare" id="2(g#B?$4w=cAsXz:v9Z{">
                                                       <field name="OP">EQ</field>
                                                       <value name="A">
                                                         <block type="variables_get" id="HF|p(uwAnEd!2f1%B$L0">
                                                           <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                                         </block>
                                                       </value>
                                                       <value name="B">
                                                         <block type="math_number" id="^fW$`8+-#W9$SLZ6S7lr">
                                                           <field name="NUM">3</field>
                                                         </block>
                                                       </value>
                                                     </block>
                                                   </value>
                                                   <statement name="DO0">
                                                     <block type="control" id="6ucPT6:(wt`)ve}[l}O2">
                                                       <mutation delay_input="false"></mutation>
                                                       <field name="OID">sonos.0.root.192_168_168_125.favorites_set</field>
                                                       <field name="WITH_DELAY">FALSE</field>
                                                       <value name="VALUE">
                                                         <block type="text" id="r}1@#}8:($3U@M|9]+u?">
                                                           <field name="TEXT">80 Verschiedenes</field>
                                                         </block>
                                                       </value>
                                                     </block>
                                                   </statement>
                                                   <next>
                                                     <block type="comment" id="U(nj#85emc.fPwHj(x/v">
                                                       <field name="COMMENT">Play Button drücken und Zufallswiedergabe einschalten</field>
                                                       <next>
                                                         <block type="control" id="7Ha=#+jIwIv@WIQ,dpTe">
                                                           <mutation delay_input="false"></mutation>
                                                           <field name="OID">sonos.0.root.192_168_168_125.state</field>
                                                           <field name="WITH_DELAY">FALSE</field>
                                                           <value name="VALUE">
                                                             <block type="text" id="O,Cgm-[?73_7.e,,Kawg">
                                                               <field name="TEXT">Play</field>
                                                             </block>
                                                           </value>
                                                           <next>
                                                             <block type="control" id="Vj|M=jqHN2Vw;ldl|1}q">
                                                               <mutation delay_input="false"></mutation>
                                                               <field name="OID">sonos.0.root.192_168_168_125.shuffle</field>
                                                               <field name="WITH_DELAY">FALSE</field>
                                                               <value name="VALUE">
                                                                 <block type="logic_boolean" id="b!OyfmSS@hb*^%g-Bja*">
                                                                   <field name="BOOL">TRUE</field>
                                                                 </block>
                                                               </value>
                                                               <next>
                                                                 <block type="control" id="~W,)6;jC%L6v}H}E19vi">
                                                                   <mutation delay_input="false"></mutation>
                                                                   <field name="OID">sonos.0.root.192_168_168_125.play</field>
                                                                   <field name="WITH_DELAY">FALSE</field>
                                                                   <value name="VALUE">
                                                                     <block type="logic_boolean" id="p@Tq4NGT_+`ZDz9OmxG?">
                                                                       <field name="BOOL">TRUE</field>
                                                                     </block>
                                                                   </value>
                                                                   <next>
                                                                     <block type="control" id="WT|N}iScao.)0C_fmw0l">
                                                                       <mutation delay_input="false"></mutation>
                                                                       <field name="OID">sonos.0.root.192_168_168_125.stop</field>
                                                                       <field name="WITH_DELAY">FALSE</field>
                                                                       <value name="VALUE">
                                                                         <block type="logic_boolean" id="+DQ#k_:Fc/$4Wx,@w3sb">
                                                                           <field name="BOOL">FALSE</field>
                                                                         </block>
                                                                       </value>
                                                                     </block>
                                                                   </next>
                                                                 </block>
                                                               </next>
                                                             </block>
                                                           </next>
                                                         </block>
                                                       </next>
                                                     </block>
                                                   </next>
                                                 </block>
                                               </next>
                                             </block>
                                           </next>
                                         </block>
                                       </next>
                                     </block>
                                   </statement>
                                   <next>
                                     <block type="timeouts_settimeout" id="]i?*`tzPK8Q1G)Ax#Kjh">
                                       <field name="NAME">timeout</field>
                                       <field name="DELAY">25</field>
                                       <field name="UNIT">min</field>
                                       <statement name="STATEMENT">
                                         <block type="comment" id="ept9::Rg-9s.[S8EeZE]">
                                           <field name="COMMENT">Einstellungen zurück setzten</field>
                                           <next>
                                             <block type="control" id="$A{l6=9dWC7_+uoc]2dC">
                                               <mutation delay_input="false"></mutation>
                                               <field name="OID">sonos.0.root.192_168_168_125.state</field>
                                               <field name="WITH_DELAY">FALSE</field>
                                               <value name="VALUE">
                                                 <block type="text" id=",uKPRE_tI2MG|xNU(F2p">
                                                   <field name="TEXT">Stop</field>
                                                 </block>
                                               </value>
                                               <next>
                                                 <block type="control" id="3=j[ET#(yu~nkt*be[Xi">
                                                   <mutation delay_input="false"></mutation>
                                                   <field name="OID">sonos.0.root.192_168_168_125.play</field>
                                                   <field name="WITH_DELAY">FALSE</field>
                                                   <value name="VALUE">
                                                     <block type="logic_boolean" id="W@q$#~nA$oZ[@,ht8GL6">
                                                       <field name="BOOL">FALSE</field>
                                                     </block>
                                                   </value>
                                                   <next>
                                                     <block type="control" id="Xj?P}6q?rLh|@~U_M7nP">
                                                       <mutation delay_input="false"></mutation>
                                                       <field name="OID">sonos.0.root.192_168_168_125.stop</field>
                                                       <field name="WITH_DELAY">FALSE</field>
                                                       <value name="VALUE">
                                                         <block type="logic_boolean" id="nH$L.VhS?|.jh$aL3F_#">
                                                           <field name="BOOL">TRUE</field>
                                                         </block>
                                                       </value>
                                                     </block>
                                                   </next>
                                                 </block>
                                               </next>
                                             </block>
                                           </next>
                                         </block>
                                       </statement>
                                       <next>
                                         <block type="timeouts_settimeout" id="7SOnzWgj4to;E{`mGM+_">
                                           <field name="NAME">timeout3</field>
                                           <field name="DELAY">26</field>
                                           <field name="UNIT">min</field>
                                           <statement name="STATEMENT">
                                             <block type="comment" id="njZoiNzr71$8Bbnrf|w?">
                                               <field name="COMMENT">Strom der Play One ausschalten</field>
                                               <next>
                                                 <block type="control" id="DdS9,DFxM}r92DB,~{+]">
                                                   <mutation delay_input="false"></mutation>
                                                   <field name="OID">tuya.0.0120036768c63a8690e1.1</field>
                                                   <field name="WITH_DELAY">FALSE</field>
                                                   <value name="VALUE">
                                                     <block type="logic_boolean" id="z(Q-|1XuV*G:y4l)p*NA">
                                                       <field name="BOOL">FALSE</field>
                                                     </block>
                                                   </value>
                                                   <next>
                                                     <block type="debug" id="kzHrF=0*[KR{p.H~3bJE">
                                                       <field name="Severity">log</field>
                                                       <value name="TEXT">
                                                         <shadow type="text" id="!hH#.aoebG)35y0~vMCR">
                                                           <field name="TEXT">test</field>
                                                         </shadow>
                                                         <block type="text" id="dHOz$*nyW2d.%zSw=@i*">
                                                           <field name="TEXT">Bedezimmer Sonos Script wurde richtig beendet</field>
                                                         </block>
                                                       </value>
                                                     </block>
                                                   </next>
                                                 </block>
                                               </next>
                                             </block>
                                           </statement>
                                         </block>
                                       </next>
                                     </block>
                                   </next>
                                 </block>
                               </next>
                             </block>
                           </next>
                         </block>
                       </next>
                     </block>
                   </next>
                 </block>
               </statement>
               <statement name="ELSE">
                 <block type="timeouts_cleartimeout" id="55b_bTF@d%,P]dVmssmd">
                   <field name="NAME">timeout</field>
                   <next>
                     <block type="timeouts_cleartimeout" id="hjz0.$|x5stGpmC?[?hc">
                       <field name="NAME">timeout2</field>
                       <next>
                         <block type="timeouts_cleartimeout" id=".y8ZUSEG?JxRkM}MA@nj">
                           <field name="NAME">timeout3</field>
                           <next>
                             <block type="debug" id="{9O.pL-u+9SQQS9jPVKa">
                               <field name="Severity">log</field>
                               <value name="TEXT">
                                 <shadow type="text" id="!hH#.aoebG)35y0~vMCR">
                                   <field name="TEXT">test</field>
                                 </shadow>
                                 <block type="text" id="s:i]N[!E_Q(dr})-b:MH">
                                   <field name="TEXT">Bedezimmer Sonos wurde unterbrochen</field>
                                 </block>
                               </value>
                             </block>
                           </next>
                         </block>
                       </next>
                     </block>
                   </next>
                 </block>
               </statement>
             </block>
           </statement>
         </block>
        </xml>
        

        S Offline
        S Offline
        Spitfire4all
        schrieb am zuletzt editiert von
        #3

        @BBTown
        Wenn der Schalter auf aus geht dann läuft das Script einfach aus, habe ich eingebaut damit es keine Fehlermeldung im Log gibt. Ja der Lautsprecher läuft 24 Minuten. Wüsste nicht was er zwischendurch machen sollte. Ist halt das erste Script das ich gemacht habe , irgendwie muss man ja einmal an fangen. Stricke bestimmt auch noch eine Präsenz Funktion hinzu. Deine Funktio schaue ich mir einmal an, vielen Dank.

        HDM

        1 Antwort Letzte Antwort
        0
        • S Spitfire4all

          Hi,

          ich bin neu in der Blockly Programmierung und möchte das ein Script nur in einem bestimmten Zeitfenster ausgeführt wird. Und zwar in der Woche von 17:00 Uhr bis 20:00 Uhr und am Wochenende von 10:00 Uhr bis 22:00 Uhr. Einen Trigger kann ich nicht verwenden. Mit "aktuelle Zeit ist kleiner bzw grösser" könnte ich die Zeit zwischen 17:00 Uhr bis 20 Uhr abfackeln. Aber wie mache ich das mit dem Wochenende, das ist mir noch nicht ganz klar. Ich könnte noch ein falls sonst einfügen und oben neben dem falls noch das "aktuelle Zeit ist kleiner bzw grösser" hinzufügen aber weiter komme ich gerade nicht.
          Jemand eine Idee ?
          Hier einmal das Script wie es im Moment ist:

          <xml xmlns="http://www.w3.org/1999/xhtml">
            <variables>
              <variable type="" id="3d}EB@SqB|hB+,zAp}%K">Zufall</variable>
              <variable type="undefined" id="timeout2">timeout2</variable>
              <variable type="undefined" id="timeout">timeout</variable>
              <variable type="undefined" id="timeout3">timeout3</variable>
            </variables>
            <block type="comment" id="b!|pe^OFH/rH,4^g-#%+" x="-162" y="-188">
              <field name="COMMENT">Sonos im Bad über Pir ( Steckdose ) einschalten und Musik abspielenn </field>
              <next>
                <block type="on_ext" id="~lMbB0:Q*jP#]=nk?Gn2">
                  <mutation items="1"></mutation>
                  <field name="CONDITION">ne</field>
                  <field name="ACK_CONDITION"></field>
                  <value name="OID0">
                    <shadow type="field_oid" id="wA*u?Z)9(r%N`CB={YyB">
                      <field name="oid">tuya.0.0120036768c63a8690e1.1</field>
                    </shadow>
                  </value>
                  <statement name="STATEMENT">
                    <block type="comment" id="%DyjIDZ=o5oI~S)mcT5R">
                      <field name="COMMENT">Prüfe ob die Änderung die Dose ein oder aus geschaltet hat.</field>
                      <next>
                        <block type="controls_if" id="%_JMBf~%RB,U7hvJPSro">
                          <mutation else="1"></mutation>
                          <value name="IF0">
                            <block type="logic_compare" id=",K/J@/~_3,|w-$hujonP">
                              <field name="OP">EQ</field>
                              <value name="A">
                                <block type="get_value" id="rRsD?zs7I7xPzS#5dYoj">
                                  <field name="ATTR">val</field>
                                  <field name="OID">tuya.0.0120036768c63a8690e1.1</field>
                                </block>
                              </value>
                              <value name="B">
                                <block type="logic_boolean" id="JA[VZwmH:T)t=:r!f%sT">
                                  <field name="BOOL">TRUE</field>
                                </block>
                              </value>
                            </block>
                          </value>
                          <statement name="DO0">
                            <block type="comment" id="tNK.LFOipiXt=ka)]o0,">
                              <field name="COMMENT">Wähle eine von drei Playlisten</field>
                              <next>
                                <block type="variables_set" id="UJ4*^Ms.t4xXA}e5+gGQ">
                                  <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                  <value name="VALUE">
                                    <block type="math_random_int" id="M^S)YBi_[T#YlweQqYN`">
                                      <value name="FROM">
                                        <shadow type="math_number" id="3g0-fSTB;}+YaTw]a9DI">
                                          <field name="NUM">1</field>
                                        </shadow>
                                      </value>
                                      <value name="TO">
                                        <shadow type="math_number" id="QF)fsNwM][mV]x[(^QkC">
                                          <field name="NUM">3</field>
                                        </shadow>
                                      </value>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="debug" id="iY`wo=F02sG=Tn3i|M)[">
                                      <field name="Severity">log</field>
                                      <value name="TEXT">
                                        <shadow type="text" id="@DVofOcXZk@PnTjN4yZ5">
                                          <field name="TEXT">test</field>
                                        </shadow>
                                        <block type="text_join" id="-q#[,s~|J?aNb^?~2AR]">
                                          <mutation items="2"></mutation>
                                          <value name="ADD0">
                                            <block type="text" id="h7]?0SOylTL]b`ggQH5k">
                                              <field name="TEXT">Zufallszahl ist: </field>
                                            </block>
                                          </value>
                                          <value name="ADD1">
                                            <block type="variables_get" id="oxL73oh[p)bc6EDYQhEn">
                                              <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                      <next>
                                        <block type="comment" id="zS.B29tn^G!}|5U@h{@B">
                                          <field name="COMMENT">Warte 45 Sek. bis Play One fertig mit booten ist. </field>
                                          <next>
                                            <block type="timeouts_settimeout" id="N.Zi:Z;-D33=!0DG5#Vd">
                                              <field name="NAME">timeout2</field>
                                              <field name="DELAY">45</field>
                                              <field name="UNIT">sec</field>
                                              <statement name="STATEMENT">
                                                <block type="comment" id="go/7rv@xc]^18T7R$w6d">
                                                  <field name="COMMENT">Setze ausgewählte Playlist</field>
                                                  <next>
                                                    <block type="controls_if" id="Qb0=j:cXfp%TH1G%:I=F">
                                                      <value name="IF0">
                                                        <block type="logic_compare" id="#]:^ZgN{}wS7muvJYQ.I">
                                                          <field name="OP">EQ</field>
                                                          <value name="A">
                                                            <block type="variables_get" id="!.zW%7Y?M-3_9FpP}IBJ">
                                                              <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                                            </block>
                                                          </value>
                                                          <value name="B">
                                                            <block type="math_number" id="WO^a|evF2CR@HgiAYh-S">
                                                              <field name="NUM">1</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                      <statement name="DO0">
                                                        <block type="control" id="jDt:n8DD^NlQ3i^DdU]z">
                                                          <mutation delay_input="false"></mutation>
                                                          <field name="OID">sonos.0.root.192_168_168_125.favorites_set</field>
                                                          <field name="WITH_DELAY">FALSE</field>
                                                          <value name="VALUE">
                                                            <block type="text" id="HGj3X=hh=0i.SZyYw?VY">
                                                              <field name="TEXT">Soundeo Latest Uploads</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </statement>
                                                      <next>
                                                        <block type="controls_if" id="R438`n-MJ:pn0;K,S`W@">
                                                          <value name="IF0">
                                                            <block type="logic_compare" id=":*6%AW~C|iwJWpD*saaN">
                                                              <field name="OP">EQ</field>
                                                              <value name="A">
                                                                <block type="variables_get" id="Iob~pV;+6t(tgb7BUqhy">
                                                                  <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                                                </block>
                                                              </value>
                                                              <value name="B">
                                                                <block type="math_number" id=":)K6X|d2rOR$.m^n)Wom">
                                                                  <field name="NUM">2</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                          <statement name="DO0">
                                                            <block type="control" id="It@G^~kq@jIOhOp:lfbp">
                                                              <mutation delay_input="false"></mutation>
                                                              <field name="OID">sonos.0.root.192_168_168_125.favorites_set</field>
                                                              <field name="WITH_DELAY">FALSE</field>
                                                              <value name="VALUE">
                                                                <block type="text" id="c[ujuGYUt^`~.]`6|E;p">
                                                                  <field name="TEXT">Sax4Love</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </statement>
                                                          <next>
                                                            <block type="controls_if" id="9kEJp*e);]^n`|N,wkVe">
                                                              <value name="IF0">
                                                                <block type="logic_compare" id="2(g#B?$4w=cAsXz:v9Z{">
                                                                  <field name="OP">EQ</field>
                                                                  <value name="A">
                                                                    <block type="variables_get" id="HF|p(uwAnEd!2f1%B$L0">
                                                                      <field name="VAR" id="3d}EB@SqB|hB+,zAp}%K" variabletype="">Zufall</field>
                                                                    </block>
                                                                  </value>
                                                                  <value name="B">
                                                                    <block type="math_number" id="^fW$`8+-#W9$SLZ6S7lr">
                                                                      <field name="NUM">3</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                              <statement name="DO0">
                                                                <block type="control" id="6ucPT6:(wt`)ve}[l}O2">
                                                                  <mutation delay_input="false"></mutation>
                                                                  <field name="OID">sonos.0.root.192_168_168_125.favorites_set</field>
                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                  <value name="VALUE">
                                                                    <block type="text" id="r}1@#}8:($3U@M|9]+u?">
                                                                      <field name="TEXT">80 Verschiedenes</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </statement>
                                                              <next>
                                                                <block type="comment" id="U(nj#85emc.fPwHj(x/v">
                                                                  <field name="COMMENT">Play Button drücken und Zufallswiedergabe einschalten</field>
                                                                  <next>
                                                                    <block type="control" id="7Ha=#+jIwIv@WIQ,dpTe">
                                                                      <mutation delay_input="false"></mutation>
                                                                      <field name="OID">sonos.0.root.192_168_168_125.state</field>
                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                      <value name="VALUE">
                                                                        <block type="text" id="O,Cgm-[?73_7.e,,Kawg">
                                                                          <field name="TEXT">Play</field>
                                                                        </block>
                                                                      </value>
                                                                      <next>
                                                                        <block type="control" id="Vj|M=jqHN2Vw;ldl|1}q">
                                                                          <mutation delay_input="false"></mutation>
                                                                          <field name="OID">sonos.0.root.192_168_168_125.shuffle</field>
                                                                          <field name="WITH_DELAY">FALSE</field>
                                                                          <value name="VALUE">
                                                                            <block type="logic_boolean" id="b!OyfmSS@hb*^%g-Bja*">
                                                                              <field name="BOOL">TRUE</field>
                                                                            </block>
                                                                          </value>
                                                                          <next>
                                                                            <block type="control" id="~W,)6;jC%L6v}H}E19vi">
                                                                              <mutation delay_input="false"></mutation>
                                                                              <field name="OID">sonos.0.root.192_168_168_125.play</field>
                                                                              <field name="WITH_DELAY">FALSE</field>
                                                                              <value name="VALUE">
                                                                                <block type="logic_boolean" id="p@Tq4NGT_+`ZDz9OmxG?">
                                                                                  <field name="BOOL">TRUE</field>
                                                                                </block>
                                                                              </value>
                                                                              <next>
                                                                                <block type="control" id="WT|N}iScao.)0C_fmw0l">
                                                                                  <mutation delay_input="false"></mutation>
                                                                                  <field name="OID">sonos.0.root.192_168_168_125.stop</field>
                                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                                  <value name="VALUE">
                                                                                    <block type="logic_boolean" id="+DQ#k_:Fc/$4Wx,@w3sb">
                                                                                      <field name="BOOL">FALSE</field>
                                                                                    </block>
                                                                                  </value>
                                                                                </block>
                                                                              </next>
                                                                            </block>
                                                                          </next>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </statement>
                                              <next>
                                                <block type="timeouts_settimeout" id="]i?*`tzPK8Q1G)Ax#Kjh">
                                                  <field name="NAME">timeout</field>
                                                  <field name="DELAY">25</field>
                                                  <field name="UNIT">min</field>
                                                  <statement name="STATEMENT">
                                                    <block type="comment" id="ept9::Rg-9s.[S8EeZE]">
                                                      <field name="COMMENT">Einstellungen zurück setzten</field>
                                                      <next>
                                                        <block type="control" id="$A{l6=9dWC7_+uoc]2dC">
                                                          <mutation delay_input="false"></mutation>
                                                          <field name="OID">sonos.0.root.192_168_168_125.state</field>
                                                          <field name="WITH_DELAY">FALSE</field>
                                                          <value name="VALUE">
                                                            <block type="text" id=",uKPRE_tI2MG|xNU(F2p">
                                                              <field name="TEXT">Stop</field>
                                                            </block>
                                                          </value>
                                                          <next>
                                                            <block type="control" id="3=j[ET#(yu~nkt*be[Xi">
                                                              <mutation delay_input="false"></mutation>
                                                              <field name="OID">sonos.0.root.192_168_168_125.play</field>
                                                              <field name="WITH_DELAY">FALSE</field>
                                                              <value name="VALUE">
                                                                <block type="logic_boolean" id="W@q$#~nA$oZ[@,ht8GL6">
                                                                  <field name="BOOL">FALSE</field>
                                                                </block>
                                                              </value>
                                                              <next>
                                                                <block type="control" id="Xj?P}6q?rLh|@~U_M7nP">
                                                                  <mutation delay_input="false"></mutation>
                                                                  <field name="OID">sonos.0.root.192_168_168_125.stop</field>
                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                  <value name="VALUE">
                                                                    <block type="logic_boolean" id="nH$L.VhS?|.jh$aL3F_#">
                                                                      <field name="BOOL">TRUE</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </statement>
                                                  <next>
                                                    <block type="timeouts_settimeout" id="7SOnzWgj4to;E{`mGM+_">
                                                      <field name="NAME">timeout3</field>
                                                      <field name="DELAY">26</field>
                                                      <field name="UNIT">min</field>
                                                      <statement name="STATEMENT">
                                                        <block type="comment" id="njZoiNzr71$8Bbnrf|w?">
                                                          <field name="COMMENT">Strom der Play One ausschalten</field>
                                                          <next>
                                                            <block type="control" id="DdS9,DFxM}r92DB,~{+]">
                                                              <mutation delay_input="false"></mutation>
                                                              <field name="OID">tuya.0.0120036768c63a8690e1.1</field>
                                                              <field name="WITH_DELAY">FALSE</field>
                                                              <value name="VALUE">
                                                                <block type="logic_boolean" id="z(Q-|1XuV*G:y4l)p*NA">
                                                                  <field name="BOOL">FALSE</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </statement>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </statement>
                          <statement name="ELSE">
                            <block type="debug" id="{9O.pL-u+9SQQS9jPVKa">
                              <field name="Severity">log</field>
                              <value name="TEXT">
                                <shadow type="text" id="!hH#.aoebG)35y0~vMCR">
                                  <field name="TEXT">test</field>
                                </shadow>
                                <block type="text" id="s:i]N[!E_Q(dr})-b:MH">
                                  <field name="TEXT">Bedezimmer Sonos Script wurde richtig beendet</field>
                                </block>
                              </value>
                            </block>
                          </statement>
                        </block>
                      </next>
                    </block>
                  </statement>
                </block>
              </next>
            </block>
          </xml>
          

          2019-11-14 19_49_16-Window.jpg

          paul53P Offline
          paul53P Offline
          paul53
          schrieb am zuletzt editiert von
          #4

          @Spitfire4all sagte:

          in der Woche von 17:00 Uhr bis 20:00 Uhr und am Wochenende von 10:00 Uhr bis 22:00 Uhr.

          Blockly_temp.JPG

          Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
          Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

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


          Support us

          ioBroker
          Community Adapters
          Donate

          987

          Online

          32.6k

          Benutzer

          82.0k

          Themen

          1.3m

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

          • Du hast noch kein Konto? Registrieren

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