Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Bewegungsmelder und Lampe an

    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

    Bewegungsmelder und Lampe an

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

      @robbi12 sagte: Das wird ja dort über den Verbrauch geregelt.

      Es geht um das Prinzip, eine Sperrvariable manuell_ein zu setzen und auszuwerten.

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

        @paul53 ok. Ich probiere es. Ich weiss nur nicht den Wert des manuellen weiter des shelly . Der wird ja über switch ein und ausgeschaltet. Wie genauso durch den bewegungsmelder

        paul53 2 Replies Last reply Reply Quote 0
        • paul53
          paul53 @Robbi12 last edited by

          @robbi12 sagte: Wie genauso durch den bewegungsmelder

          Erfolgt die Schaltung durch den Bewegungsmelder nicht über ein Script?

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

            @paul53 Ja. Funtioniert über script. Nun hab ich eine Idee. Triggern der Wert von der Lampe wenn false.

            Dann läuft der triggern mit den Werten vom bewegungsmelder.

            Wenn der Wert lampe true ist läuft der bewgungsmelder nicht

            Könnte das klappen?

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

              @robbi12 sagte Der wird ja über switch ein und ausgeschaltet.

              Direkt oder über ein Script?

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

                @paul53 Direkt

                R paul53 2 Replies Last reply Reply Quote 0
                • R
                  Robbi12 @Robbi12 last edited by

                  @robbi12 Ich würde ja mein Script posten. Bekomme es aber nicht hin, wie ich es hier im Forum als Blockly anzeigen kann

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

                    @robbi12 sagte: Direkt

                    Dann mache es so:

                    Blockly_temp.JPG

                    <xml xmlns="https://developers.google.com/blockly/xml">
                     <variables>
                       <variable id="0P;(IUxU@MDEpVISA(VH">manuell_ein</variable>
                     </variables>
                     <block type="comment" id="c[U%4#_No#2D.si-X{p[" x="62" y="38">
                       <field name="COMMENT">BWM</field>
                       <next>
                         <block type="on_ext" id="VphuGjX^E1q,NemBf;ax">
                           <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="u.HAzh3?]P.yNDTfJ=}]">
                               <field name="oid">default</field>
                             </shadow>
                           </value>
                           <statement name="STATEMENT">
                             <block type="controls_if" id="ABEh;3^k+k}]gT_9i:`r">
                               <value name="IF0">
                                 <block type="logic_negate" id="Txz0rEAwbx0{T=[H9J$B">
                                   <value name="BOOL">
                                     <block type="variables_get" id="+JuSAVvJs.]r=ofnYVtc">
                                       <field name="VAR" id="0P;(IUxU@MDEpVISA(VH">manuell_ein</field>
                                     </block>
                                   </value>
                                 </block>
                               </value>
                               <statement name="DO0">
                                 <block type="comment" id="V3,gkD:Lihm=RwG.-rNw">
                                   <field name="COMMENT">Schalten per BWM</field>
                                 </block>
                               </statement>
                             </block>
                           </statement>
                           <next>
                             <block type="comment" id="Z=qBc/`M6x;{bm:5Hj0N">
                               <field name="COMMENT">Shelly</field>
                               <next>
                                 <block type="on_ext" id="5.xjU_Mh5N4tYE$@n^C~">
                                   <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="Adix?bbi|~#S3:%{cqzr">
                                       <field name="oid">default</field>
                                     </shadow>
                                   </value>
                                   <statement name="STATEMENT">
                                     <block type="variables_set" id="|+UXU+01y_Z`RT[[;u@O">
                                       <field name="VAR" id="0P;(IUxU@MDEpVISA(VH">manuell_ein</field>
                                       <value name="VALUE">
                                         <block type="logic_operation" id=":27N,aPZ2@1|L[bW`I.s" inline="false">
                                           <field name="OP">AND</field>
                                           <value name="A">
                                             <block type="on_source" id="Xn])du+2S%h2Jj6];-,`">
                                               <field name="ATTR">state.val</field>
                                             </block>
                                           </value>
                                           <value name="B">
                                             <block type="logic_compare" id="ijW/j,|HDfvUTG@#hT7k">
                                               <field name="OP">NEQ</field>
                                               <value name="A">
                                                 <block type="on_source" id="M;6Y#A@Fzp/h[7vE{16@">
                                                   <field name="ATTR">state.from</field>
                                                 </block>
                                               </value>
                                               <value name="B">
                                                 <block type="text" id="c1X?E)xX:_KW_HkUc9Yf">
                                                   <field name="TEXT">system.adapter.javascript.0</field>
                                                 </block>
                                               </value>
                                             </block>
                                           </value>
                                         </block>
                                       </value>
                                     </block>
                                   </statement>
                                 </block>
                               </next>
                             </block>
                           </next>
                         </block>
                       </next>
                     </block>
                    </xml>
                    

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

                      @robbi12 sagte: hier im Forum als Blockly anzeigen kann

                      "Bild hoch laden": Dritter Button von rechts.

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

                        @paul53 Danke für deine Mühe. Ich bin blutiger Anfänger. Wie bekomm ich ein Bild vom Blockly gemacht? Da bekomme ich von mir nicht alles rauf.Unbenannt.JPG

                        R paul53 2 Replies Last reply Reply Quote 0
                        • R
                          Robbi12 @Robbi12 last edited by

                          @robbi12 Da fehlt noch etliches. Bin noch überfragt mit den Werten

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

                            @robbi12
                            So schaltet der BWM das Licht nur ein und nicht wieder aus.

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

                              @paul53 Momentan schaltet er nicht einmal ein

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

                                @robbi12 sagte: Momentan schaltet er nicht einmal ein

                                Poste mal den erzeugten Javascript-Code ohne die letzte Zeile in Code tags. </>

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

                                  @paul53 ```
                                  var manuell_ein;

                                  // BWM
                                  on({id: 'deconz.0.Sensors.12.presence', change: "ne"}, async function (obj) {
                                  var value = obj.state.val;
                                  var oldValue = obj.oldState.val;
                                  if (!manuell_ein) {
                                  // Schalten per BWM
                                  if (getState("deconz.0.Sensors.12.presence").val == true) {
                                  setState("shelly.0.SHSW-1#E0980696842C#1.Relay0.Switch"/Switch/, true, true);
                                  }
                                  }
                                  });
                                  // Shelly
                                  on({id: 'shelly.0.SHSW-1#E0980696842C#1.Relay0.Switch', change: "ne"}, async function (obj) {
                                  var value = obj.state.val;
                                  var oldValue = obj.oldState.val;
                                  manuell_ein = (obj.state ? obj.state.val : "") && (obj.state ? obj.state.from : "") != 'system.adapter.javascript.0';
                                  });

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

                                    @robbi12 sagte: Momentan schaltet er nicht einmal ein

                                    Nimm den Block "steuere" anstelle von "aktualisiere".

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

                                      @paul53 Ok. Lampe geht nun ein.

                                      Das wären meine Werte:

                                      Unbenannt1.JPG

                                      Unbenannt2.JPG

                                      R paul53 2 Replies Last reply Reply Quote 0
                                      • R
                                        Robbi12 @Robbi12 last edited by

                                        @robbi12 Ich danke dir schon mal für deine Mühe. Schwierig mit mir

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

                                          @robbi12 sagte: Lampe geht nun ein.

                                          Vorschlag mit Ausschaltverzögerung nach "keine Bewegung mehr":

                                          Bild_2021-02-03_220259.png

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

                                            @paul53 Nun schaltet er nicht mehr aus.Unbenannt4.JPG

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            537
                                            Online

                                            31.7k
                                            Users

                                            79.8k
                                            Topics

                                            1.3m
                                            Posts

                                            2
                                            27
                                            959
                                            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