Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Bei Bewegung und Licht schalten

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Bei Bewegung und Licht schalten

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

      Hallo, ich bin in sachen script schreiben vollkommen neu.

      Mein Ziel:
      Licht bei unterschreiten von 200 lux und erkannter Bewegung einschalten und falls keine Bewegung erkannt 5 min Später aus.

      Kann da einer helfen? Hardware hab ich Schalter und Sensoren von Xiaomi und als Gateway einen ConBee II.

      Mir fehlt sicher noch Übung.

      Versucht hab ich mit folgendem:

      <xml xmlns="https://developers.google.com/blockly/xml">
        <block type="on_ext" id="J^V:?i(?I[76Y)f51U|I" x="-263" y="-362">
          <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="]$w0#p=ciU2rOBf2G]?a">
              <field name="oid">default</field>
            </shadow>
            <block type="logic_compare" id="^_!,8bEk@r]*RH~#w`qr">
              <field name="OP">LT</field>
              <value name="A">
                <block type="get_value" id="6,b;Ld,lC2ZZ~)WoP/2.">
                  <field name="ATTR">val</field>
                  <field name="OID">deconz.0.Sensors.27.lux</field>
                </block>
              </value>
              <value name="B">
                <block type="math_number" id="[KidI)n#+QBW_brL5p*f">
                  <field name="NUM">200</field>
                </block>
              </value>
            </block>
          </value>
          <statement name="STATEMENT">
            <block type="controls_if" id="1?0XbxLFe^.|ZA@WMWP7">
              <mutation else="1"></mutation>
              <value name="IF0">
                <block type="logic_compare" id="q2[w$pyQY9Zc+nPS8T^d">
                  <field name="OP">EQ</field>
                  <value name="A">
                    <block type="get_value" id="nEpQZ;9Z)DVrl(6e-98/">
                      <field name="ATTR">val</field>
                      <field name="OID">deconz.0.Lights.11.on</field>
                    </block>
                  </value>
                  <value name="B">
                    <block type="logic_boolean" id="*Q=:OGs_k5c(:X-p4#_a">
                      <field name="BOOL">FALSE</field>
                    </block>
                  </value>
                </block>
              </value>
              <statement name="DO0">
                <block type="control" id="*#Uh!TMj4SYlJw:^6|//">
                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                  <field name="OID">deconz.0.Lights.11.on</field>
                  <field name="WITH_DELAY">FALSE</field>
                  <value name="VALUE">
                    <block type="logic_boolean" id="a]k.d=zbPyw49|1T@bN9">
                      <field name="BOOL">TRUE</field>
                    </block>
                  </value>
                </block>
              </statement>
              <statement name="ELSE">
                <block type="control" id="`?FeP*D:dM,8m}XBd|7U">
                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
                  <field name="OID">deconz.0.Lights.11.on</field>
                  <field name="WITH_DELAY">TRUE</field>
                  <field name="DELAY_MS">20</field>
                  <field name="UNIT">sec</field>
                  <field name="CLEAR_RUNNING">FALSE</field>
                  <value name="VALUE">
                    <block type="logic_boolean" id="qZ$IXjQ2NFg-xH!Dv[O+">
                      <field name="BOOL">FALSE</field>
                    </block>
                  </value>
                </block>
              </statement>
            </block>
          </statement>
        </block>
      </xml>
      

      MOD_Edit: Code in code-tags gesetzt!

      FredF paul53 2 Replies Last reply Reply Quote 0
      • FredF
        FredF Most Active Forum Testing @Sarah last edited by

        @Sarah
        hier mal ein Bespiel
        c98888e2-5139-4672-9fdf-ec35fbc0ee8f-grafik.png

        Wert findest du unter Trigger als Objekt ID Block, der per Drop Down auf Wert umgestellt wird. Bei erkannter Bewegung wird Wert = true

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

          @Sarah sagte:

          Versucht hab ich mit folgendem:

          Der BWM muss triggern.

          <xml xmlns="https://developers.google.com/blockly/xml">
           <variables>
             <variable type="timeout" id="timeout">timeout</variable>
           </variables>
           <block type="comment" id="OSO=R5pTa5dd57(pCHBQ" x="-238" y="-387">
             <field name="COMMENT">BWM</field>
             <next>
               <block type="on_ext" id="J^V:?i(?I[76Y)f51U|I">
                 <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="]$w0#p=ciU2rOBf2G]?a">
                     <field name="oid">default</field>
                   </shadow>
                 </value>
                 <statement name="STATEMENT">
                   <block type="controls_if" id="%d|($)|c;/b1CQs_?eXp">
                     <mutation else="1"></mutation>
                     <value name="IF0">
                       <block type="on_source" id="?-T@4I@+ZNcSeEc5$$x:">
                         <field name="ATTR">state.val</field>
                       </block>
                     </value>
                     <statement name="DO0">
                       <block type="timeouts_cleartimeout" id="G1m!h!r*477zG[FxYi4W">
                         <field name="NAME">timeout</field>
                         <next>
                           <block type="controls_if" id="1?0XbxLFe^.|ZA@WMWP7">
                             <value name="IF0">
                               <block type="logic_compare" id="^_!,8bEk@r]*RH~#w`qr">
                                 <field name="OP">LT</field>
                                 <value name="A">
                                   <block type="get_value" id="6,b;Ld,lC2ZZ~)WoP/2.">
                                     <field name="ATTR">val</field>
                                     <field name="OID">deconz.0.Sensors.27.lux</field>
                                   </block>
                                 </value>
                                 <value name="B">
                                   <block type="math_number" id="[KidI)n#+QBW_brL5p*f">
                                     <field name="NUM">200</field>
                                   </block>
                                 </value>
                               </block>
                             </value>
                             <statement name="DO0">
                               <block type="control" id="*#Uh!TMj4SYlJw:^6|//">
                                 <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                 <field name="OID">deconz.0.Lights.11.on</field>
                                 <field name="WITH_DELAY">FALSE</field>
                                 <value name="VALUE">
                                   <block type="logic_boolean" id="a]k.d=zbPyw49|1T@bN9">
                                     <field name="BOOL">TRUE</field>
                                   </block>
                                 </value>
                               </block>
                             </statement>
                           </block>
                         </next>
                       </block>
                     </statement>
                     <statement name="ELSE">
                       <block type="timeouts_settimeout" id="i_.N-{0pYsV./^Gbd)9#">
                         <field name="NAME">timeout</field>
                         <field name="DELAY">5</field>
                         <field name="UNIT">min</field>
                         <statement name="STATEMENT">
                           <block type="control" id="`?FeP*D:dM,8m}XBd|7U">
                             <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                             <field name="OID">deconz.0.Lights.11.on</field>
                             <field name="WITH_DELAY">FALSE</field>
                             <value name="VALUE">
                               <block type="logic_boolean" id="qZ$IXjQ2NFg-xH!Dv[O+">
                                 <field name="BOOL">FALSE</field>
                               </block>
                             </value>
                           </block>
                         </statement>
                       </block>
                     </statement>
                   </block>
                 </statement>
               </block>
             </next>
           </block>
          </xml>
          

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

          Support us

          ioBroker
          Community Adapters
          Donate

          819
          Online

          32.0k
          Users

          80.4k
          Topics

          1.3m
          Posts

          3
          3
          196
          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