Navigation

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

    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

    Xiaomi Bewegungsmelder am iobroker

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

      @ilovegym

      kannst du da dein Blockly als Beispiel hier mal posten, habe das selbe Problem wie @Andreas-S und noch ein weiteres , bei mir schaltet er nach gewünschten 3 minuten ab und dann gleich weider ein!

      NachtlichtVZ.PNG

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

        @MyzerAT klar doch, hier ein ganz einfaches aus meinem Büro, komm ich rein, gehen die Bildschirme und bei geringer Helligkeit die Schreibtischlampe an, bewege ich mich mehr als 180sec nicht, bin ich tot oder eingeschlafen, dann macht er alles aus 🙂
        Hier das Blockly
        Screenshot_2019-02-21 javascript - ioBroker.png

        und hier zum importieren:

        <xml xmlns="http://www.w3.org/1999/xhtml">
          <block type="comment" id="Y(JOH4q[?wZs[(OQuAZF" x="213" y="88">
            <field name="COMMENT">Trigger auf is motion</field>
            <next>
              <block type="on_ext" id="$:]?ve9i5Skj]hvm;UYG">
                <mutation items="1"></mutation>
                <field name="CONDITION">ne</field>
                <field name="ACK_CONDITION"></field>
                <value name="OID0">
                  <shadow type="field_oid" id="j2Kb}*4?k_J%i7^5=MD$">
                    <field name="oid">mihome.0.devices.sensor_motion_aq2_158d0002b728d7.state</field>
                  </shadow>
                </value>
                <statement name="STATEMENT">
                  <block type="comment" id="/()v1F7s46GgNhGq{rex">
                    <field name="COMMENT">Bildschirm bei Bewegung an</field>
                    <next>
                      <block type="control" id="tYLLGy#77WuwMYa9E%ms">
                        <mutation delay_input="false"></mutation>
                        <field name="OID">sonoff.0.TFT_Buero.POWER</field>
                        <field name="WITH_DELAY">FALSE</field>
                        <value name="VALUE">
                          <block type="logic_boolean" id="_NH3#w_Tevarm~fz)kVh">
                            <field name="BOOL">TRUE</field>
                          </block>
                        </value>
                        <next>
                          <block type="comment" id="ra*km[l-3D;Fw@cfif(B">
                            <field name="COMMENT">falls Helligkeit &lt;80 Schreibtischlampe an</field>
                            <next>
                              <block type="controls_if" id="2@uZcs%8W]6/4x;3a9M%">
                                <value name="IF0">
                                  <block type="logic_compare" id="Ee5BzTBT-S}Z[ldyOBd;">
                                    <field name="OP">LT</field>
                                    <value name="A">
                                      <block type="get_value" id="P8H-40ThX%IClma6N3sc">
                                        <field name="ATTR">val</field>
                                        <field name="OID">mihome.0.devices.sensor_motion_aq2_158d0002b728d7.lux</field>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="math_number" id="0X0ziLixU|bn1CYdV5G]">
                                        <field name="NUM">80</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <statement name="DO0">
                                  <block type="control" id="pDf-^bwIm@7$:o!pJann">
                                    <mutation delay_input="false"></mutation>
                                    <field name="OID">wifilight.0.192_168_178_124.on</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <block type="logic_boolean" id="]+EQoqXf[n#/:A2z/Vz|">
                                        <field name="BOOL">TRUE</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </statement>
                <next>
                  <block type="on_ext" id="E9Ydu:Os;6g41!TZN7rr">
                    <mutation items="1"></mutation>
                    <field name="CONDITION">ne</field>
                    <field name="ACK_CONDITION"></field>
                    <value name="OID0">
                      <shadow type="field_oid" id="PJ%Mv;@a/i-~G0Fo.2qz">
                        <field name="oid">mihome.0.devices.sensor_motion_aq2_158d0002b728d7.no_motion</field>
                      </shadow>
                    </value>
                    <statement name="STATEMENT">
                      <block type="comment" id="jshRR=]%UmXl%vb^DTd;">
                        <field name="COMMENT">länger als 180sec. keine Bewegung, dann alles aus</field>
                        <next>
                          <block type="controls_if" id="VKM.Yu$@y60V4Com,AmS">
                            <value name="IF0">
                              <block type="logic_compare" id="gmuz.ihI-xX$8|-IL.kZ">
                                <field name="OP">GTE</field>
                                <value name="A">
                                  <block type="get_value" id="I{WVmUAg}(Vg{CuH`o7n">
                                    <field name="ATTR">val</field>
                                    <field name="OID">mihome.0.devices.sensor_motion_aq2_158d0002b728d7.no_motion</field>
                                  </block>
                                </value>
                                <value name="B">
                                  <block type="math_number" id="=6f~{C~v1!a|q;v~vqF6">
                                    <field name="NUM">180</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <statement name="DO0">
                              <block type="control" id="v|.nM()!PP)]fQ9*LihT">
                                <mutation delay_input="false"></mutation>
                                <field name="OID">sonoff.0.TFT_Buero.POWER</field>
                                <field name="WITH_DELAY">FALSE</field>
                                <value name="VALUE">
                                  <block type="logic_boolean" id="hv,l$1Yhi+;1=|Us2;/G">
                                    <field name="BOOL">FALSE</field>
                                  </block>
                                </value>
                                <next>
                                  <block type="control" id="UY9J^$S-aGo9l#zy)*r]">
                                    <mutation delay_input="false"></mutation>
                                    <field name="OID">wifilight.0.192_168_178_124.on</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <block type="logic_boolean" id="fG0@EolmEtS3~L7U%NXM">
                                        <field name="BOOL">FALSE</field>
                                      </block>
                                    </value>
                                  </block>
                                </next>
                              </block>
                            </statement>
                          </block>
                        </next>
                      </block>
                    </statement>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </xml>
        
        <xml xmlns="http://www.w3.org/1999/xhtml">
          <block type="comment" id="Y(JOH4q[?wZs[(OQuAZF" x="213" y="88">
            <field name="COMMENT">Trigger auf is motion</field>
            <next>
              <block type="on_ext" id="$:]?ve9i5Skj]hvm;UYG">
                <mutation items="1"></mutation>
                <field name="CONDITION">ne</field>
                <field name="ACK_CONDITION"></field>
                <value name="OID0">
                  <shadow type="field_oid" id="j2Kb}*4?k_J%i7^5=MD$">
                    <field name="oid">mihome.0.devices.sensor_motion_aq2_158d0002b728d7.state</field>
                  </shadow>
                </value>
                <statement name="STATEMENT">
                  <block type="comment" id="/()v1F7s46GgNhGq{rex">
                    <field name="COMMENT">Bildschirm bei Bewegung an</field>
                    <next>
                      <block type="control" id="tYLLGy#77WuwMYa9E%ms">
                        <mutation delay_input="false"></mutation>
                        <field name="OID">sonoff.0.TFT_Buero.POWER</field>
                        <field name="WITH_DELAY">FALSE</field>
                        <value name="VALUE">
                          <block type="logic_boolean" id="_NH3#w_Tevarm~fz)kVh">
                            <field name="BOOL">TRUE</field>
                          </block>
                        </value>
                        <next>
                          <block type="comment" id="ra*km[l-3D;Fw@cfif(B">
                            <field name="COMMENT">falls Helligkeit &lt;80 Schreibtischlampe an</field>
                            <next>
                              <block type="controls_if" id="2@uZcs%8W]6/4x;3a9M%">
                                <value name="IF0">
                                  <block type="logic_compare" id="Ee5BzTBT-S}Z[ldyOBd;">
                                    <field name="OP">LT</field>
                                    <value name="A">
                                      <block type="get_value" id="P8H-40ThX%IClma6N3sc">
                                        <field name="ATTR">val</field>
                                        <field name="OID">mihome.0.devices.sensor_motion_aq2_158d0002b728d7.lux</field>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="math_number" id="0X0ziLixU|bn1CYdV5G]">
                                        <field name="NUM">80</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <statement name="DO0">
                                  <block type="control" id="pDf-^bwIm@7$:o!pJann">
                                    <mutation delay_input="false"></mutation>
                                    <field name="OID">wifilight.0.192_168_178_124.on</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <block type="logic_boolean" id="]+EQoqXf[n#/:A2z/Vz|">
                                        <field name="BOOL">TRUE</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </statement>
                <next>
                  <block type="on_ext" id="E9Ydu:Os;6g41!TZN7rr">
                    <mutation items="1"></mutation>
                    <field name="CONDITION">ne</field>
                    <field name="ACK_CONDITION"></field>
                    <value name="OID0">
                      <shadow type="field_oid" id="PJ%Mv;@a/i-~G0Fo.2qz">
                        <field name="oid">mihome.0.devices.sensor_motion_aq2_158d0002b728d7.no_motion</field>
                      </shadow>
                    </value>
                    <statement name="STATEMENT">
                      <block type="comment" id="jshRR=]%UmXl%vb^DTd;">
                        <field name="COMMENT">länger als 180sec. keine Bewegung, dann alles aus</field>
                        <next>
                          <block type="controls_if" id="VKM.Yu$@y60V4Com,AmS">
                            <value name="IF0">
                              <block type="logic_compare" id="gmuz.ihI-xX$8|-IL.kZ">
                                <field name="OP">GTE</field>
                                <value name="A">
                                  <block type="get_value" id="I{WVmUAg}(Vg{CuH`o7n">
                                    <field name="ATTR">val</field>
                                    <field name="OID">mihome.0.devices.sensor_motion_aq2_158d0002b728d7.no_motion</field>
                                  </block>
                                </value>
                                <value name="B">
                                  <block type="math_number" id="=6f~{C~v1!a|q;v~vqF6">
                                    <field name="NUM">180</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <statement name="DO0">
                              <block type="control" id="v|.nM()!PP)]fQ9*LihT">
                                <mutation delay_input="false"></mutation>
                                <field name="OID">sonoff.0.TFT_Buero.POWER</field>
                                <field name="WITH_DELAY">FALSE</field>
                                <value name="VALUE">
                                  <block type="logic_boolean" id="hv,l$1Yhi+;1=|Us2;/G">
                                    <field name="BOOL">FALSE</field>
                                  </block>
                                </value>
                                <next>
                                  <block type="control" id="UY9J^$S-aGo9l#zy)*r]">
                                    <mutation delay_input="false"></mutation>
                                    <field name="OID">wifilight.0.192_168_178_124.on</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <block type="logic_boolean" id="fG0@EolmEtS3~L7U%NXM">
                                        <field name="BOOL">FALSE</field>
                                      </block>
                                    </value>
                                  </block>
                                </next>
                              </block>
                            </statement>
                          </block>
                        </next>
                      </block>
                    </statement>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </xml>
        
        1 Reply Last reply Reply Quote 0
        • MyzerAT
          MyzerAT last edited by MyzerAT

          ah jetzt versteh ich, super idee!

          was ist "steuere on mit wahr" ?

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

            @MyzerAT ich hab auch noch kompliziertere mit mehreren Bewegungsmeldern, aber da verknüpfe ich einfach nur zum Ausschalten den "last motion" Wert mit UND - so dass das Licht erst ausgeht, wenn beide keine Bewegung mehr erkannt haben.

            1 Reply Last reply Reply Quote 0
            • MyzerAT
              MyzerAT last edited by

              habs jetzt so, bin ech gespannt ! THX

              NachtlichtVZ.PNG

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

                @MyzerAT sieht schonmal gut aus, ich würde für das Ausschalten n extra trigger machen, wenn du um 23.59 bewegst, dann schaltet er nach 24 Uhr ( gibts überhaupt 24 Uhr? sollte doch 00.00 heissen?) nicht mehr aus...

                1 Reply Last reply Reply Quote 0
                • MyzerAT
                  MyzerAT last edited by

                  es gibt danach eh noch ein script

                  NachtlichtVZ.PNG

                  1 Reply Last reply Reply Quote 0
                  • A
                    Andreas.S last edited by

                    Hallo,
                    Vielen Dank für die Tipps. Ich habe nun den Tipp von ilovegym mit dem Zähler von last motion getestet. Da dieser Wert alle 10 Sekunden hochzählt habe ich nicht "wurde geändert" sondern "ist kleiner als letztes" genutzt.
                    Im Ergebnis sieht es leider genauso aus.
                    Es wird wieder sofort geschalten. Im iobroker bleibt der Wert des last motion im Objekt allerdings nach dem Abschalten noch einige Zeit auf 0 Sekunden. Erst nach ca. 60 Sekunden werden die Werte im Objekt wieder aktualisiert. Dann greift auch wieder das Skript.
                    Ich vermute, dass es aufgrund der Einschränkung, die ilovegym beschrieben hat nicht besser geht. Ich werde noch ein wenig testen, ob ich herausfinde welche Zeit das optimale Minimum ist.

                    Viele Grüße an euch.
                    Motion_Sensor_Script2.png

                    1 Reply Last reply Reply Quote 0
                    • MyzerAT
                      MyzerAT last edited by

                      @Andreas-S sagte in Xiaomi Bewegungsmelder am iobroker:

                      Da dieser Wert alle 10 Sekunden hochzählt

                      ja bei mir macht er 60, 120, 180 usw. bei LastMotion, also alle 60 Sekunden trägt er den Wert 60+ ein wenn sich nichts mehr bewegt! Denke das reicht auch, ein Licht kann ruhig 1 Minute leuchten, bei den heutigen LED Lampen ist das Stromverbrauchstechnisch echt zu vernachlässigen!

                      Ich habe mein Script jetzt so angepasst und es funktioniert Super!

                      NachtlichtVZ.PNG

                      1 Reply Last reply Reply Quote 0
                      • Z
                        ZeroQool last edited by

                        Habe die gleiche Problematik und bin mit der Lösung nicht so ganz zufrieden. Was mich wundert, wenn man über die MI APP bei einer Bewegung sich eine PushNachricht aufs Handy senden lässt funktioniert das lückenlos. Sprich Bewegung findet statt, ich bekomme eine Pushnachricht. Ist bspw. innerhalb der nächsten 10 Sekunden noch einmal eine Bewegung wird wieder eine Pushnachricht versendet. Schade, dass es im ioBroker nicht so ist.

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        572
                        Online

                        31.9k
                        Users

                        80.2k
                        Topics

                        1.3m
                        Posts

                        blockly
                        4
                        12
                        4168
                        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