Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Licht geht allein aus !!

    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

    Licht geht allein aus !!

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

      Hallo
      habe ein BlocklyScript mit Bewegungsmelder laufen.

      <xml xmlns="http://www.w3.org/1999/xhtml">
        <variables>
          <variable type="undefined" id="timeout">timeout</variable>
        </variables>
        <block type="on" id="gNt!/9v50#T}LQmVt5*;" x="38" y="-87">
          <field name="OID">hm-rpc.0.NEQ1702336.1.MOTION</field>
          <field name="CONDITION">ne</field>
          <field name="ACK_CONDITION"></field>
          <statement name="STATEMENT">
            <block type="controls_if" id="0CMf9(7F7#SON]1?)~0o">
              <value name="IF0">
                <block type="logic_operation" id="6bIT0/BuihM/Q;!ph;7p">
                  <field name="OP">AND</field>
                  <value name="A">
                    <block type="logic_compare" id="E6PavZ=eZ)vNu:=ES=B}">
                      <field name="OP">EQ</field>
                      <value name="A">
                        <block type="get_value" id="pwFkf)[n[pC1@n=43TUz">
                          <field name="ATTR">val</field>
                          <field name="OID">shelly.0.SHSW-1#B8C714#1.Relay0.Switch</field>
                        </block>
                      </value>
                      <value name="B">
                        <block type="logic_boolean" id="ZEu,CyGR-$A`oA?{,*dM">
                          <field name="BOOL">FALSE</field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <value name="B">
                    <block type="time_compare_ex" id="5.Jax##)CH:~UZcS5n9k">
                      <mutation end_time="true" actual_time="true"></mutation>
                      <field name="USE_ACTUAL_TIME">TRUE</field>
                      <field name="OPTION">between</field>
                      <value name="START_TIME">
                        <shadow type="text" id="{ikSrKzK=8yWZ/wDCj|j">
                          <field name="TEXT">19:00</field>
                        </shadow>
                      </value>
                      <value name="END_TIME">
                        <shadow type="text" id="sTDwW6^Cw8Un?DMOEir~">
                          <field name="TEXT">07:00</field>
                        </shadow>
                      </value>
                    </block>
                  </value>
                </block>
              </value>
              <statement name="DO0">
                <block type="control" id="58BF~TPF+}c?Y9Pa{0.K">
                  <mutation delay_input="false"></mutation>
                  <field name="OID">shelly.0.SHSW-1#B8C714#1.Relay0.Switch</field>
                  <field name="WITH_DELAY">FALSE</field>
                  <value name="VALUE">
                    <block type="logic_boolean" id="2R`c*;Z[NV/X(ER`6gU]">
                      <field name="BOOL">TRUE</field>
                    </block>
                  </value>
                </block>
              </statement>
              <next>
                <block type="timeouts_cleartimeout" id="}v~LX.~es]^Lls6o|AU9">
                  <field name="NAME">timeout</field>
                  <next>
                    <block type="timeouts_settimeout" id="gTD@2k%eI?NOkK3y#3CG">
                      <field name="NAME">timeout</field>
                      <field name="DELAY">20</field>
                      <field name="UNIT">sec</field>
                      <statement name="STATEMENT">
                        <block type="control" id="GUqGc4l0Y-Z:Bhg,FiXb">
                          <mutation delay_input="true"></mutation>
                          <field name="OID">shelly.0.SHSW-1#B8C714#1.Relay0.Switch</field>
                          <field name="WITH_DELAY">TRUE</field>
                          <field name="DELAY_MS">20</field>
                          <field name="UNIT">sec</field>
                          <field name="CLEAR_RUNNING">TRUE</field>
                          <value name="VALUE">
                            <block type="logic_boolean" id="FsQjOF3tQjJFn(P,qgsC">
                              <field name="BOOL">FALSE</field>
                            </block>
                          </value>
                        </block>
                      </statement>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </statement>
        </block>
      </xml>
      

      Leider funktioniert es nicht wie es soll.
      es soll per Bewegungsmelder ab 19:00Uhr bis 7:00Uhr für 20 sec schalten
      und wenn ich es tagsüber per Schalter schalte soll es an bleiben bis ich es ausschalte.
      aber es geht nach 20 sec aus auch beim schalten über manuellen Schalter
      Zur Info:
      Bewegungsmelder ist Homematic und Schlater ein Shelly1.
      Wo ist mein Fehler ?
      Danke

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

        @bele2000 sagte:

        wenn ich es tagsüber per Schalter schalte soll es an bleiben bis ich es ausschalte.

        <xml xmlns="http://www.w3.org/1999/xhtml">
         <variables>
           <variable type="undefined" id="timeout">timeout</variable>
         </variables>
         <block type="on" id="gNt!/9v50#T}LQmVt5*;" x="-13" y="-187">
           <field name="OID">hm-rpc.0.NEQ1702336.1.MOTION</field>
           <field name="CONDITION">ne</field>
           <field name="ACK_CONDITION"></field>
           <statement name="STATEMENT">
             <block type="controls_if" id="0CMf9(7F7#SON]1?)~0o">
               <value name="IF0">
                 <block type="time_compare_ex" id="5.Jax##)CH:~UZcS5n9k">
                   <mutation end_time="true" actual_time="true"></mutation>
                   <field name="USE_ACTUAL_TIME">TRUE</field>
                   <field name="OPTION">between</field>
                   <value name="START_TIME">
                     <shadow type="text" id="{ikSrKzK=8yWZ/wDCj|j">
                       <field name="TEXT">19:00</field>
                     </shadow>
                   </value>
                   <value name="END_TIME">
                     <shadow type="text" id="sTDwW6^Cw8Un?DMOEir~">
                       <field name="TEXT">07:00</field>
                     </shadow>
                   </value>
                 </block>
               </value>
               <statement name="DO0">
                 <block type="controls_if" id="1?G405q4KS{_M_2AR+-T">
                   <mutation else="1"></mutation>
                   <value name="IF0">
                     <block type="on_source" id="}#9zq:fq1xqVgAk)gA.u">
                       <field name="ATTR">state.val</field>
                     </block>
                   </value>
                   <statement name="DO0">
                     <block type="timeouts_cleartimeout" id="}v~LX.~es]^Lls6o|AU9">
                       <field name="NAME">timeout</field>
                       <next>
                         <block type="control" id="58BF~TPF+}c?Y9Pa{0.K">
                           <mutation delay_input="false"></mutation>
                           <field name="OID">shelly.0.SHSW-1#B8C714#1.Relay0.Switch</field>
                           <field name="WITH_DELAY">FALSE</field>
                           <value name="VALUE">
                             <block type="logic_boolean" id="2R`c*;Z[NV/X(ER`6gU]">
                               <field name="BOOL">TRUE</field>
                             </block>
                           </value>
                         </block>
                       </next>
                     </block>
                   </statement>
                   <statement name="ELSE">
                     <block type="timeouts_settimeout" id="gTD@2k%eI?NOkK3y#3CG">
                       <field name="NAME">timeout</field>
                       <field name="DELAY">20</field>
                       <field name="UNIT">sec</field>
                       <statement name="STATEMENT">
                         <block type="control" id="GUqGc4l0Y-Z:Bhg,FiXb">
                           <mutation delay_input="false"></mutation>
                           <field name="OID">shelly.0.SHSW-1#B8C714#1.Relay0.Switch</field>
                           <field name="WITH_DELAY">FALSE</field>
                           <value name="VALUE">
                             <block type="logic_boolean" id="FsQjOF3tQjJFn(P,qgsC">
                               <field name="BOOL">FALSE</field>
                             </block>
                           </value>
                         </block>
                       </statement>
                     </block>
                   </statement>
                 </block>
               </statement>
             </block>
           </statement>
         </block>
        </xml>
        

        1 Reply Last reply Reply Quote 0
        • B
          bele2000 last edited by

          @paul53

          Danke scheint zu klappen !

          Gruß

          1 Reply Last reply Reply Quote 0
          • B
            bele2000 last edited by

            habe jetzt festgestellt das es ab 19:00 Uhr doch wieder allein ausgeht wenn ich den Lichtschalter betätige !

            S T 2 Replies Last reply Reply Quote 0
            • S
              smarthome2020 @bele2000 last edited by

              @bele2000

              Also du willst folgendes:

              1. Tagsüber soll das Licht nur durch dich angeschaltet werden und dann so lange an bleiben bis du es ausschaltest; keine Triggerung durch Bewegungsmelder?
              2. Ab 19 Uhr bis 7 Uhr soll es hingegen nur durch den Bewegungsmelder gesteuert werden für 20 Sekunden? Oder willst du hier auch noch die Option zum selber schalten und abschalten durch den Schalter?
              1 Reply Last reply Reply Quote 0
              • T
                ticaki Developer @bele2000 last edited by ticaki

                @bele2000

                Du must im Objekt ID Feld noch deinen Schalterpunkt einfügen. Der Bewegungsmelder schaltet nur noch in der vorgegebenen Zeit und wenn der Schalter auf aus steht.
                EDIT: Ach ne das funktioniert nicht mit shellys denke ich.

                <xml xmlns="http://www.w3.org/1999/xhtml">
                  <variables>
                    <variable type="undefined" id="timeout">timeout</variable>
                  </variables>
                  <block type="on" id="gNt!/9v50#T}LQmVt5*;" x="-13" y="-187">
                    <field name="OID">hm-rpc.0.NEQ1702336.1.MOTION</field>
                    <field name="CONDITION">ne</field>
                    <field name="ACK_CONDITION"></field>
                    <statement name="STATEMENT">
                      <block type="controls_if" id="0CMf9(7F7#SON]1?)~0o">
                        <value name="IF0">
                          <block type="logic_operation" id="x2?nQqLE@+i7dUBI_ZmL">
                            <field name="OP">AND</field>
                            <value name="A">
                              <block type="time_compare_ex" id="5.Jax##)CH:~UZcS5n9k">
                                <mutation end_time="true" actual_time="true"></mutation>
                                <field name="USE_ACTUAL_TIME">TRUE</field>
                                <field name="OPTION">between</field>
                                <value name="START_TIME">
                                  <shadow type="text" id="{ikSrKzK=8yWZ/wDCj|j">
                                    <field name="TEXT">19:00</field>
                                  </shadow>
                                </value>
                                <value name="END_TIME">
                                  <shadow type="text" id="sTDwW6^Cw8Un?DMOEir~">
                                    <field name="TEXT">07:00</field>
                                  </shadow>
                                </value>
                              </block>
                            </value>
                            <value name="B">
                              <block type="logic_negate" id="7P)PQNLq%zo?OKb8R1UF">
                                <value name="BOOL">
                                  <block type="get_value" id="+dOk8]qh3/z_#jRHL3oV">
                                    <field name="ATTR">val</field>
                                    <field name="OID">ID auswählen</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO0">
                          <block type="controls_if" id="1?G405q4KS{_M_2AR+-T">
                            <mutation else="1"></mutation>
                            <value name="IF0">
                              <block type="on_source" id="}#9zq:fq1xqVgAk)gA.u">
                                <field name="ATTR">state.val</field>
                              </block>
                            </value>
                            <statement name="DO0">
                              <block type="timeouts_cleartimeout" id="}v~LX.~es]^Lls6o|AU9">
                                <field name="NAME">timeout</field>
                                <next>
                                  <block type="control" id="58BF~TPF+}c?Y9Pa{0.K">
                                    <mutation delay_input="false"></mutation>
                                    <field name="OID">shelly.0.SHSW-1#B8C714#1.Relay0.Switch</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <block type="logic_boolean" id="2R`c*;Z[NV/X(ER`6gU]">
                                        <field name="BOOL">TRUE</field>
                                      </block>
                                    </value>
                                  </block>
                                </next>
                              </block>
                            </statement>
                            <statement name="ELSE">
                              <block type="timeouts_settimeout" id="gTD@2k%eI?NOkK3y#3CG">
                                <field name="NAME">timeout</field>
                                <field name="DELAY">20</field>
                                <field name="UNIT">sec</field>
                                <statement name="STATEMENT">
                                  <block type="control" id="GUqGc4l0Y-Z:Bhg,FiXb">
                                    <mutation delay_input="false"></mutation>
                                    <field name="OID">shelly.0.SHSW-1#B8C714#1.Relay0.Switch</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <block type="logic_boolean" id="FsQjOF3tQjJFn(P,qgsC">
                                        <field name="BOOL">FALSE</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                              </block>
                            </statement>
                          </block>
                        </statement>
                      </block>
                    </statement>
                  </block>
                </xml>
                

                Mit shellys sollte das hier funktionieren. Mußt aber ebenfalls den Schalterpunkt noch einfügen. Bekannter Fehler: Wenn die Lampe an ist, während iobroker/Adapter/Script neugestartet wird, bleibt das Licht an.

                <xml xmlns="http://www.w3.org/1999/xhtml">
                 <variables>
                   <variable type="undefined" id="timeout">timeout</variable>
                   <variable type="" id="(/r7QN5y5M`.Zx)f!Sc-">auto</variable>
                 </variables>
                 <block type="on" id="gNt!/9v50#T}LQmVt5*;" x="-38" y="-238">
                   <field name="OID">hm-rpc.0.NEQ1702336.1.MOTION</field>
                   <field name="CONDITION">ne</field>
                   <field name="ACK_CONDITION"></field>
                   <statement name="STATEMENT">
                     <block type="controls_if" id="0CMf9(7F7#SON]1?)~0o">
                       <value name="IF0">
                         <block type="logic_operation" id="x2?nQqLE@+i7dUBI_ZmL">
                           <field name="OP">AND</field>
                           <value name="A">
                             <block type="time_compare_ex" id="5.Jax##)CH:~UZcS5n9k">
                               <mutation end_time="true" actual_time="true"></mutation>
                               <field name="USE_ACTUAL_TIME">TRUE</field>
                               <field name="OPTION">between</field>
                               <value name="START_TIME">
                                 <shadow type="text" id="{ikSrKzK=8yWZ/wDCj|j">
                                   <field name="TEXT">19:00</field>
                                 </shadow>
                               </value>
                               <value name="END_TIME">
                                 <shadow type="text" id="sTDwW6^Cw8Un?DMOEir~">
                                   <field name="TEXT">07:00</field>
                                 </shadow>
                               </value>
                             </block>
                           </value>
                           <value name="B">
                             <block type="logic_compare" id="VjodfKPBdu[S/RsFUWlz">
                               <field name="OP">EQ</field>
                               <value name="A">
                                 <block type="logic_negate" id="+yAfku(n0ylct0#Wgx@s">
                                   <value name="BOOL">
                                     <block type="variables_get" id="SI}ws7RFckw%[5xCec|p">
                                       <field name="VAR" id="(/r7QN5y5M`.Zx)f!Sc-" variabletype="">auto</field>
                                     </block>
                                   </value>
                                 </block>
                               </value>
                               <value name="B">
                                 <block type="logic_negate" id="Op%22kc+=FfHmBQ:6?Tc">
                                   <value name="BOOL">
                                     <block type="get_value" id="+dOk8]qh3/z_#jRHL3oV">
                                       <field name="ATTR">val</field>
                                       <field name="OID">ID auswählen</field>
                                     </block>
                                   </value>
                                 </block>
                               </value>
                             </block>
                           </value>
                         </block>
                       </value>
                       <statement name="DO0">
                         <block type="controls_if" id="1?G405q4KS{_M_2AR+-T">
                           <mutation else="1"></mutation>
                           <value name="IF0">
                             <block type="on_source" id="}#9zq:fq1xqVgAk)gA.u">
                               <field name="ATTR">state.val</field>
                             </block>
                           </value>
                           <statement name="DO0">
                             <block type="timeouts_cleartimeout" id="}v~LX.~es]^Lls6o|AU9">
                               <field name="NAME">timeout</field>
                               <next>
                                 <block type="variables_set" id="!vb/Nbhhj{v(L%grbn#3">
                                   <field name="VAR" id="(/r7QN5y5M`.Zx)f!Sc-" variabletype="">auto</field>
                                   <value name="VALUE">
                                     <block type="logic_boolean" id="/{fE/_-gj/3Sv6wH?-(y">
                                       <field name="BOOL">TRUE</field>
                                     </block>
                                   </value>
                                   <next>
                                     <block type="control" id="58BF~TPF+}c?Y9Pa{0.K">
                                       <mutation delay_input="false"></mutation>
                                       <field name="OID">shelly.0.SHSW-1#B8C714#1.Relay0.Switch</field>
                                       <field name="WITH_DELAY">FALSE</field>
                                       <value name="VALUE">
                                         <block type="logic_boolean" id="2R`c*;Z[NV/X(ER`6gU]">
                                           <field name="BOOL">TRUE</field>
                                         </block>
                                       </value>
                                     </block>
                                   </next>
                                 </block>
                               </next>
                             </block>
                           </statement>
                           <statement name="ELSE">
                             <block type="timeouts_settimeout" id="gTD@2k%eI?NOkK3y#3CG">
                               <field name="NAME">timeout</field>
                               <field name="DELAY">20</field>
                               <field name="UNIT">sec</field>
                               <statement name="STATEMENT">
                                 <block type="variables_set" id="A2(TwbZpTV/Kpvl}JY{/">
                                   <field name="VAR" id="(/r7QN5y5M`.Zx)f!Sc-" variabletype="">auto</field>
                                   <value name="VALUE">
                                     <block type="logic_boolean" id="r*w@rI?im}`LZ?ZEVY;[">
                                       <field name="BOOL">FALSE</field>
                                     </block>
                                   </value>
                                   <next>
                                     <block type="control" id="GUqGc4l0Y-Z:Bhg,FiXb">
                                       <mutation delay_input="false"></mutation>
                                       <field name="OID">shelly.0.SHSW-1#B8C714#1.Relay0.Switch</field>
                                       <field name="WITH_DELAY">FALSE</field>
                                       <value name="VALUE">
                                         <block type="logic_boolean" id="FsQjOF3tQjJFn(P,qgsC">
                                           <field name="BOOL">FALSE</field>
                                         </block>
                                       </value>
                                     </block>
                                   </next>
                                 </block>
                               </statement>
                             </block>
                           </statement>
                         </block>
                       </statement>
                     </block>
                   </statement>
                 </block>
                </xml>
                

                1 Reply Last reply Reply Quote 0
                • B
                  bele2000 last edited by

                  @smarthome2020
                  Danke Dir
                  nach 19:00 Uhr will ich auch die Option mit schalter schalten solange bis ich aussschalte !

                  @ticaki
                  Danke Dir
                  teste das 2te script mal weil Shelly

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

                  Support us

                  ioBroker
                  Community Adapters
                  Donate

                  415
                  Online

                  31.9k
                  Users

                  80.2k
                  Topics

                  1.3m
                  Posts

                  javascript
                  4
                  7
                  484
                  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