Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. [gelöst] Skript um Doppel Trigger zu vermeiden

    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] Skript um Doppel Trigger zu vermeiden

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

      Hallo,
      ich habe einen HUE Motion Sensor, dieser hat eine kurze Schaltzeit von Bewegung ein zu Bewegung aus ca. 20 sec.
      Der Sensor soll eine Kamera Aufnahme starten die 1 Minute geht, das wäre mein Problem.
      Es soll nur alle 2 Minuten eine Neue Aufnahme gestartet werden.

      Ich überlege grade wie ich mit einem Hilfstrigger / Objekt (Hue-Timer) eine zeitliche Verzögerung umsetzten könnte.

      Beispiel,
      Hue Motion schaltet ein/ True -> Objekt "Hue-Timer" wird auf wahr gesetzt.
      Nun sollte das Objekt Hue-Timmer 2 Minuten lang auf wahr bleiben, unabhängig ob ein neuer True Trigger vom Motion Sensor kommt.

      Vielleicht könnte mir, mit dem unteren Code das passende Blocky dazu erstellen - Lieben dank

      Bild3.jpg

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable type="timeout" id="timeout">timeout</variable>
        </variables>
        <block type="on_ext" id="ie!o(`},y!W_nQm2O}qM" x="-1287" y="-913">
          <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
          <field name="CONDITION">ne</field>
          <field name="ACK_CONDITION"></field>
          <value name="OID0">
            <shadow type="field_oid" id="UUp`wRVA;u40;DDch#qV">
              <field name="oid">hue.0.Hue_outdoor_motion_sensor_1.presence</field>
            </shadow>
          </value>
          <statement name="STATEMENT">
            <block type="controls_if" id="p{O+wRg0V(;3U_SM?w38">
              <value name="IF0">
                <block type="logic_compare" id="`6$lyF;^,C3RGF@[XA@o">
                  <field name="OP">EQ</field>
                  <value name="A">
                    <block type="get_value" id="t]Q`JH6*Js#;wR9i]V4H">
                      <field name="ATTR">val</field>
                      <field name="OID">hue.0.Hue_outdoor_motion_sensor_1.presence</field>
                    </block>
                  </value>
                  <value name="B">
                    <block type="logic_boolean" id="{WQiN]pD[KjaEP0l^cnr">
                      <field name="BOOL">TRUE</field>
                    </block>
                  </value>
                </block>
              </value>
              <statement name="DO0">
                <block type="control" id="(,+|pL)+vHX9Sr_~P[+I">
                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
                  <field name="OID">0_userdata.0.Kamera.Zeit-Trigger-HUE.Hue-Timer</field>
                  <field name="WITH_DELAY">TRUE</field>
                  <field name="DELAY_MS">1</field>
                  <field name="UNIT">sec</field>
                  <field name="CLEAR_RUNNING">TRUE</field>
                  <value name="VALUE">
                    <block type="logic_boolean" id="k1JgG)AeA{QUrj~2{%lH">
                      <field name="BOOL">TRUE</field>
                    </block>
                  </value>
                  <next>
                    <block type="timeouts_settimeout" id="F2TXwFr1f3sf0NVGxH`9">
                      <field name="NAME">timeout</field>
                      <field name="DELAY">2</field>
                      <field name="UNIT">min</field>
                      <statement name="STATEMENT">
                        <block type="control" id="-VTu!4]@l)mnl=pp!|R6">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                          <field name="OID">0_userdata.0.Kamera.Zeit-Trigger-HUE.Hue-Timer</field>
                          <field name="WITH_DELAY">FALSE</field>
                          <value name="VALUE">
                            <block type="logic_boolean" id="Vq$eY[()|1Z[7z,9^iwL">
                              <field name="BOOL">FALSE</field>
                            </block>
                          </value>
                        </block>
                      </statement>
                    </block>
                  </next>
                </block>
              </statement>
            </block>
          </statement>
        </block>
      </xml>
      
      paul53 1 Reply Last reply Reply Quote 0
      • paul53
        paul53 @Yoda last edited by paul53

        @yoda sagte: 2 Minuten lang auf wahr bleiben, unabhängig ob ein neuer True Trigger vom Motion Sensor kommt.

        Suche im Forum nach "entprellen".

        Bild_2022-01-22_232829.png

        Anmerkung: Man muss erst eine dummy-Variable erstellen, um an die Timer-Variable timeout zu gelangen.

        Yoda 2 Replies Last reply Reply Quote 1
        • Yoda
          Yoda @paul53 last edited by

          @paul53
          Ich Danke dir für die schnelle Hilfe - werde so mal versuchen.

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

            @paul53
            das war genau das was ich brauchte - klappt super nochmals meinen besten Dank @paul53 👍

            Das Objekt Hue-Timer wird so für 2 Min auf wahr gesetzt, unabhängig wie oft ein Trigger in der Zeit vom Motion Sensor empfangen wird.

            Bild4.jpg

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

            Support us

            ioBroker
            Community Adapters
            Donate

            671
            Online

            31.8k
            Users

            80.0k
            Topics

            1.3m
            Posts

            blockly javascript
            2
            4
            218
            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