Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. *gelöst* Bewegungsmelder mit Zeit-, Helligkeit & Sonnenst.

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    *gelöst* Bewegungsmelder mit Zeit-, Helligkeit & Sonnenst.

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

      Moin Zs,

      ich habe einen Bewegungsmelder der eine Lampe steuert. Das läuft auch super (Blockly aus einem alten Beitrag von @Dutchman). Nun beschwert die holde Weiblichkeit sich, dass das Licht Nachts zu hell ist.

      ich bekomme es einfach nicht hin, das die Lampe tagsüber (zwischen Sonnenauf- und Untergang) mit der vollen Helligkeit und Nachts bzw nach Untergang mit reduzierter Helligkeit leuchtet.

      Mein Problem dabei ist die verknüpfung der 3 Trigger Bewegung, Helligkeit und Astrozeit da die Lampe und der BW im Keller hängen und dort je nach Sonnenstand mal mehr mal weniger Helligkeit vorhanden ist.

      Hier das Blockly mit den Bausteinen für die Zeitsteuerung:

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable type="timeout" id="timeout3">timeout3</variable>
        </variables>
        <block type="logic_operation" id="!7(jyCXxm=d*#Xm$YXfI" x="-413" y="-538">
          <field name="OP">AND</field>
          <value name="A">
            <block type="logic_compare" id="wUpB$GeR%P0Awh^qCZON">
              <field name="OP">EQ</field>
              <value name="A">
                <block type="get_value" id="-xvj+zC#9{jg^yO=$EHu">
                  <field name="ATTR">val</field>
                  <field name="OID">deconz.0.Sensors.50.presence</field>
                </block>
              </value>
              <value name="B">
                <block type="logic_boolean" id="0Fye/GFeJN%R[Wbn)epd">
                  <field name="BOOL">TRUE</field>
                </block>
              </value>
            </block>
          </value>
          <value name="B">
            <block type="time_compare_ex" id="XEq7TvYW{inW2^byu5M;">
              <mutation xmlns="http://www.w3.org/1999/xhtml" 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="1p](cjr14Vb[c;E,tYaL">
                  <field name="TEXT">06:01</field>
                </shadow>
                <block type="time_astro" id="IDE+*A3ShrU,2j`)}%)Y">
                  <field name="TYPE">sunrise</field>
                  <field name="OFFSET">0</field>
                </block>
              </value>
              <value name="END_TIME">
                <shadow type="text" id=".LBzC),]s0E#r)9kgG9!">
                  <field name="TEXT">17:59</field>
                </shadow>
                <block type="time_astro" id="?03^TSUwC:Gg]xa`?,S.">
                  <field name="TYPE">sunset</field>
                  <field name="OFFSET">0</field>
                </block>
              </value>
            </block>
          </value>
        </block>
        <block type="logic_operation" id="U/EwZEy|Pvr6bS,FwFMt" x="-412" y="-488">
          <field name="OP">AND</field>
          <value name="A">
            <block type="logic_compare" id="MzmVRpO}C95Ik1~D1n~b">
              <field name="OP">EQ</field>
              <value name="A">
                <block type="get_value" id="(,wk,b5a*Gvi;{#6)RIB">
                  <field name="ATTR">val</field>
                  <field name="OID">deconz.0.Sensors.50.presence</field>
                </block>
              </value>
              <value name="B">
                <block type="logic_boolean" id="-BgG;NIdl9x7M^ITL]Rb">
                  <field name="BOOL">TRUE</field>
                </block>
              </value>
            </block>
          </value>
          <value name="B">
            <block type="time_compare_ex" id="yqt-w`S@x+WoJB[Q_Z_:">
              <mutation xmlns="http://www.w3.org/1999/xhtml" end_time="true" actual_time="true"></mutation>
              <field name="USE_ACTUAL_TIME">TRUE</field>
              <field name="OPTION">not between</field>
              <value name="START_TIME">
                <shadow type="text" id="9Zh*(=6w-K7(qlo]F-c{">
                  <field name="TEXT">12:00</field>
                </shadow>
                <block type="time_astro" id="0LVR=+./Mi/-QeZk4rIL">
                  <field name="TYPE">sunset</field>
                  <field name="OFFSET">0</field>
                </block>
              </value>
              <value name="END_TIME">
                <shadow type="text" id="G?w6ySk`nGeM~tRW:V;j">
                  <field name="TEXT">18:00</field>
                </shadow>
                <block type="time_astro" id="IeU%1J7V{jq9#@A0Al=0">
                  <field name="TYPE">sunrise</field>
                  <field name="OFFSET">0</field>
                </block>
              </value>
            </block>
          </value>
        </block>
        <block type="control" id="@C}o.TqNI7{NY06h}MyI" x="-413" y="-412">
          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
          <field name="OID">hue.0.Flurlampe.command</field>
          <field name="WITH_DELAY">FALSE</field>
          <value name="VALUE">
            <block type="text" id="fru;a|WW;npEI,`.ix[^">
              <field name="TEXT">{"level":10,"r":255,"g":255,"b":255}</field>
            </block>
          </value>
        </block>
        <block type="on_ext" id="YM.#/9w.1y~Z9?XJhnN5" x="-463" y="-337">
          <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="%jTnyCDn%PgYB{8*.0lt">
              <field name="oid">deconz.0.Sensors.50.presence</field>
            </shadow>
          </value>
          <statement name="STATEMENT">
            <block type="controls_if" id="f`]_ZnrJPO+/s2gj8/sr">
              <mutation elseif="1"></mutation>
              <value name="IF0">
                <block type="logic_operation" id="Yy~I1gw@#1s|eb*^QU]s" inline="false">
                  <field name="OP">AND</field>
                  <value name="A">
                    <block type="logic_compare" id="r[c7):%ov;xLJI)7=6ST">
                      <field name="OP">EQ</field>
                      <comment pinned="false" h="53" w="139">Hier nog den wert Bewegung rein</comment>
                      <value name="A">
                        <block type="get_value" id="7;7#~]XTS%8e^(x8/wZS">
                          <field name="ATTR">val</field>
                          <field name="OID">deconz.0.Sensors.50.presence</field>
                        </block>
                      </value>
                      <value name="B">
                        <block type="logic_boolean" id="`]V~(Hc7DDwYjOh=4tq=">
                          <field name="BOOL">TRUE</field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <value name="B">
                    <block type="logic_compare" id="%YGQ;ENgMFDy/{+4))4`">
                      <field name="OP">LT</field>
                      <value name="A">
                        <block type="get_value" id="wIdF:8b9kA*~F/qff=5Z">
                          <field name="ATTR">val</field>
                          <field name="OID">0_userdata.0.Shelly_Motion.Flur.Helligkeit</field>
                        </block>
                      </value>
                      <value name="B">
                        <block type="math_number" id="r@hhmCSZfyq;E~yWe[7[">
                          <field name="NUM">120</field>
                        </block>
                      </value>
                    </block>
                  </value>
                </block>
              </value>
              <statement name="DO0">
                <block type="timeouts_cleartimeout" id="7rw,zduV-62(pcZLAR4;">
                  <field name="NAME">timeout3</field>
                  <next>
                    <block type="control" id="SoSfgq}EUBT)jjq6yp_P">
                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                      <field name="OID">hue.0.Flurlampe.command</field>
                      <field name="WITH_DELAY">FALSE</field>
                      <value name="VALUE">
                        <block type="text" id="eo}9-n?!/.NI4%.|b6a^">
                          <field name="TEXT">{"level":100,"r":255,"g":255,"b":255}</field>
                        </block>
                      </value>
                      <next>
                        <block type="telegram" id="nz:m?9M:5{Ae#O.7xCt0">
                          <field name="INSTANCE"></field>
                          <field name="LOG"></field>
                          <field name="SILENT">FALSE</field>
                          <field name="PARSEMODE">default</field>
                          <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field>
                          <value name="MESSAGE">
                            <shadow type="text" id="l7ocSs3*W?V)l/EdBQ.!">
                              <field name="TEXT">Bewegung erkannt</field>
                            </shadow>
                          </value>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </statement>
              <value name="IF1">
                <block type="logic_compare" id="!h_WGeZ,Z/E._Rij{Sv}">
                  <field name="OP">EQ</field>
                  <comment pinned="true" h="45" w="156">Hier nog den wert Bewegung rein</comment>
                  <value name="A">
                    <block type="get_value" id="dDCwv{=hri4$v1fFv-{n">
                      <field name="ATTR">val</field>
                      <field name="OID">deconz.0.Sensors.50.presence</field>
                    </block>
                  </value>
                  <value name="B">
                    <block type="logic_boolean" id="(^/@91AbU*Q[Lm;I(sQ1">
                      <field name="BOOL">FALSE</field>
                    </block>
                  </value>
                </block>
              </value>
              <statement name="DO1">
                <block type="timeouts_cleartimeout" id="48kyiz7c9o!iu:6.^{Vw">
                  <field name="NAME">timeout3</field>
                  <next>
                    <block type="timeouts_settimeout" id="EWUG;n=f.[20rin0,hE9">
                      <field name="NAME">timeout3</field>
                      <field name="DELAY">4</field>
                      <field name="UNIT">min</field>
                      <statement name="STATEMENT">
                        <block type="control" id="0HYE3_4n37UW,~$P0nMM">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                          <field name="OID">hue.0.Flurlampe.on</field>
                          <field name="WITH_DELAY">FALSE</field>
                          <value name="VALUE">
                            <block type="logic_boolean" id="Z`%+G6%8}mo(Oz+5Q|0R">
                              <field name="BOOL">FALSE</field>
                            </block>
                          </value>
                        </block>
                      </statement>
                    </block>
                  </next>
                </block>
              </statement>
            </block>
          </statement>
        </block>
      </xml>
      

      Danke schon mal für die Hilfe!

      Homoran paul53 2 Replies Last reply Reply Quote 0
      • Homoran
        Homoran Global Moderator Administrators @SoerenKaiser99 last edited by

        @soerenkaiser99 sagte in Bewegungsmelder mit zeitabhängiger Steuerung:

        Hier das Blockly mit den Bausteinen für die Zeitsteuerung:

        ich kann keine Bausteine sehen

        S 1 Reply Last reply Reply Quote 0
        • S
          SoerenKaiser99 @Homoran last edited by

          @homoran

          die habe ich lose über dem Trigger angeordnet:

          Wert von BW = wahr UND aktuelle Zeit zwischen bzw. nicht zwischen Sonnenauf- und Untergang

          Homoran 1 Reply Last reply Reply Quote 0
          • Homoran
            Homoran Global Moderator Administrators @SoerenKaiser99 last edited by

            @soerenkaiser99 sagte in Bewegungsmelder mit zeitabhängiger Steuerung:

            die habe ich lose über dem Trigger angeordnet:

            ich würde dir gerne helfen, aber dazu müsste ich das Blockly sehen.
            bitte einen lesbaren Screenshot davon posten

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

              @soerenkaiser99 sagte: tagsüber (zwischen Sonnenauf- und Untergang) mit der vollen Helligkeit und Nachts bzw nach Untergang mit reduzierter Helligkeit leuchtet.

              Vorschlag:

              Blockly_temp.JPG

              <xml xmlns="https://developers.google.com/blockly/xml">
               <variables>
                 <variable type="timeout" id="timeout3">timeout3</variable>
                 <variable id="lMT8,0TJUvHQ(},54bIq">command</variable>
               </variables>
               <block type="on_ext" id="YM.#/9w.1y~Z9?XJhnN5" x="-463" y="-337">
                 <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="%jTnyCDn%PgYB{8*.0lt">
                     <field name="oid">deconz.0.Sensors.50.presence</field>
                   </shadow>
                 </value>
                 <statement name="STATEMENT">
                   <block type="controls_if" id="f`]_ZnrJPO+/s2gj8/sr">
                     <mutation elseif="1"></mutation>
                     <value name="IF0">
                       <block type="on_source" id="Bxr+,8FByy)W+w)BG.vH">
                         <field name="ATTR">state.val</field>
                       </block>
                     </value>
                     <statement name="DO0">
                       <block type="timeouts_cleartimeout" id="7rw,zduV-62(pcZLAR4;">
                         <field name="NAME">timeout3</field>
                         <next>
                           <block type="debug" id=";KaWLpuz@QsRHkhAKNwI">
                             <field name="Severity">log</field>
                             <value name="TEXT">
                               <shadow type="text" id="*ZYp.dd%)!q?pi_d=@i/">
                                 <field name="TEXT">Bewegung erkannt</field>
                               </shadow>
                             </value>
                             <next>
                               <block type="controls_if" id=")eL:y,XqGN^O:^kyGg|D">
                                 <value name="IF0">
                                   <block type="logic_compare" id="%YGQ;ENgMFDy/{+4))4`">
                                     <field name="OP">LT</field>
                                     <value name="A">
                                       <block type="get_value" id="wIdF:8b9kA*~F/qff=5Z">
                                         <field name="ATTR">val</field>
                                         <field name="OID">0_userdata.0.Shelly_Motion.Flur.Helligkeit</field>
                                       </block>
                                     </value>
                                     <value name="B">
                                       <block type="math_number" id="r@hhmCSZfyq;E~yWe[7[">
                                         <field name="NUM">120</field>
                                       </block>
                                     </value>
                                   </block>
                                 </value>
                                 <statement name="DO0">
                                   <block type="controls_if" id="$mlhg[wAFX!]U:Mr3MB/">
                                     <mutation else="1"></mutation>
                                     <value name="IF0">
                                       <block type="time_compare_ex" id="XEq7TvYW{inW2^byu5M;">
                                         <mutation xmlns="http://www.w3.org/1999/xhtml" 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="1p](cjr14Vb[c;E,tYaL">
                                             <field name="TEXT">06:01</field>
                                           </shadow>
                                           <block type="time_astro" id="IDE+*A3ShrU,2j`)}%)Y">
                                             <field name="TYPE">sunrise</field>
                                             <field name="OFFSET">0</field>
                                           </block>
                                         </value>
                                         <value name="END_TIME">
                                           <shadow type="text" id=".LBzC),]s0E#r)9kgG9!">
                                             <field name="TEXT">17:59</field>
                                           </shadow>
                                           <block type="time_astro" id="?03^TSUwC:Gg]xa`?,S.">
                                             <field name="TYPE">sunset</field>
                                             <field name="OFFSET">0</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                     <statement name="DO0">
                                       <block type="variables_set" id="9^;a|/Ed,9u*Z:7eUHq.">
                                         <field name="VAR" id="lMT8,0TJUvHQ(},54bIq">command</field>
                                         <value name="VALUE">
                                           <block type="text" id="eo}9-n?!/.NI4%.|b6a^">
                                             <field name="TEXT">{"level":100,"r":255,"g":255,"b":255}</field>
                                           </block>
                                         </value>
                                       </block>
                                     </statement>
                                     <statement name="ELSE">
                                       <block type="variables_set" id="GtHiqe2NV=Zx_5)|c3V%">
                                         <field name="VAR" id="lMT8,0TJUvHQ(},54bIq">command</field>
                                         <value name="VALUE">
                                           <block type="text" id="fru;a|WW;npEI,`.ix[^">
                                             <field name="TEXT">{"level":10,"r":255,"g":255,"b":255}</field>
                                           </block>
                                         </value>
                                       </block>
                                     </statement>
                                     <next>
                                       <block type="control" id="SoSfgq}EUBT)jjq6yp_P">
                                         <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                         <field name="OID">hue.0.Flurlampe.command</field>
                                         <field name="WITH_DELAY">FALSE</field>
                                         <value name="VALUE">
                                           <block type="variables_get" id="8)@2V~Y.)7N9;|66F)1a">
                                             <field name="VAR" id="lMT8,0TJUvHQ(},54bIq">command</field>
                                           </block>
                                         </value>
                                       </block>
                                     </next>
                                   </block>
                                 </statement>
                               </block>
                             </next>
                           </block>
                         </next>
                       </block>
                     </statement>
                     <value name="IF1">
                       <block type="get_value_var" id="N%j`!/^S8HV6ck=iCaYn">
                         <field name="ATTR">val</field>
                         <value name="OID">
                           <shadow type="text" id="[*7Y~=70mv3Gx~OMpdgA">
                             <field name="TEXT">hue.0.Flurlampe.on</field>
                           </shadow>
                         </value>
                       </block>
                     </value>
                     <statement name="DO1">
                       <block type="timeouts_settimeout" id="EWUG;n=f.[20rin0,hE9">
                         <field name="NAME">timeout3</field>
                         <field name="DELAY">4</field>
                         <field name="UNIT">min</field>
                         <statement name="STATEMENT">
                           <block type="control" id="0HYE3_4n37UW,~$P0nMM">
                             <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                             <field name="OID">hue.0.Flurlampe.on</field>
                             <field name="WITH_DELAY">FALSE</field>
                             <value name="VALUE">
                               <block type="logic_boolean" id="Z`%+G6%8}mo(Oz+5Q|0R">
                                 <field name="BOOL">FALSE</field>
                               </block>
                             </value>
                           </block>
                         </statement>
                       </block>
                     </statement>
                   </block>
                 </statement>
               </block>
              </xml>
              


              Wie die Hue-Lampen richtig gesteuert werden, weiß ich nicht, da ich keine besitze.

              S 1 Reply Last reply Reply Quote 1
              • S
                SoerenKaiser99 @paul53 last edited by

                Vielen Dank @paul53 & @Homoran
                nachgebaut habe ich es, tagsüber wird ausgelöst 🙂 ich meld mich nach Sonnenuntergang obs klappt 🙂

                PS: Hues können über den DP command vielfältig gesteuert werden. Die einfachste Variante :{"level":100,"r":255,"g":255,"b":255}
                Level ist die Helligkeit, 100 eben volle Helligkeit, r,g&b die einzelnen Farben, wobei 3x 255 weißes Licht ergibt

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

                  @soerenkaiser99 sagte: Level ist die Helligkeit, ... r,g&b die einzelnen Farben

                  Ich dachte, dass r, g, b die vollständige Information inklusive der Helligkeit enthalten. Liege ich da falsch und "level" wirkt als Multiplikator?

                  1 Reply Last reply Reply Quote 0
                  • S
                    SoerenKaiser99 last edited by SoerenKaiser99

                    @paul53 habs grad getestet.
                    Das Blockly läuft wie es soll.

                    Der Level-Wert scheint jedoch im command-Befehl nicht (mehr) zu funktionieren.

                    Du hast recht, für den gedimmten Baustein verwende ich jetzt {"r":30,"g":30,"b":30}

                    Hier das Blockly wenn es jemand brauchen kann:

                    <xml xmlns="https://developers.google.com/blockly/xml">
                      <variables>
                        <variable type="timeout" id="timeout3">timeout3</variable>
                        <variable id="(pro]CKMoLpSb7/3|n%-">command</variable>
                      </variables>
                      <block type="on_ext" id="YM.#/9w.1y~Z9?XJhnN5" x="-13" y="-263">
                        <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="%jTnyCDn%PgYB{8*.0lt">
                            <field name="oid">deconz.0.Sensors.50.presence</field>
                          </shadow>
                        </value>
                        <statement name="STATEMENT">
                          <block type="controls_if" id="f`]_ZnrJPO+/s2gj8/sr">
                            <mutation elseif="1"></mutation>
                            <value name="IF0">
                              <block type="on_source" id="TF(6%k,*T6r`8DVWoQ*F">
                                <field name="ATTR">state.val</field>
                              </block>
                            </value>
                            <statement name="DO0">
                              <block type="timeouts_cleartimeout" id="7rw,zduV-62(pcZLAR4;">
                                <field name="NAME">timeout3</field>
                                <next>
                                  <block type="controls_if" id="NUrZmo8PtbZ%]ZmM}Ay[">
                                    <value name="IF0">
                                      <block type="logic_compare" id="%YGQ;ENgMFDy/{+4))4`">
                                        <field name="OP">LT</field>
                                        <value name="A">
                                          <block type="get_value" id="wIdF:8b9kA*~F/qff=5Z">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.Shelly_Motion.Flur.Helligkeit</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="r@hhmCSZfyq;E~yWe[7[">
                                            <field name="NUM">120</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <statement name="DO0">
                                      <block type="controls_if" id="h7@ZL~Ds[mUY-swP:E8w">
                                        <mutation else="1"></mutation>
                                        <value name="IF0">
                                          <block type="time_compare_ex" id="IinX78=g^rHF1*}#0X9U">
                                            <mutation xmlns="http://www.w3.org/1999/xhtml" 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="%E$W)O5]gL;7}2[;IKc(">
                                                <field name="TEXT">12:00</field>
                                              </shadow>
                                              <block type="time_astro" id="em/$7v)/9yHe81BHSEzM">
                                                <field name="TYPE">sunrise</field>
                                                <field name="OFFSET">0</field>
                                              </block>
                                            </value>
                                            <value name="END_TIME">
                                              <shadow type="text" id="K$;.Fl*IiM.:6;T?E[kJ">
                                                <field name="TEXT">18:00</field>
                                              </shadow>
                                              <block type="time_astro" id=":feDppezB6nmRmcbbjiO">
                                                <field name="TYPE">sunset</field>
                                                <field name="OFFSET">0</field>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                        <statement name="DO0">
                                          <block type="variables_set" id="k}tCh4hW?u0.4fF2d1Z6">
                                            <field name="VAR" id="(pro]CKMoLpSb7/3|n%-">command</field>
                                            <value name="VALUE">
                                              <block type="text" id="eo}9-n?!/.NI4%.|b6a^">
                                                <field name="TEXT">{"level":100,"r":255,"g":255,"b":255}</field>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="telegram" id="k_:sYnxt!V,WuV2j({id">
                                                <field name="INSTANCE"></field>
                                                <field name="LOG"></field>
                                                <field name="SILENT">FALSE</field>
                                                <field name="PARSEMODE">default</field>
                                                <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field>
                                                <value name="MESSAGE">
                                                  <shadow type="text" id="!3{,OB%E=?6Zo1bbbrQb">
                                                    <field name="TEXT">Bewegung erkannt</field>
                                                  </shadow>
                                                </value>
                                              </block>
                                            </next>
                                          </block>
                                        </statement>
                                        <statement name="ELSE">
                                          <block type="variables_set" id="P7Klh^l%xIse%~hX4ko5">
                                            <field name="VAR" id="(pro]CKMoLpSb7/3|n%-">command</field>
                                            <value name="VALUE">
                                              <block type="text" id="+S+/(x*$3a:m+-H$OV!e">
                                                <field name="TEXT">{"r":30,"g":30,"b":30}</field>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="telegram" id="BgU8(v6~qRa}ekN^#Yge">
                                                <field name="INSTANCE"></field>
                                                <field name="LOG"></field>
                                                <field name="SILENT">FALSE</field>
                                                <field name="PARSEMODE">default</field>
                                                <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field>
                                                <value name="MESSAGE">
                                                  <shadow type="text" id="`9|sdj2.Xk+EdX8mB;DL">
                                                    <field name="TEXT">Bewegung erkannt, Licht wird gedimmt eingeschaltet da es Nacht ist</field>
                                                  </shadow>
                                                </value>
                                              </block>
                                            </next>
                                          </block>
                                        </statement>
                                        <next>
                                          <block type="control" id="SoSfgq}EUBT)jjq6yp_P">
                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                            <field name="OID">hue.0.Flurlampe.command</field>
                                            <field name="WITH_DELAY">FALSE</field>
                                            <value name="VALUE">
                                              <block type="variables_get" id="wBxNw|F7,DVF)lm7f|OW">
                                                <field name="VAR" id="(pro]CKMoLpSb7/3|n%-">command</field>
                                              </block>
                                            </value>
                                          </block>
                                        </next>
                                      </block>
                                    </statement>
                                  </block>
                                </next>
                              </block>
                            </statement>
                            <value name="IF1">
                              <block type="logic_compare" id="!h_WGeZ,Z/E._Rij{Sv}">
                                <field name="OP">EQ</field>
                                <comment pinned="false" h="45" w="156">Hier nog den wert Bewegung rein</comment>
                                <value name="A">
                                  <block type="get_value" id="dDCwv{=hri4$v1fFv-{n">
                                    <field name="ATTR">val</field>
                                    <field name="OID">hue.0.Flurlampe.on</field>
                                  </block>
                                </value>
                                <value name="B">
                                  <block type="logic_boolean" id="(^/@91AbU*Q[Lm;I(sQ1">
                                    <field name="BOOL">TRUE</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <statement name="DO1">
                              <block type="timeouts_settimeout" id="EWUG;n=f.[20rin0,hE9">
                                <field name="NAME">timeout3</field>
                                <field name="DELAY">1</field>
                                <field name="UNIT">min</field>
                                <statement name="STATEMENT">
                                  <block type="control" id="0HYE3_4n37UW,~$P0nMM">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                    <field name="OID">hue.0.Flurlampe.on</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <block type="logic_boolean" id="Z`%+G6%8}mo(Oz+5Q|0R">
                                        <field name="BOOL">FALSE</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                              </block>
                            </statement>
                          </block>
                        </statement>
                      </block>
                    </xml>
                    
                    paul53 1 Reply Last reply Reply Quote 0
                    • paul53
                      paul53 @SoerenKaiser99 last edited by paul53

                      @soerenkaiser99 sagte: Hier das Blockly

                      Ich würde noch etwas optimieren:

                      • "level" ist umsonst, wenn man "r, g, b" sendet
                      • nachts den Blauanteil etwas reduzieren
                      • nur einmal "Sendto telegram" (schont Ressourcen)
                      • ein Vergleich mit wahr ist unnütz

                      Bild_2022-08-10_114809274.png

                      Für weißes Licht würde ich anstelle von "r, g, b" die Kombination von "level" und "ct" verwenden.

                      1 Reply Last reply Reply Quote 0
                      • S
                        SoerenKaiser99 last edited by

                        @paul53
                        vielen Dank! Habs grad geändert 🙂 War leider die letzten Tage ein wenig verhindert.
                        Kannst du mir kurz erklären warum man besser level und ct nehmen sollte?

                        Den rest versteh ich soweit

                        <xml xmlns="https://developers.google.com/blockly/xml">
                          <variables>
                            <variable type="timeout" id="timeout3">timeout3</variable>
                            <variable id="(pro]CKMoLpSb7/3|n%-">command</variable>
                            <variable id="bHQLWEj7b5wzBSJsHcD^">msg</variable>
                          </variables>
                          <block type="on_ext" id="YM.#/9w.1y~Z9?XJhnN5" x="-13" y="-263">
                            <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="%jTnyCDn%PgYB{8*.0lt">
                                <field name="oid">0_userdata.0.Shelly_Motion.Flur.Bewegung</field>
                              </shadow>
                            </value>
                            <statement name="STATEMENT">
                              <block type="controls_if" id="f`]_ZnrJPO+/s2gj8/sr">
                                <mutation elseif="1"></mutation>
                                <value name="IF0">
                                  <block type="on_source" id="TF(6%k,*T6r`8DVWoQ*F">
                                    <field name="ATTR">state.val</field>
                                  </block>
                                </value>
                                <statement name="DO0">
                                  <block type="timeouts_cleartimeout" id="7rw,zduV-62(pcZLAR4;">
                                    <field name="NAME">timeout3</field>
                                    <next>
                                      <block type="controls_if" id="NUrZmo8PtbZ%]ZmM}Ay[">
                                        <value name="IF0">
                                          <block type="logic_compare" id="%YGQ;ENgMFDy/{+4))4`">
                                            <field name="OP">LT</field>
                                            <value name="A">
                                              <block type="get_value" id="wIdF:8b9kA*~F/qff=5Z">
                                                <field name="ATTR">val</field>
                                                <field name="OID">0_userdata.0.Shelly_Motion.Flur.Helligkeit</field>
                                              </block>
                                            </value>
                                            <value name="B">
                                              <block type="math_number" id="r@hhmCSZfyq;E~yWe[7[">
                                                <field name="NUM">120</field>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                        <statement name="DO0">
                                          <block type="controls_if" id="h7@ZL~Ds[mUY-swP:E8w">
                                            <mutation else="1"></mutation>
                                            <value name="IF0">
                                              <block type="time_compare_ex" id="IinX78=g^rHF1*}#0X9U">
                                                <mutation xmlns="http://www.w3.org/1999/xhtml" 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="%E$W)O5]gL;7}2[;IKc(">
                                                    <field name="TEXT">12:00</field>
                                                  </shadow>
                                                  <block type="time_astro" id="em/$7v)/9yHe81BHSEzM">
                                                    <field name="TYPE">sunrise</field>
                                                    <field name="OFFSET">0</field>
                                                  </block>
                                                </value>
                                                <value name="END_TIME">
                                                  <shadow type="text" id="K$;.Fl*IiM.:6;T?E[kJ">
                                                    <field name="TEXT">18:00</field>
                                                  </shadow>
                                                  <block type="time_astro" id=":feDppezB6nmRmcbbjiO">
                                                    <field name="TYPE">sunset</field>
                                                    <field name="OFFSET">0</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                            <statement name="DO0">
                                              <block type="variables_set" id="k}tCh4hW?u0.4fF2d1Z6">
                                                <field name="VAR" id="(pro]CKMoLpSb7/3|n%-">command</field>
                                                <value name="VALUE">
                                                  <block type="text" id="eo}9-n?!/.NI4%.|b6a^">
                                                    <field name="TEXT">{"level":100,"r":255,"g":255,"b":255}</field>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="variables_set" id="JBc7f.IWh|jauHVD8E;d">
                                                    <field name="VAR" id="bHQLWEj7b5wzBSJsHcD^">msg</field>
                                                    <value name="VALUE">
                                                      <block type="text" id="u9WGrWY.`4xThx}d;=K/">
                                                        <field name="TEXT">Bewegung erkannt</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </next>
                                              </block>
                                            </statement>
                                            <statement name="ELSE">
                                              <block type="variables_set" id="P7Klh^l%xIse%~hX4ko5">
                                                <field name="VAR" id="(pro]CKMoLpSb7/3|n%-">command</field>
                                                <value name="VALUE">
                                                  <block type="text" id="+S+/(x*$3a:m+-H$OV!e">
                                                    <field name="TEXT">{"r":30,"g":30,"b":30}</field>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="variables_set" id="6yui|!]/hgW?RpyXm{Qf">
                                                    <field name="VAR" id="bHQLWEj7b5wzBSJsHcD^">msg</field>
                                                    <value name="VALUE">
                                                      <block type="text" id="hxf:u_Ab;3SD79fQwcd!">
                                                        <field name="TEXT">Bewegung erkannt, Licht wird gedimmt eingeschaltet da es Nacht ist</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </next>
                                              </block>
                                            </statement>
                                            <next>
                                              <block type="control" id="SoSfgq}EUBT)jjq6yp_P">
                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                <field name="OID">hue.0.Flurlampe.command</field>
                                                <field name="WITH_DELAY">FALSE</field>
                                                <value name="VALUE">
                                                  <block type="variables_get" id="wBxNw|F7,DVF)lm7f|OW">
                                                    <field name="VAR" id="(pro]CKMoLpSb7/3|n%-">command</field>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="telegram" id="BgU8(v6~qRa}ekN^#Yge">
                                                    <field name="INSTANCE"></field>
                                                    <field name="LOG"></field>
                                                    <field name="SILENT">FALSE</field>
                                                    <field name="PARSEMODE">default</field>
                                                    <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field>
                                                    <value name="MESSAGE">
                                                      <shadow type="text" id="`9|sdj2.Xk+EdX8mB;DL">
                                                        <field name="TEXT">Bewegung erkannt, Licht wird gedimmt eingeschaltet da es Nacht ist</field>
                                                      </shadow>
                                                      <block type="variables_get" id="J%Iii3XJHx[1ZrcOBV99">
                                                        <field name="VAR" id="bHQLWEj7b5wzBSJsHcD^">msg</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </statement>
                                      </block>
                                    </next>
                                  </block>
                                </statement>
                                <value name="IF1">
                                  <block type="logic_compare" id="!h_WGeZ,Z/E._Rij{Sv}">
                                    <field name="OP">EQ</field>
                                    <comment pinned="false" h="45" w="156">Hier nog den wert Bewegung rein</comment>
                                    <value name="A">
                                      <block type="get_value" id="dDCwv{=hri4$v1fFv-{n">
                                        <field name="ATTR">val</field>
                                        <field name="OID">hue.0.Flurlampe.on</field>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="logic_boolean" id="(^/@91AbU*Q[Lm;I(sQ1">
                                        <field name="BOOL">TRUE</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <statement name="DO1">
                                  <block type="timeouts_settimeout" id="EWUG;n=f.[20rin0,hE9">
                                    <field name="NAME">timeout3</field>
                                    <field name="DELAY">1</field>
                                    <field name="UNIT">min</field>
                                    <statement name="STATEMENT">
                                      <block type="control" id="0HYE3_4n37UW,~$P0nMM">
                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                        <field name="OID">hue.0.Flurlampe.on</field>
                                        <field name="WITH_DELAY">FALSE</field>
                                        <value name="VALUE">
                                          <block type="logic_boolean" id="Z`%+G6%8}mo(Oz+5Q|0R">
                                            <field name="BOOL">FALSE</field>
                                          </block>
                                        </value>
                                      </block>
                                    </statement>
                                  </block>
                                </statement>
                              </block>
                            </statement>
                          </block>
                        </xml>
                        
                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        806
                        Online

                        32.0k
                        Users

                        80.5k
                        Topics

                        1.3m
                        Posts

                        blockly scenes
                        3
                        10
                        579
                        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