Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. [Gelöst] Brauche Hilfe bei Script zwecks Abbruch

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    [Gelöst] Brauche Hilfe bei Script zwecks Abbruch

    This topic has been deleted. Only users with topic management privileges can see it.
    • Codierknecht
      Codierknecht Developer Most Active @Superdad last edited by Codierknecht

      @superdad sagte in Brauche Hilfe bei Script zwecks Abbruch:

      wenn ich das Script abbreche, warum auch immer

      1. Es gibt kaum sinnvolle Anlässe, ein Script abzubrechen. Ein Script läuft in der Regel dauerhaft und wird durch externe Anlässe (Trigger, Zeitplan) dazu veranlasst, bestimmte Dinge zu tun oder zu lassen.
        Das aber nur als Randbemerkung.

      2. Pause ist eher suboptimal. Ich würde das lieber mit Timeouts lösen.
        Wie das geht, ist hier grundsätzlich beschrieben:
        https://forum.iobroker.net/topic/70481/blockly-for-dummies-starthilfe-und-tipps/9

      0f1d0efe-c24f-4240-b4ed-f8e99e5dfe7b-grafik.png

      1. Ist "Zaehler" ein eigener DP oder gehört der einem Adapter? Eigene DP werden mit "Aktualisiere" beschrieben. Die von Adaptern mit "Steuere".

      2. Das "Falls Zaehler = 3" ist irgendwie sinnfrei. Der wird ja kurz davor explizit mit "3" beschrieben. Er ist dann also immer "= 3".

      S 1 Reply Last reply Reply Quote 0
      • S
        Superdad @Codierknecht last edited by

        @codierknecht
        Vielen Dank für deine Antwort.
        Ab und zu spinnt meine Pumpe.
        Die zieht dann kein Wasser mehr.
        Da muss ich auch mal abbrechen. Deswegen.
        Zaehler ist ein eigens erstellter Datenpunkt. Habe ich auf aktualisiere geändert.
        Das mit "Falls Zaehler = 3" habe ich gemacht um am Ende das Script zu beenden.
        Ich starte das ja nur, wenn ich es brauche.

        Einen Trigger hatte ich auch schon drin.
        Hatte mir nur überlegt, dass das Script ja nicht dauerhaft laufen muss, um dann über einen Trigger zum laufen gebracht zu werden.
        Da kann ich doch gleich das Script starten wenn ich es brauche, oder?

        Mit den Timeouts probiere ich mal.

        S 1 Reply Last reply Reply Quote 0
        • S
          Superdad @Superdad last edited by Superdad

          Ich habe jetzt Timeouts eingebaut.
          Schaust du mal bitte, ob es so richtig ist?

          da9942c2-8581-4393-8053-60f0a34b6ca6-image.png
          67966353-f321-423b-905a-6f4eb470f339-image.png

          <xml xmlns="https://developers.google.com/blockly/xml">
            <variables>
              <variable type="timeout" id="timeout">timeout</variable>
              <variable type="timeout" id="timeout2">timeout2</variable>
              <variable type="timeout" id="timeout3">timeout3</variable>
              <variable type="timeout" id="timeout4">timeout4</variable>
            </variables>
            <block type="on_ext" id=";4_.oFchn$Px050OD.}E" x="-913" y="-287">
              <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
              <field name="CONDITION">true</field>
              <field name="ACK_CONDITION"></field>
              <value name="OID0">
                <shadow type="field_oid" id="MNSqYh-kbU~Y,NO`)WFS">
                  <field name="oid">javascript.0.Beregnung_Automatik.0.Trigger</field>
                </shadow>
              </value>
              <statement name="STATEMENT">
                <block type="controls_if" id="}dhWT.c/D/t^uoc*aw$t">
                  <mutation else="1"></mutation>
                  <value name="IF0">
                    <block type="logic_compare" id="#gc2@+D:qN41XRF$1*8~">
                      <field name="OP">EQ</field>
                      <value name="A">
                        <block type="on_source" id="?F+07t1EKzy4=qV%m]O+">
                          <field name="ATTR">state.val</field>
                        </block>
                      </value>
                      <value name="B">
                        <block type="logic_boolean" id="yv6hrqU|.?.BebAEtK8Z">
                          <field name="BOOL">TRUE</field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <statement name="DO0">
                    <block type="timeouts_settimeout" id="5UP{j!R=~3HOw5akj3M#">
                      <field name="NAME">timeout</field>
                      <field name="DELAY">1000</field>
                      <field name="UNIT">ms</field>
                      <statement name="STATEMENT">
                        <block type="debug" id="CN!p{^szF$%{rbU)!DKg">
                          <field name="Severity">info</field>
                          <value name="TEXT">
                            <shadow type="text" id="p(1lre9|OX/U_HACly5`">
                              <field name="TEXT">test</field>
                            </shadow>
                            <block type="get_value" id="w!O%Q@OWN8FcCT`=Ixr5">
                              <field name="ATTR">val</field>
                              <field name="OID">javascript.0.scriptEnabled.Garten.Beregnung_Automatik_3Kreise</field>
                            </block>
                          </value>
                          <next>
                            <block type="update" id="SfX7t}H0!){W0{ATLVZ)">
                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                              <field name="OID">javascript.0.Countdown.Zeitvorgabe</field>
                              <field name="WITH_DELAY">FALSE</field>
                              <value name="VALUE">
                                <block type="math_number" id="-Uvv]RXf4GY%7N}!#*Ls">
                                  <field name="NUM">25</field>
                                </block>
                              </value>
                              <next>
                                <block type="control" id=".Y7fE}dxm}+cO,Efq*IP">
                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                  <field name="OID">javascript.0.AnAus3</field>
                                  <field name="WITH_DELAY">FALSE</field>
                                  <value name="VALUE">
                                    <block type="math_number" id="|O^rsQ0re$`#frW!v?4z">
                                      <field name="NUM">1</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="update" id="74@p8gO}L6_-h/7jA1Q:">
                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                      <field name="OID">javascript.0.Countdown2.Zeitvorgabe2</field>
                                      <field name="WITH_DELAY">FALSE</field>
                                      <value name="VALUE">
                                        <block type="math_number" id="i*@nM-KpqmuI9K[ikJOy">
                                          <field name="NUM">25</field>
                                        </block>
                                      </value>
                                      <next>
                                        <block type="control" id="5Z-W78Mq,TM1()%C_MJP">
                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                          <field name="OID">javascript.0.AnAus4</field>
                                          <field name="WITH_DELAY">FALSE</field>
                                          <value name="VALUE">
                                            <block type="math_number" id="~q[+T`DxFa+j?L#IIJ$c">
                                              <field name="NUM">1</field>
                                            </block>
                                          </value>
                                          <next>
                                            <block type="sendto_custom" id="^}AiP;%)4lQR^/K3sm=L">
                                              <mutation xmlns="http://www.w3.org/1999/xhtml" items="send,text" with_statement="false"></mutation>
                                              <field name="INSTANCE">sayit.0</field>
                                              <field name="COMMAND">send</field>
                                              <field name="LOG"></field>
                                              <field name="WITH_STATEMENT">FALSE</field>
                                              <value name="ARG0">
                                                <shadow type="text" id="?DEAa_WN.%7^R_Y$n+^E">
                                                  <field name="TEXT">say</field>
                                                </shadow>
                                              </value>
                                              <value name="ARG1">
                                                <shadow type="text" id="FQx^PiJ5pI]$ON-/k^e.">
                                                  <field name="TEXT">Kreis 3, Hortensien, Hochbeete und Gewächshaus wird jetzt gestartet</field>
                                                </shadow>
                                              </value>
                                              <next>
                                                <block type="update" id="jUbuT5{X6nawBZPBjZNV">
                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                  <field name="OID">javascript.0.Beregnung_Automatik.0.Zaehler</field>
                                                  <field name="WITH_DELAY">FALSE</field>
                                                  <value name="VALUE">
                                                    <block type="math_number" id="(0J?mcLoY(or,xhp8NL/">
                                                      <field name="NUM">1</field>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="debug" id="Lr=o|4{^*0;~QboB$sD7">
                                                      <field name="Severity">info</field>
                                                      <value name="TEXT">
                                                        <shadow type="text" id="yAQn`M,~p0*5WqaZTPHb">
                                                          <field name="TEXT">test</field>
                                                        </shadow>
                                                        <block type="get_value" id=")x`UI1fnECUu^bOF(F[[">
                                                          <field name="ATTR">val</field>
                                                          <field name="OID">javascript.0.Beregnung_Automatik.0.Zaehler</field>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="controls_if" id="y$=*^@]ea@8KT~pWk*|,">
                                                          <mutation else="1"></mutation>
                                                          <value name="IF0">
                                                            <block type="logic_operation" id="DCz0mi?]7+O3`4T(%=ZF" inline="false">
                                                              <field name="OP">AND</field>
                                                              <value name="A">
                                                                <block type="logic_compare" id="gJsypX:,ioSL#XK(g_Wg">
                                                                  <field name="OP">EQ</field>
                                                                  <value name="A">
                                                                    <block type="get_value" id="BS;k|Ng/*:EQ]:tWVU)i">
                                                                      <field name="ATTR">val</field>
                                                                      <field name="OID">javascript.0.Beregnung_Automatik.0.Zaehler</field>
                                                                    </block>
                                                                  </value>
                                                                  <value name="B">
                                                                    <block type="math_number" id="f7)sJ$s@};d~4ANT~,tM">
                                                                      <field name="NUM">1</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                              <value name="B">
                                                                <block type="logic_compare" id="F7?|]37bu8,u5SL[bU4h">
                                                                  <field name="OP">EQ</field>
                                                                  <value name="A">
                                                                    <block type="on_source" id="Rb6![b8OLlCeY`p}h4];">
                                                                      <field name="ATTR">state.val</field>
                                                                    </block>
                                                                  </value>
                                                                  <value name="B">
                                                                    <block type="logic_boolean" id="o?X0IR/gn0TUjIe:[=W7">
                                                                      <field name="BOOL">TRUE</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                          <statement name="DO0">
                                                            <block type="timeouts_settimeout" id="%Z$9Qh:OqJl0aRaQV8Sz">
                                                              <field name="NAME">timeout2</field>
                                                              <field name="DELAY">25</field>
                                                              <field name="UNIT">min</field>
                                                              <statement name="STATEMENT">
                                                                <block type="update" id="7[RwncT/qBK|Z~?z7-qn">
                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                  <field name="OID">javascript.0.Countdown.Zeitvorgabe</field>
                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                  <value name="VALUE">
                                                                    <block type="math_number" id="mXjjKY;AuwGR[CC%^zB{">
                                                                      <field name="NUM">30</field>
                                                                    </block>
                                                                  </value>
                                                                  <next>
                                                                    <block type="control" id="9j!2UnM^H{Z9|_tX(6,T">
                                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                      <field name="OID">javascript.0.AnAus</field>
                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                      <value name="VALUE">
                                                                        <block type="math_number" id=";J1H*~+wLUKvS.}L/d|}">
                                                                          <field name="NUM">1</field>
                                                                        </block>
                                                                      </value>
                                                                      <next>
                                                                        <block type="update" id="s[-5*|aUAJvcbO+N15Aq">
                                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                          <field name="OID">javascript.0.Countdown2.Zeitvorgabe2</field>
                                                                          <field name="WITH_DELAY">FALSE</field>
                                                                          <value name="VALUE">
                                                                            <block type="math_number" id="QXm8KkPtxJ57eec1(Z-C">
                                                                              <field name="NUM">25</field>
                                                                            </block>
                                                                          </value>
                                                                          <next>
                                                                            <block type="control" id="e|3GbIG-?0WR3wBL;^Qo">
                                                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                              <field name="OID">javascript.0.AnAus5</field>
                                                                              <field name="WITH_DELAY">FALSE</field>
                                                                              <value name="VALUE">
                                                                                <block type="math_number" id="Si@ZE`3AR]tlAIr^IpMW">
                                                                                  <field name="NUM">1</field>
                                                                                </block>
                                                                              </value>
                                                                              <next>
                                                                                <block type="sendto_custom" id="b??aY:-b4x$dDJ?wI,=a">
                                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" items="send,text" with_statement="false"></mutation>
                                                                                  <field name="INSTANCE">sayit.0</field>
                                                                                  <field name="COMMAND">send</field>
                                                                                  <field name="LOG"></field>
                                                                                  <field name="WITH_STATEMENT">FALSE</field>
                                                                                  <value name="ARG0">
                                                                                    <shadow type="text" id="NjnMsf3*U}N}pv3^^3HV">
                                                                                      <field name="TEXT">say</field>
                                                                                    </shadow>
                                                                                  </value>
                                                                                  <value name="ARG1">
                                                                                    <shadow type="text" id="btOCXnPQlO;|rH(Go)Sk">
                                                                                      <field name="TEXT">Kreis 1 und Hochbeete vorn wird jetzt gestartet</field>
                                                                                    </shadow>
                                                                                  </value>
                                                                                  <next>
                                                                                    <block type="timeouts_wait" id="b?I9O!Y[A+tY2w0@_fS[">
                                                                                      <field name="DELAY">31</field>
                                                                                      <field name="UNIT">min</field>
                                                                                      <next>
                                                                                        <block type="update" id="r~L$B[3=7K;]ke9YERJT">
                                                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                          <field name="OID">javascript.0.Beregnung_Automatik.0.Zaehler</field>
                                                                                          <field name="WITH_DELAY">FALSE</field>
                                                                                          <value name="VALUE">
                                                                                            <block type="math_number" id="!N!,m72hbnF5~q`mC^x~">
                                                                                              <field name="NUM">2</field>
                                                                                            </block>
                                                                                          </value>
                                                                                          <next>
                                                                                            <block type="debug" id="Mr?3gi7ge~nCN[3smLvD">
                                                                                              <field name="Severity">info</field>
                                                                                              <value name="TEXT">
                                                                                                <shadow type="text" id="V8*=KJ+a@Y9;loXCC@D}">
                                                                                                  <field name="TEXT">test</field>
                                                                                                </shadow>
                                                                                                <block type="get_value" id="([WLF)mc#}rcQ0w[=Z`/">
                                                                                                  <field name="ATTR">val</field>
                                                                                                  <field name="OID">javascript.0.Beregnung_Automatik.0.Zaehler</field>
                                                                                                </block>
                                                                                              </value>
                                                                                              <next>
                                                                                                <block type="controls_if" id="lwj)v{^4fcX{v9;ENwD-">
                                                                                                  <mutation else="1"></mutation>
                                                                                                  <value name="IF0">
                                                                                                    <block type="logic_operation" id="_yjZ]FuCU}Tqee)#}d;!" inline="false">
                                                                                                      <field name="OP">AND</field>
                                                                                                      <value name="A">
                                                                                                        <block type="logic_compare" id="M+oY6.m+=TKf2(w4N@NV">
                                                                                                          <field name="OP">EQ</field>
                                                                                                          <value name="A">
                                                                                                            <block type="get_value" id="oj]d0vz~vf@F5)KCr8e1">
                                                                                                              <field name="ATTR">val</field>
                                                                                                              <field name="OID">javascript.0.Beregnung_Automatik.0.Zaehler</field>
                                                                                                            </block>
                                                                                                          </value>
                                                                                                          <value name="B">
                                                                                                            <block type="math_number" id="^Jaf$^D,GEf,J,f$@kw~">
                                                                                                              <field name="NUM">2</field>
                                                                                                            </block>
                                                                                                          </value>
                                                                                                        </block>
                                                                                                      </value>
                                                                                                      <value name="B">
                                                                                                        <block type="logic_compare" id="k!erv~L.!Aa=3J[b(CUz">
                                                                                                          <field name="OP">EQ</field>
                                                                                                          <value name="A">
                                                                                                            <block type="on_source" id="Y7h[5FyoAk;73TS9Fx)]">
                                                                                                              <field name="ATTR">state.val</field>
                                                                                                            </block>
                                                                                                          </value>
                                                                                                          <value name="B">
                                                                                                            <block type="logic_boolean" id="#CRls5_fe|}/42.i*2nR">
                                                                                                              <field name="BOOL">TRUE</field>
                                                                                                            </block>
                                                                                                          </value>
                                                                                                        </block>
                                                                                                      </value>
                                                                                                    </block>
                                                                                                  </value>
                                                                                                  <statement name="DO0">
                                                                                                    <block type="timeouts_settimeout" id="aXYEmve,nMEbU?tNZUIZ">
                                                                                                      <field name="NAME">timeout3</field>
                                                                                                      <field name="DELAY">30</field>
                                                                                                      <field name="UNIT">min</field>
                                                                                                      <statement name="STATEMENT">
                                                                                                        <block type="update" id="EnM!6U^=Ae^=oeyRQa9?">
                                                                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                          <field name="OID">javascript.0.Countdown.Zeitvorgabe</field>
                                                                                                          <field name="WITH_DELAY">FALSE</field>
                                                                                                          <value name="VALUE">
                                                                                                            <block type="math_number" id="}1x4}O*;g06!]T;kW{(y">
                                                                                                              <field name="NUM">15</field>
                                                                                                            </block>
                                                                                                          </value>
                                                                                                          <next>
                                                                                                            <block type="control" id="!;!.Yj[#`Y[IV!wMDIne">
                                                                                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                              <field name="OID">javascript.0.AnAus2</field>
                                                                                                              <field name="WITH_DELAY">FALSE</field>
                                                                                                              <value name="VALUE">
                                                                                                                <block type="math_number" id=",[D`evpw}p*B|qoeXS,0">
                                                                                                                  <field name="NUM">1</field>
                                                                                                                </block>
                                                                                                              </value>
                                                                                                              <next>
                                                                                                                <block type="update" id="c{n%H~On^;YuZYuJ}Ekl">
                                                                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                  <field name="OID">javascript.0.Countdown2.Zeitvorgabe2</field>
                                                                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                                                                  <value name="VALUE">
                                                                                                                    <block type="math_number" id="LD@40o;p@YzGK4?}C|zb">
                                                                                                                      <field name="NUM">15</field>
                                                                                                                    </block>
                                                                                                                  </value>
                                                                                                                  <next>
                                                                                                                    <block type="control" id="/2ifbB2H58/1Z1VYu[6E">
                                                                                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                      <field name="OID">javascript.0.AnAus6</field>
                                                                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                                                                      <value name="VALUE">
                                                                                                                        <block type="math_number" id="ur+!$cBET?|ABLM=T}Ra">
                                                                                                                          <field name="NUM">1</field>
                                                                                                                        </block>
                                                                                                                      </value>
                                                                                                                      <next>
                                                                                                                        <block type="sendto_custom" id="D){;hLmj0]:r2;m3dWZz">
                                                                                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" items="send,text" with_statement="false"></mutation>
                                                                                                                          <field name="INSTANCE">sayit.0</field>
                                                                                                                          <field name="COMMAND">send</field>
                                                                                                                          <field name="LOG"></field>
                                                                                                                          <field name="WITH_STATEMENT">FALSE</field>
                                                                                                                          <value name="ARG0">
                                                                                                                            <shadow type="text" id="perN{GE/tQI+E,70#!nK">
                                                                                                                              <field name="TEXT">say</field>
                                                                                                                            </shadow>
                                                                                                                          </value>
                                                                                                                          <value name="ARG1">
                                                                                                                            <shadow type="text" id="N%]b6[#;J_s:V`tXa+:T">
                                                                                                                              <field name="TEXT">Kreis 2 und Zaun wird gestartet</field>
                                                                                                                            </shadow>
                                                                                                                          </value>
                                                                                                                          <next>
                                                                                                                            <block type="update" id="BZH`Y5UPQqu~Wtl!giXv">
                                                                                                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                              <field name="OID">javascript.0.Countdown3.countdown3</field>
                                                                                                                              <field name="WITH_DELAY">FALSE</field>
                                                                                                                              <value name="VALUE">
                                                                                                                                <block type="math_number" id="TrbYQ=zQ.K]remW9K:~O">
                                                                                                                                  <field name="NUM">0</field>
                                                                                                                                </block>
                                                                                                                              </value>
                                                                                                                              <next>
                                                                                                                                <block type="update" id="6fStRl{)vfxJKZlB6vxq">
                                                                                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                  <field name="OID">javascript.0.Beregnung_Automatik.0.Zaehler</field>
                                                                                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                                                                                  <value name="VALUE">
                                                                                                                                    <block type="math_number" id="GZnMx]):8d#*DFLFWhmo">
                                                                                                                                      <field name="NUM">2</field>
                                                                                                                                    </block>
                                                                                                                                  </value>
                                                                                                                                  <next>
                                                                                                                                    <block type="debug" id="LgSFrO3x`vje/*_0c^}$">
                                                                                                                                      <field name="Severity">info</field>
                                                                                                                                      <value name="TEXT">
                                                                                                                                        <shadow type="text" id="969?RPm~!FZo-(Z^89X)">
                                                                                                                                          <field name="TEXT">test</field>
                                                                                                                                        </shadow>
                                                                                                                                        <block type="get_value" id="Pt#ks}$G(mgLKWSH|Dc/">
                                                                                                                                          <field name="ATTR">val</field>
                                                                                                                                          <field name="OID">javascript.0.Beregnung_Automatik.0.Zaehler</field>
                                                                                                                                        </block>
                                                                                                                                      </value>
                                                                                                                                      <next>
                                                                                                                                        <block type="controls_if" id="-+e([V~FLSyE^mpV]!{i">
                                                                                                                                          <mutation else="1"></mutation>
                                                                                                                                          <value name="IF0">
                                                                                                                                            <block type="logic_compare" id="jIE.=eQ}b}([+1jES%X+">
                                                                                                                                              <field name="OP">EQ</field>
                                                                                                                                              <value name="A">
                                                                                                                                                <block type="get_value" id="FN#,(Qeerc04:o8,)kHU">
                                                                                                                                                  <field name="ATTR">val</field>
                                                                                                                                                  <field name="OID">javascript.0.Beregnung_Automatik.0.Zaehler</field>
                                                                                                                                                </block>
                                                                                                                                              </value>
                                                                                                                                              <value name="B">
                                                                                                                                                <block type="math_number" id="og/hGemtXANf3|*WU!Mn">
                                                                                                                                                  <field name="NUM">3</field>
                                                                                                                                                </block>
                                                                                                                                              </value>
                                                                                                                                            </block>
                                                                                                                                          </value>
                                                                                                                                          <statement name="DO0">
                                                                                                                                            <block type="timeouts_settimeout" id="G6XP6ei]TtB`+yFsIHc#">
                                                                                                                                              <field name="NAME">timeout4</field>
                                                                                                                                              <field name="DELAY">15</field>
                                                                                                                                              <field name="UNIT">min</field>
                                                                                                                                              <statement name="STATEMENT">
                                                                                                                                                <block type="control" id="3(:Q;:z9.s`4d%jnl,7e">
                                                                                                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                                  <field name="OID">javascript.0.scriptEnabled.Garten.Beregnung_Automatik_3Kreise</field>
                                                                                                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                                                                                                  <value name="VALUE">
                                                                                                                                                    <block type="logic_boolean" id="@mctqbtV)F!reVKU:53;">
                                                                                                                                                      <field name="BOOL">FALSE</field>
                                                                                                                                                    </block>
                                                                                                                                                  </value>
                                                                                                                                                  <next>
                                                                                                                                                    <block type="update" id="gbJDDM2bi.*d_3iOrP`;">
                                                                                                                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                                      <field name="OID">javascript.0.Beregnung_Automatik.0.Zaehler</field>
                                                                                                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                                                                                                      <value name="VALUE">
                                                                                                                                                        <block type="math_number" id="3@`n0RtonUK~4}Fkhc1P">
                                                                                                                                                          <field name="NUM">0</field>
                                                                                                                                                        </block>
                                                                                                                                                      </value>
                                                                                                                                                      <next>
                                                                                                                                                        <block type="sendto_custom" id="k}W]S]6W,O*~)E5k+_lj">
                                                                                                                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" items="send,text" with_statement="false"></mutation>
                                                                                                                                                          <field name="INSTANCE">sayit.0</field>
                                                                                                                                                          <field name="COMMAND">send</field>
                                                                                                                                                          <field name="LOG"></field>
                                                                                                                                                          <field name="WITH_STATEMENT">FALSE</field>
                                                                                                                                                          <value name="ARG0">
                                                                                                                                                            <shadow type="text" id="=fP7*i#m3_J?+-q4nROa">
                                                                                                                                                              <field name="TEXT">say</field>
                                                                                                                                                            </shadow>
                                                                                                                                                          </value>
                                                                                                                                                          <value name="ARG1">
                                                                                                                                                            <shadow type="text" id="A-D=OCnP,%[HYFK.pYJ}">
                                                                                                                                                              <field name="TEXT">Beregnung ist jetzt beendet</field>
                                                                                                                                                            </shadow>
                                                                                                                                                          </value>
                                                                                                                                                        </block>
                                                                                                                                                      </next>
                                                                                                                                                    </block>
                                                                                                                                                  </next>
                                                                                                                                                </block>
                                                                                                                                              </statement>
                                                                                                                                            </block>
                                                                                                                                          </statement>
                                                                                                                                          <statement name="ELSE">
                                                                                                                                            <block type="timeouts_cleartimeout" id="Ak{y00Wsa5FS~{1KYZXj">
                                                                                                                                              <field name="NAME">timeout4</field>
                                                                                                                                            </block>
                                                                                                                                          </statement>
                                                                                                                                        </block>
                                                                                                                                      </next>
                                                                                                                                    </block>
                                                                                                                                  </next>
                                                                                                                                </block>
                                                                                                                              </next>
                                                                                                                            </block>
                                                                                                                          </next>
                                                                                                                        </block>
                                                                                                                      </next>
                                                                                                                    </block>
                                                                                                                  </next>
                                                                                                                </block>
                                                                                                              </next>
                                                                                                            </block>
                                                                                                          </next>
                                                                                                        </block>
                                                                                                      </statement>
                                                                                                    </block>
                                                                                                  </statement>
                                                                                                  <statement name="ELSE">
                                                                                                    <block type="timeouts_cleartimeout" id="{fl%VW*O=Q.j.,=WBb:X">
                                                                                                      <field name="NAME">timeout3</field>
                                                                                                    </block>
                                                                                                  </statement>
                                                                                                </block>
                                                                                              </next>
                                                                                            </block>
                                                                                          </next>
                                                                                        </block>
                                                                                      </next>
                                                                                    </block>
                                                                                  </next>
                                                                                </block>
                                                                              </next>
                                                                            </block>
                                                                          </next>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </statement>
                                                            </block>
                                                          </statement>
                                                          <statement name="ELSE">
                                                            <block type="timeouts_cleartimeout" id="v1?EQx5hOC}~.qjEp#!e">
                                                              <field name="NAME">timeout2</field>
                                                            </block>
                                                          </statement>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </statement>
                    </block>
                  </statement>
                  <statement name="ELSE">
                    <block type="timeouts_cleartimeout" id=")p#owlJ.AaO{0{/~?jiX">
                      <field name="NAME">timeout</field>
                    </block>
                  </statement>
                </block>
              </statement>
            </block>
          </xml>
          

          Danke!

          Codierknecht 1 Reply Last reply Reply Quote 0
          • Codierknecht
            Codierknecht Developer Most Active @Superdad last edited by

            @superdad

            1. Ich muss gestehen, dass ich die Logik hinter dem Script noch nicht so ganz verstanden habe.
              f798cf71-a8d7-458b-a734-c91555a92a9c-image.png
              Das ist doppelt gemoppelt. Den Trigger würde ich auf "wurde geändert" ändern.
              Dann kann man im Falle von "wahr" die Beregnung starten und anderenfalls eine Pumpe abstellen und alle timeouts löschen.

            2. Apropos timeouts: Ich sehe da immer noch "pause".

            3. Das ist wieder sinnfrei
              8ad20cbb-fe4e-4014-afa9-07a3d8fb6e71-image.png
              Der "Zaehler" ist immer "1", wenn er vorher explizt auf diesen Wert gesetzt wurde.
              Wozu soll der überhaupt dienen?
              Willst Du nacheinander 3 Kreise beregnen? Dann hat der Zähler doch eigentlich nur kosmetischen Charakter, z.B. für's Log.

            Ich rate mal: Du willst 3 Kreise nacheinander zeitgesteuert beregnen?
            Prinzipvorschlag:
            9afb1537-35c7-444a-bcae-1678c459b1cd-image.png

            S 1 Reply Last reply Reply Quote 0
            • S
              Superdad @Codierknecht last edited by Superdad

              @codierknecht
              OK!?
              Dein Script ist natürlich besser und einfacher aufgebaut.
              So ist das ebend, wenn man keine große Ahnung hat, so wie ich.

              Den "Zaehler" hatte ich mir angelegt um einen DP zu haben um in das nächste falls rein zu kommen.
              Ist natürlich zu kompliziert gedacht.

              Die Pause hatte ich schon entfernt. Habe ich selber mitbekommen.
              Du startest also die Pumpe und nacheinander die Kreise. Verstehe!

              Statt der 1,2,3 bei Id auswählen, müsste ich aber dann überall eine 1 rein schreiben, oder?
              Wird das dann nach Beendigung des Timeouts automatisch auf 0 gesetzt?

              Vielen Dank für deine Hilfe!

              P.S. Und was ist, wenn der letzte Timeout abgelaufen ist?
              Ist dann die Pumpe auch aus?
              Oder setze ich mir dann noch einen Timeout (Timeout4) nach vielleicht 2 sek.?

              Codierknecht 1 Reply Last reply Reply Quote 0
              • Codierknecht
                Codierknecht Developer Most Active @Superdad last edited by

                @superdad sagte in Brauche Hilfe bei Script zwecks Abbruch:

                Statt der 1,2,3 bei Id auswählen, müsste ich aber dann überall eine 1 rein schreiben, oder?

                Das soll die Kreise 1-3 symbolisieren. Ich habe keine Ahnung, wie das technisch bei Dir umgesetzt ist.
                Schaltest Du für die Kreise 1-3 ein Ventil? Schaltest Du unterschiedliche Pumpen?
                Was da zum ein- oder ausschalten einzelner Kreise nötig ist, weißt Du sicher besser als ich.

                Ich hoffe zumindest, dass das Prinzip klar geworden ist.
                Man definiert einen timeout mit einer bestimmten Ablaufzeit. Quasi einen Countdown.
                Ist der abgelaufen, werden die innerhalb des timeout definierten Anweisungen ausgeführt.
                Das kann dann am Ende natürlich auch ein weiterer timeout sein, der nach einer Zeit X wieder neue Anweisungen ausführt. Und so weiter, und so fort.

                S 1 Reply Last reply Reply Quote 0
                • S
                  Superdad @Codierknecht last edited by

                  @codierknecht
                  Ich habe es jetzt so gelöst:

                  <xml xmlns="https://developers.google.com/blockly/xml">
                    <variables>
                      <variable type="timeout" id="timeout">timeout</variable>
                      <variable type="timeout" id="timeout2">timeout2</variable>
                      <variable type="timeout" id="timeout3">timeout3</variable>
                    </variables>
                    <block type="on" id="WZ_(od6E#y-!g+dGW^q-" x="-763" y="-763">
                      <field name="OID">javascript.0.Beregnung_Automatik.0.Trigger</field>
                      <field name="CONDITION">ne</field>
                      <field name="ACK_CONDITION"></field>
                      <comment pinned="false" h="80" w="160">https://forum.iobroker.net/topic/75874/brauche-hilfe-bei-script-zwecks-abbruch</comment>
                      <statement name="STATEMENT">
                        <block type="controls_if" id="/+`C^0DH-iCEFhzp7zpU">
                          <mutation else="1"></mutation>
                          <value name="IF0">
                            <block type="on_source" id="{hXB(@7R8SELbA:,}j:y">
                              <field name="ATTR">state.val</field>
                            </block>
                          </value>
                          <statement name="DO0">
                            <block type="comment" id="s6Tjlk2XfA~;oyi6Ho#K">
                              <field name="COMMENT">Kreis 1 beregnen</field>
                              <next>
                                <block type="comment" id="**ZOkO|t(nloQjPh5^4a">
                                  <field name="COMMENT">Ventil Kreis3 einschalten</field>
                                  <next>
                                    <block type="control" id="u[dc7@uy6UG}!{8y.;f5">
                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                      <field name="OID">hm-rpc.0.NEQ1316670.3.STATE</field>
                                      <field name="WITH_DELAY">FALSE</field>
                                      <value name="VALUE">
                                        <block type="logic_boolean" id="uLG)sOBZQ*]rd8-GG,iN">
                                          <field name="BOOL">TRUE</field>
                                        </block>
                                      </value>
                                      <next>
                                        <block type="comment" id="(:.ur#%1w-GyiTwyo*N6">
                                          <field name="COMMENT">Pumpe einschalten</field>
                                          <next>
                                            <block type="control" id="KTX}qiXddSGRk$N_AgKN">
                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                              <field name="OID">sonoff.0.Sonoff_Pumpe_Sprenger.POWER</field>
                                              <field name="WITH_DELAY">FALSE</field>
                                              <value name="VALUE">
                                                <block type="logic_boolean" id="O;:?;ndY1bwZ+ZwSdzN,">
                                                  <field name="BOOL">TRUE</field>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="comment" id="2lZbt0zwk!V3%dMZ~5iA">
                                                  <field name="COMMENT">Zigbee Ventil Gewächshaus einschalten</field>
                                                  <next>
                                                    <block type="control" id="-_0k`$U5c2$8Vs8QED5c">
                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                      <field name="OID">zigbee.0.9035eafffef8fd3e.state</field>
                                                      <field name="WITH_DELAY">FALSE</field>
                                                      <value name="VALUE">
                                                        <block type="logic_boolean" id="?.kba4^[.frs%pzhEHd=">
                                                          <field name="BOOL">TRUE</field>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="timeouts_settimeout" id="m|R)[SpmaQKub1yu:7D?">
                                                          <field name="NAME">timeout</field>
                                                          <field name="DELAY">20</field>
                                                          <field name="UNIT">min</field>
                                                          <statement name="STATEMENT">
                                                            <block type="comment" id="U{cOMC]#Zea}u[hyayFY">
                                                              <field name="COMMENT">Umschalten auf Kreis1</field>
                                                              <next>
                                                                <block type="comment" id="S*=r-gwj+r7.%5d#kGyT">
                                                                  <field name="COMMENT">Ventil Kreis3 und Zigbee Ventil Gewächshaus schließen</field>
                                                                  <next>
                                                                    <block type="control" id="BWQ79/.X)U17qH`W@ncD">
                                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                      <field name="OID">hm-rpc.0.NEQ1316670.3.STATE</field>
                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                      <value name="VALUE">
                                                                        <block type="logic_boolean" id="W_D,,p@u8GbT4W]^=s-|">
                                                                          <field name="BOOL">FALSE</field>
                                                                        </block>
                                                                      </value>
                                                                      <next>
                                                                        <block type="control" id="}Y{XoE)*kMlnWuKtc72G">
                                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                          <field name="OID">zigbee.0.9035eafffef8fd3e.state</field>
                                                                          <field name="WITH_DELAY">FALSE</field>
                                                                          <value name="VALUE">
                                                                            <block type="logic_boolean" id="6K(_u*v),8b+pK{qn:p=">
                                                                              <field name="BOOL">FALSE</field>
                                                                            </block>
                                                                          </value>
                                                                          <next>
                                                                            <block type="comment" id="33w54dn?Q/XX=yW00Yjc">
                                                                              <field name="COMMENT">Ventil Kreis1 Zigbee Ventil Hochbeete einschalten</field>
                                                                              <next>
                                                                                <block type="control" id="Z6-BzVop=S$7lr;78C6L">
                                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                  <field name="OID">hm-rpc.0.NEQ1316670.1.STATE</field>
                                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                                  <value name="VALUE">
                                                                                    <block type="logic_boolean" id="E4?J1t[JpJa0IRYpuUpU">
                                                                                      <field name="BOOL">TRUE</field>
                                                                                    </block>
                                                                                  </value>
                                                                                  <next>
                                                                                    <block type="control" id="xUmBG9q.A;fNSpj7a}RD">
                                                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                      <field name="OID">zigbee.0.9035eafffef8fae6.state</field>
                                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                                      <value name="VALUE">
                                                                                        <block type="logic_boolean" id="ylx{dRs0-1q{=-MyXBeB">
                                                                                          <field name="BOOL">TRUE</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <next>
                                                                                        <block type="timeouts_settimeout" id="[Ia2J?K:4=?`)z#G%z`l">
                                                                                          <field name="NAME">timeout2</field>
                                                                                          <field name="DELAY">30</field>
                                                                                          <field name="UNIT">min</field>
                                                                                          <statement name="STATEMENT">
                                                                                            <block type="comment" id="4:LQzzc9|QPNRmPB%z;o">
                                                                                              <field name="COMMENT">Umschalten auf Kreis 2</field>
                                                                                              <next>
                                                                                                <block type="comment" id=",FxE_3wpEJH0}xP+e/$c">
                                                                                                  <field name="COMMENT">Ventil Kreis1 + Zigbee Ventil Hochbeete ausschalten</field>
                                                                                                  <next>
                                                                                                    <block type="control" id="VOz{2*IyM=$Og/)wBU|}">
                                                                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                      <field name="OID">hm-rpc.0.NEQ1316670.1.STATE</field>
                                                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                                                      <value name="VALUE">
                                                                                                        <block type="logic_boolean" id="Iy(2b,F-;PjZJw@v`a.Z">
                                                                                                          <field name="BOOL">FALSE</field>
                                                                                                        </block>
                                                                                                      </value>
                                                                                                      <next>
                                                                                                        <block type="control" id="ly:?si!CmD*70a}+#V.+">
                                                                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                          <field name="OID">zigbee.0.9035eafffef8fae6.state</field>
                                                                                                          <field name="WITH_DELAY">FALSE</field>
                                                                                                          <value name="VALUE">
                                                                                                            <block type="logic_boolean" id="G75uRii.r+!0-YeY*}Tf">
                                                                                                              <field name="BOOL">FALSE</field>
                                                                                                            </block>
                                                                                                          </value>
                                                                                                          <next>
                                                                                                            <block type="comment" id="/$3v$0cIQLn-Z)Opq/HF">
                                                                                                              <field name="COMMENT">Ventil Kreis2 + Zigbee Ventil Zaun einschalten</field>
                                                                                                              <next>
                                                                                                                <block type="control" id="He`m|x%P^o+`Gc[,kvPB">
                                                                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                  <field name="OID">hm-rpc.0.NEQ1316670.2.STATE</field>
                                                                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                                                                  <value name="VALUE">
                                                                                                                    <block type="logic_boolean" id="M`9CndBG2zDiagMe2z8F">
                                                                                                                      <field name="BOOL">TRUE</field>
                                                                                                                    </block>
                                                                                                                  </value>
                                                                                                                  <next>
                                                                                                                    <block type="control" id=")Bp`F+{!my5o|Dm%#:sQ">
                                                                                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                      <field name="OID">zigbee.0.28dba7fffeaff176.state</field>
                                                                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                                                                      <value name="VALUE">
                                                                                                                        <block type="logic_boolean" id="mky_jGMsQyk)0g$YuzQC">
                                                                                                                          <field name="BOOL">TRUE</field>
                                                                                                                        </block>
                                                                                                                      </value>
                                                                                                                      <next>
                                                                                                                        <block type="timeouts_settimeout" id="+uzziVMW:A$D91q4MyJd">
                                                                                                                          <field name="NAME">timeout3</field>
                                                                                                                          <field name="DELAY">20</field>
                                                                                                                          <field name="UNIT">min</field>
                                                                                                                          <statement name="STATEMENT">
                                                                                                                            <block type="comment" id="^;eoCQ#OJV3i:y]I,@f}">
                                                                                                                              <field name="COMMENT">Pumpe ausschalten</field>
                                                                                                                              <next>
                                                                                                                                <block type="control" id=":U#BVl3rS7)7dod!,}^@">
                                                                                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                  <field name="OID">sonoff.0.Sonoff_Pumpe_Sprenger.POWER</field>
                                                                                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                                                                                  <value name="VALUE">
                                                                                                                                    <block type="logic_boolean" id="9)2SRQ;Y-jPB(]2R4=i8">
                                                                                                                                      <field name="BOOL">FALSE</field>
                                                                                                                                    </block>
                                                                                                                                  </value>
                                                                                                                                  <next>
                                                                                                                                    <block type="comment" id="41O0ArIxwKj#SC:p!9L?">
                                                                                                                                      <field name="COMMENT">Ventil Kreis2 + Zigbee Ventil Zaun ausschalten</field>
                                                                                                                                      <next>
                                                                                                                                        <block type="control" id="~^Ruxg,}VajPeICwL%}w">
                                                                                                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                          <field name="OID">hm-rpc.0.NEQ1316670.2.STATE</field>
                                                                                                                                          <field name="WITH_DELAY">FALSE</field>
                                                                                                                                          <value name="VALUE">
                                                                                                                                            <block type="logic_boolean" id="hm*2I43v7Vc5d/5-RJk.">
                                                                                                                                              <field name="BOOL">FALSE</field>
                                                                                                                                            </block>
                                                                                                                                          </value>
                                                                                                                                          <next>
                                                                                                                                            <block type="control" id="x)zuVwkpz{C*;FI30Z*p">
                                                                                                                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                              <field name="OID">zigbee.0.28dba7fffeaff176.state</field>
                                                                                                                                              <field name="WITH_DELAY">FALSE</field>
                                                                                                                                              <value name="VALUE">
                                                                                                                                                <block type="logic_boolean" id="Twg%LH@L~Ci*2YVFPewG">
                                                                                                                                                  <field name="BOOL">FALSE</field>
                                                                                                                                                </block>
                                                                                                                                              </value>
                                                                                                                                              <next>
                                                                                                                                                <block type="comment" id="=+[yk8P^UseTrzr7[jvp">
                                                                                                                                                  <field name="COMMENT">Trigger auf false</field>
                                                                                                                                                  <next>
                                                                                                                                                    <block type="control" id="%N-Lsb5UMymK//4.U!9C">
                                                                                                                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                                      <field name="OID">javascript.0.Beregnung_Automatik.0.Trigger</field>
                                                                                                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                                                                                                      <value name="VALUE">
                                                                                                                                                        <block type="logic_boolean" id="TI$?BnQ.XL/==)sZ*}mW">
                                                                                                                                                          <field name="BOOL">FALSE</field>
                                                                                                                                                        </block>
                                                                                                                                                      </value>
                                                                                                                                                    </block>
                                                                                                                                                  </next>
                                                                                                                                                </block>
                                                                                                                                              </next>
                                                                                                                                            </block>
                                                                                                                                          </next>
                                                                                                                                        </block>
                                                                                                                                      </next>
                                                                                                                                    </block>
                                                                                                                                  </next>
                                                                                                                                </block>
                                                                                                                              </next>
                                                                                                                            </block>
                                                                                                                          </statement>
                                                                                                                        </block>
                                                                                                                      </next>
                                                                                                                    </block>
                                                                                                                  </next>
                                                                                                                </block>
                                                                                                              </next>
                                                                                                            </block>
                                                                                                          </next>
                                                                                                        </block>
                                                                                                      </next>
                                                                                                    </block>
                                                                                                  </next>
                                                                                                </block>
                                                                                              </next>
                                                                                            </block>
                                                                                          </statement>
                                                                                        </block>
                                                                                      </next>
                                                                                    </block>
                                                                                  </next>
                                                                                </block>
                                                                              </next>
                                                                            </block>
                                                                          </next>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </statement>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </statement>
                          <statement name="ELSE">
                            <block type="comment" id="k|O#9^V@imu(ArsoCx9F">
                              <field name="COMMENT">Pumpe ausschalten</field>
                              <next>
                                <block type="control" id="$wCL%H?OD{u4?9I0W4,#">
                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                  <field name="OID">sonoff.0.Sonoff_Pumpe_Sprenger.POWER</field>
                                  <field name="WITH_DELAY">FALSE</field>
                                  <value name="VALUE">
                                    <block type="logic_boolean" id="_I)n?2nf:Zpx^,Eq,Vo/">
                                      <field name="BOOL">FALSE</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="comment" id="|wH9d($;iYEg%Awg^x1T">
                                      <field name="COMMENT">Ventile 1-3 schließen</field>
                                      <next>
                                        <block type="control" id="e,dRIdJ0pauN:ddef)Q{">
                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                          <field name="OID">hm-rpc.0.NEQ1316670.1.STATE</field>
                                          <field name="WITH_DELAY">FALSE</field>
                                          <value name="VALUE">
                                            <block type="logic_boolean" id="Bot5x4gf8:Im{+.b!B`|">
                                              <field name="BOOL">FALSE</field>
                                            </block>
                                          </value>
                                          <next>
                                            <block type="control" id="-IrY|-7~nUOy0?(fny%P">
                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                              <field name="OID">hm-rpc.0.NEQ1316670.2.STATE</field>
                                              <field name="WITH_DELAY">FALSE</field>
                                              <value name="VALUE">
                                                <block type="logic_boolean" id="__6WM(n}UQaV_x/QWMbB">
                                                  <field name="BOOL">FALSE</field>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="control" id="7L`Rq)$kfeeCbS?fEcX,">
                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                  <field name="OID">hm-rpc.0.NEQ1316670.3.STATE</field>
                                                  <field name="WITH_DELAY">FALSE</field>
                                                  <value name="VALUE">
                                                    <block type="logic_boolean" id="Dz(LW$Hf,9[u1vW:Fl%-">
                                                      <field name="BOOL">FALSE</field>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="comment" id="6Ww1LcrL(uR/S]%tlApW">
                                                      <field name="COMMENT">Zigbee Ventile 1-3 schließen</field>
                                                      <next>
                                                        <block type="control" id="3@w25G,t|!t}rndKuVm9">
                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                          <field name="OID">zigbee.0.28dba7fffeaff176.state</field>
                                                          <field name="WITH_DELAY">FALSE</field>
                                                          <value name="VALUE">
                                                            <block type="logic_boolean" id="{V)FjV?5Ns5`w?~zW=kN">
                                                              <field name="BOOL">FALSE</field>
                                                            </block>
                                                          </value>
                                                          <next>
                                                            <block type="control" id="Ei(3viA[C=5Kz)XE#=c+">
                                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                              <field name="OID">zigbee.0.9035eafffef8fae6.state</field>
                                                              <field name="WITH_DELAY">FALSE</field>
                                                              <value name="VALUE">
                                                                <block type="logic_boolean" id="PMxKt)J6Py1,/fU.^J0/">
                                                                  <field name="BOOL">FALSE</field>
                                                                </block>
                                                              </value>
                                                              <next>
                                                                <block type="control" id="Jj)_~pS%D1Cf6w6i?Sr.">
                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                  <field name="OID">zigbee.0.9035eafffef8fd3e.state</field>
                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                  <value name="VALUE">
                                                                    <block type="logic_boolean" id="aKWLc:j`g~oJA!PgM}h;">
                                                                      <field name="BOOL">FALSE</field>
                                                                    </block>
                                                                  </value>
                                                                  <next>
                                                                    <block type="timeouts_cleartimeout" id="7|fOliT8c=O:e6EL42+)">
                                                                      <field name="NAME">timeout</field>
                                                                      <next>
                                                                        <block type="timeouts_cleartimeout" id="GKT1(cN8_4~S`rCMOOf{">
                                                                          <field name="NAME">timeout2</field>
                                                                          <next>
                                                                            <block type="timeouts_cleartimeout" id="8PC*b3$_%]Z+QKdiQbj5">
                                                                              <field name="NAME">timeout3</field>
                                                                            </block>
                                                                          </next>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </statement>
                        </block>
                      </statement>
                    </block>
                  </xml>
                  

                  c07738ae-0117-467a-bfcf-8630762270b8-image.png
                  9a01f15f-575d-4b63-b5c8-210c8f7e1d93-image.png

                  Hoffe, dass es ohne Fehler ist.

                  Asgothian paul53 2 Replies Last reply Reply Quote 0
                  • Asgothian
                    Asgothian Developer @Superdad last edited by Asgothian

                    @superdad sagte in Brauche Hilfe bei Script zwecks Abbruch:

                    Hoffe, dass es ohne Fehler ist.

                    Ist es nur bedingt. Da die Ausführung der setState befehle Zeit kosten kann sollten die Timeouts dringend vor dem schalten der Ventile etc. angehalten werden. Ansonsten kann es sein das durch einen noch nicht angehaltenen Timeout da etwas eingeschaltet wird was das Skript gerade vorher abgeschaltet hat.

                    Das kommt im Zweifelsfall nur selten vor - ist aber nicht ausgeschlossen.

                    A.

                    S 1 Reply Last reply Reply Quote 0
                    • S
                      Superdad @Asgothian last edited by

                      @asgothian
                      OMG
                      Wie mache ich denn das jetzt wieder?

                      1 Reply Last reply Reply Quote 0
                      • S
                        Superdad last edited by Superdad

                        In jedem Timeout das vorherige Timeout nochmals stoppen?
                        Also in TimeOut2 TimeOut stoppen?
                        Und in TimeOut3 Timeout2 stoppen?

                        So?
                        c5652a9d-3c9f-4f39-888c-a722dd0cf88c-image.png

                        Codierknecht paul53 2 Replies Last reply Reply Quote 0
                        • Codierknecht
                          Codierknecht Developer Most Active @Superdad last edited by Codierknecht

                          @superdad
                          Ich vermute, @Asgothian meint hier den "Sonst"-Teil.
                          Hier zuerst die timeouts beenden und dann die states setzen.
                          Also einfach die Reihenfolge ändern.

                          Die anderen Stopps dürften aber auch nicht schaden.

                          S 1 Reply Last reply Reply Quote 0
                          • S
                            Superdad @Codierknecht last edited by

                            @codierknecht
                            OK!
                            Vielen Dank für eure Hilfe!

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

                              @superdad sagte: In jedem Timeout das vorherige Timeout nochmals stoppen?

                              Nein, das ist unnötig.

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

                                @superdad sagte: Ich habe es jetzt so gelöst:

                                Ich würde ein Minuten-Intervall mit einer Zählvariablen verwenden.

                                Blockly_temp.JPG

                                EDIT: Zusätzlich mit Ansagen (wie im ersten Beitrag):

                                Blockly_temp.JPG

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

                                  @paul53 sagte in Brauche Hilfe bei Script zwecks Abbruch:

                                  @superdad sagte: Ich habe es jetzt so gelöst:

                                  Ich würde ein Minuten-Intervall mit einer Zählvariablen verwenden.

                                  Blockly_temp.JPG

                                  Warum einen 1-Minütigen Heartbeat wenn die 3 verschachtelten Timeouts sauber laufen ? Das erschliesst sich mir nicht.

                                  @codierknecht sagte in Brauche Hilfe bei Script zwecks Abbruch:

                                  Ich vermute, @Asgothian meint hier den "Sonst"-Teil.

                                  Korrekt. Das nur im Sonst-Teil\

                                  A.

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

                                    @asgothian sagte: Warum einen 1-Minütigen Heartbeat wenn die 3 verschachtelten Timeouts sauber laufen ?

                                    Ich finde es übersichtlicher.

                                    Codierknecht 1 Reply Last reply Reply Quote 1
                                    • Codierknecht
                                      Codierknecht Developer Most Active @paul53 last edited by

                                      @paul53 sagte in Brauche Hilfe bei Script zwecks Abbruch:

                                      Ich finde es übersichtlicher.

                                      Ich nicht 😉

                                      1 Reply Last reply Reply Quote 0
                                      • S
                                        Superdad last edited by

                                        Hoffentlich habe ich jetzt hier keinen Glaubenskrieg ausgelöst?

                                        Nochmals vielen Dank!

                                        Asgothian 1 Reply Last reply Reply Quote 0
                                        • Asgothian
                                          Asgothian Developer @Superdad last edited by

                                          @superdad sagte in Brauche Hilfe bei Script zwecks Abbruch:

                                          Hoffentlich habe ich jetzt hier keinen Glaubenskrieg ausgelöst?

                                          Nicht bei mir. Ich war nur neugierig.

                                          Viel Spass mit der Lösung.

                                          A.

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

                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate

                                          474
                                          Online

                                          31.9k
                                          Users

                                          80.1k
                                          Topics

                                          1.3m
                                          Posts

                                          4
                                          20
                                          910
                                          Loading More Posts
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          Community
                                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                          The ioBroker Community 2014-2023
                                          logo