Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Verzögerung funktioniert nicht [gelöst]

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Verzögerung funktioniert nicht [gelöst]

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

      Hey Leute hab hier ein Blockly womit einer Lampe eingeschaltet wird, wenn eine Bewegung mit dem BW erfasst wird und sollte die Lampe wieder 60 Sekunden abschalten, sobald vom BW die Meldung kommt, das keine Motion mehr erfasst wird. Das hab ich mit der Funktion "Verzögerung" gemacht. Leider klappt es nicht. Sobald die Meldung vom BW kommt das Motion auf false geht schaltet auch die Lampe ab. Der BW schaltet Motion immer nach ca 20 Sekunden auf false. Hat einer ne Idee was ich da falsch mache? Weitere Frage, wenn der BW jetzt vorm dem Ausschalten der Lampe eine Bewegung meldet soll die Verzögerung ja wieder bei 60 Sekunden beginnen, das sollte doch dann mit dem Haken rein bei: löschen falls läuft funktionieren oder?

      <xml xmlns="https://developers.google.com/blockly/xml">
        <block type="on" id="(5;]3-t$C`x;udA~:HE=" x="87" y="38">
          <field name="OID">hm-rpc.0.PEQ0388404.1.MOTION</field>
          <field name="CONDITION">ne</field>
          <field name="ACK_CONDITION"></field>
          <statement name="STATEMENT">
            <block type="controls_if" id=".{cai;lZ_?CR4~0sZQ=L">
              <value name="IF0">
                <block type="logic_compare" id="UuE,oQzm{bS~c5[{#$D1">
                  <field name="OP">LTE</field>
                  <value name="A">
                    <block type="get_value" id="f{wXFh)CfDH`:nIqtd;U">
                      <field name="ATTR">val</field>
                      <field name="OID">hm-rpc.0.PEQ0388404.1.BRIGHTNESS</field>
                    </block>
                  </value>
                  <value name="B">
                    <block type="math_number" id="~ch+3sabYVgz*ryURn67">
                      <field name="NUM">200</field>
                    </block>
                  </value>
                </block>
              </value>
              <statement name="DO0">
                <block type="controls_if" id="ILH$AA_qH9L7W:ktbKd!">
                  <value name="IF0">
                    <block type="logic_compare" id="9,:KbssW72R[Fp$DGHhY">
                      <field name="OP">EQ</field>
                      <value name="A">
                        <block type="get_value" id="rb0G2@})ff#.~eq0^7ps">
                          <field name="ATTR">val</field>
                          <field name="OID">hm-rpc.0.PEQ0388404.1.MOTION</field>
                        </block>
                      </value>
                      <value name="B">
                        <block type="logic_boolean" id="[4bNH:FcczduLF7j]o7i">
                          <field name="BOOL">TRUE</field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <statement name="DO0">
                    <block type="control" id="7C#,d6{rS]?RWz3eIEH*">
                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                      <field name="OID">shelly.0.SHSW-21#559509#1.Relay0.Switch</field>
                      <field name="WITH_DELAY">FALSE</field>
                      <value name="VALUE">
                        <block type="logic_boolean" id="w,S^m1bY^oiHXJr9fJP=">
                          <field name="BOOL">TRUE</field>
                        </block>
                      </value>
                      <next>
                        <block type="telegram" id="FE4:B/[+gPrqv(iawbjU">
                          <field name="INSTANCE"></field>
                          <field name="LOG"></field>
                          <field name="SILENT">FALSE</field>
                          <field name="PARSEMODE">default</field>
                          <value name="MESSAGE">
                            <shadow type="text" id="hbyz#d,?2p]@T|h.(!)5">
                              <field name="TEXT">Licht an</field>
                            </shadow>
                          </value>
                        </block>
                      </next>
                    </block>
                  </statement>
                </block>
              </statement>
              <next>
                <block type="controls_if" id="e0FBj62[n|v%1}a$3./p">
                  <value name="IF0">
                    <block type="logic_compare" id="BvOUCsT4)=;8|3!?Y~L;">
                      <field name="OP">EQ</field>
                      <value name="A">
                        <block type="get_value" id="dk+2]~7!=4fTc5f?:x26">
                          <field name="ATTR">val</field>
                          <field name="OID">hm-rpc.0.PEQ0388404.1.MOTION</field>
                        </block>
                      </value>
                      <value name="B">
                        <block type="logic_boolean" id="fyqVeuK0a0yp2)@lhXLt">
                          <field name="BOOL">FALSE</field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <statement name="DO0">
                    <block type="control" id="eux%zg(;UD|F^jVw4ja!">
                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
                      <field name="OID">shelly.0.SHSW-21#559509#1.Relay0.Switch</field>
                      <field name="WITH_DELAY">TRUE</field>
                      <field name="DELAY_MS">60</field>
                      <field name="UNIT">sec</field>
                      <field name="CLEAR_RUNNING">FALSE</field>
                      <value name="VALUE">
                        <block type="logic_boolean" id="hK@S#6*Rz@G@6]8SL)wo">
                          <field name="BOOL">FALSE</field>
                        </block>
                      </value>
                      <next>
                        <block type="telegram" id="}Cn{g]/]hzJ=n*]K{]F^">
                          <field name="INSTANCE"></field>
                          <field name="LOG"></field>
                          <field name="SILENT">FALSE</field>
                          <field name="PARSEMODE">default</field>
                          <value name="MESSAGE">
                            <shadow type="text" id="0R.T2K]?TEt1f2WL6R8B">
                              <field name="TEXT">Licht aus</field>
                            </shadow>
                          </value>
                        </block>
                      </next>
                    </block>
                  </statement>
                </block>
              </next>
            </block>
          </statement>
        </block>
      </xml>
      

      2021-09-18 12_35_05-javascript - iobroker.png

      Cinimod 2 Replies Last reply Reply Quote 0
      • Cinimod
        Cinimod Most Active @smarti2015 last edited by Cinimod

        @smarti2015 du solltest lieber mit timeout arbeiten, sobald der BW einmal auf false geht, aber Sekunden später doch wieder Bewegung ist, hält er aktuell deine Ausschalung nicht mehr an.

        deine zwei falls abfragen oben kann man mit einem "und" Baustein zusammenfassen

        unten solltest du statt der Verzögerung einen timeout Baustein nehmen und dort rein deine AUSschalung. dann packst noch direkt nach dem trigger nen "stop
        timeout" Baustein rein, das er jedesmal wenn sich der BM verändert der timout wieder angehalten wird.

        1 Reply Last reply Reply Quote 0
        • Cinimod
          Cinimod Most Active @smarti2015 last edited by Cinimod

          @smarti2015

          Bildschirmfoto 2021-09-18 um 12.57.47.png

          1 Reply Last reply Reply Quote 0
          • ?
            A Former User last edited by

            Kann "Sonst falls" nicht auch weggelassen werden ?
            Also nur ein "sonst".
            Der "wert" ist dann ja "falsch" und es wird abgeschaltet.

            Cinimod 1 Reply Last reply Reply Quote 0
            • Cinimod
              Cinimod Most Active @Guest last edited by

              @blechsoldat es kann aber sein das BM wahr ist aber die helligkeit nicht kleiner/gleich 200 ist ... soll er dann ausschalten ?

              ? 1 Reply Last reply Reply Quote 0
              • ?
                A Former User @Cinimod last edited by

                @dom-sch
                So wie ich das verstehe , ja.

                Cinimod 1 Reply Last reply Reply Quote 0
                • Cinimod
                  Cinimod Most Active @Guest last edited by Cinimod

                  @blechsoldat

                  ... vielleicht soll aber dann auch einfach garnichts passieren ...
                  kann man bei bedarf ja so ändern ... oder man lässt es halt so 😊

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

                    Ja also nur wenn die Helligkeit kleiner als 50 ist, (200 war bei mir nur zum probieren) dann soll die Lampe einschalten. Fürs Ausschalten hab ich noch einen extra Abfrage drin, damit die Lampe auch auf alle Fälle noch ausgeschaltet wird, falls in dem Moment die Helligkeit auf über 50 springen sollte. Morgen probiere ich mal eure Vorschläge aus, erstmal vielen Dank, bin heute leider wegen der Arbeit nicht dazu gekommen. Auf alle Fälle erstmal Danke für eure Antworten.

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

                      Ich danke euch, hat wunderbar geklappt. Hab des jetzt gemacht, wie Dom Sch vorgeschlagen und so passt es jetzt 🙂

                      Cinimod 1 Reply Last reply Reply Quote 0
                      • Cinimod
                        Cinimod Most Active @smarti2015 last edited by Cinimod

                        @smarti2015 das freut mich 👍

                        setz bitte noch ein "gelöst" in den Titel

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        856
                        Online

                        32.0k
                        Users

                        80.5k
                        Topics

                        1.3m
                        Posts

                        3
                        10
                        335
                        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