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) Rolladensteuerung mit Einschränkung

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    (#gelöst) Rolladensteuerung mit Einschränkung

    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mueller-esch last edited by mueller-esch

      Hallo Leute, ich benötige mal wieder eure Expertise. Ich drehe mich gerade mit einem Blöckly im Kreis.
      Folgendes Projekt: Ich steuere einen Shelly 2.5 Adapter zum Öffnen und schließen eines Terrassentür-Rollladen. Das funktioniert auch soweit. Nur möchte ich, dass dieser Rollladen nicht runterfährt, wenn die Türe offen ist, damit ich mich nicht aussperre, wenn ch auf der Terrasse bin. Das Blockly (ist schon die vierte Variante, die nicht funktioniert) sieht so aus:
      Terrassentuer.png
      das entsprechende Script lautet:

      
      BlocklyJavascriptTypeScriptRules
      Protokoll
      Ausgewählte Blöcke exportieren
      <xml xmlns="https://developers.google.com/blockly/xml">
        <block type="comment" id="~=K~@VWYen;^|zr`[!XD" x="-162" y="-612">
          <field name="COMMENT">1,5 Std. nach Sonnenuntergang Rollladen schließen</field>
          <next>
            <block type="astro" id="WNo!5b}:)]MBft9bAL{)">
              <field name="TYPE">sunset</field>
              <field name="OFFSET">90</field>
              <statement name="STATEMENT">
                <block type="controls_if" id="M#zR5(I4v:Z2=Ft+*_F,">
                  <mutation else="1"></mutation>
                  <value name="IF0">
                    <block type="logic_compare" id="@b%Y+DsSL}:_;Gc]+Z^^">
                      <field name="OP">EQ</field>
                      <value name="A">
                        <block type="get_value" id="pe65tl_lrg592an`w-zx">
                          <field name="ATTR">val</field>
                          <field name="OID">deconz.0.Sensors.15.open</field>
                        </block>
                      </value>
                      <value name="B">
                        <block type="logic_boolean" id="O/{+,4WQcE)!mbr^KO45">
                          <field name="BOOL">FALSE</field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <statement name="DO0">
                    <block type="control" id="khi/zPBYQmJeV9,i=7*`">
                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
                      <field name="OID">shelly.1.SHSW-25#3C6105E53BCD#1.Shutter.Close</field>
                      <field name="WITH_DELAY">TRUE</field>
                      <field name="DELAY_MS">2</field>
                      <field name="UNIT">min</field>
                      <field name="CLEAR_RUNNING">FALSE</field>
                      <value name="VALUE">
                        <block type="logic_boolean" id="mBCAzb!juX/9zWU|yl.x">
                          <field name="BOOL">TRUE</field>
                        </block>
                      </value>
                      <next>
                        <block type="update" id="=aiMhyza*4DTy-!OwS9}">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                          <field name="OID">0_userdata.0.Datenpunkte.MessVariable.RollladenTerrasseIst</field>
                          <field name="WITH_DELAY">FALSE</field>
                          <value name="VALUE">
                            <block type="text" id="i+NQqfW~CfFz`dKFJ:c!">
                              <field name="TEXT">geschlossen</field>
                            </block>
                          </value>
                        </block>
                      </next>
                    </block>
                  </statement>
                  <statement name="ELSE">
                    <block type="control" id="~4B0we/=ZiAx@NBn_CJG">
                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                      <field name="OID">shelly.1.SHSW-25#3C6105E53BCD#1.Shutter.Pause</field>
                      <field name="WITH_DELAY">FALSE</field>
                      <value name="VALUE">
                        <block type="logic_boolean" id="?T@e:|aE-UyWEb=_xTK[">
                          <field name="BOOL">TRUE</field>
                        </block>
                      </value>
                    </block>
                  </statement>
                </block>
              </statement>
              <next>
                <block type="comment" id="FeG^rZp?q`x7^HwIv]`5">
                  <field name="COMMENT">30 Min.nach Sonnenaufgang Rollladen öffnen</field>
                  <next>
                    <block type="astro" id="/6pws5mtVQ3*ss#lf1ZK">
                      <field name="TYPE">sunrise</field>
                      <field name="OFFSET">30</field>
                      <statement name="STATEMENT">
                        <block type="control" id="Upr5%nUi|J]_k$2:QeSk">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
                          <field name="OID">shelly.1.SHSW-25#3C6105E53BCD#1.Shutter.Open</field>
                          <field name="WITH_DELAY">TRUE</field>
                          <field name="DELAY_MS">2</field>
                          <field name="UNIT">min</field>
                          <field name="CLEAR_RUNNING">FALSE</field>
                          <value name="VALUE">
                            <block type="logic_boolean" id="[+t3`{82XPa%w3R%N:b-">
                              <field name="BOOL">TRUE</field>
                            </block>
                          </value>
                          <next>
                            <block type="update" id="$$[gT9]f[uJRdOu.].4*">
                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                              <field name="OID">0_userdata.0.Datenpunkte.MessVariable.RollladenTerrasseIst</field>
                              <field name="WITH_DELAY">FALSE</field>
                              <value name="VALUE">
                                <block type="text" id=",lPj$HVQ2Io;u!T#YOPg">
                                  <field name="TEXT">offen</field>
                                </block>
                              </value>
                            </block>
                          </next>
                        </block>
                      </statement>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </next>
        </block>
      </xml>
      <xml xmlns="https://developers.google.com/blockly/xml">
        <block type="comment" id="~=K~@VWYen;^|zr`[!XD" x="-162" y="-612">
          <field name="COMMENT">1,5 Std. nach Sonnenuntergang Rollladen schließen</field>
          <next>
            <block type="astro" id="WNo!5b}:)]MBft9bAL{)">
              <field name="TYPE">sunset</field>
              <field name="OFFSET">90</field>
              <statement name="STATEMENT">
                <block type="controls_if" id="M#zR5(I4v:Z2=Ft+*_F,">
                  <mutation else="1"></mutation>
                  <value name="IF0">
                    <block type="logic_compare" id="@b%Y+DsSL}:_;Gc]+Z^^">
                      <field name="OP">EQ</field>
                      <value name="A">
                        <block type="get_value" id="pe65tl_lrg592an`w-zx">
                          <field name="ATTR">val</field>
                          <field name="OID">deconz.0.Sensors.15.open</field>
                        </block>
                      </value>
                      <value name="B">
                        <block type="logic_boolean" id="O/{+,4WQcE)!mbr^KO45">
                          <field name="BOOL">FALSE</field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <statement name="DO0">
                    <block type="control" id="khi/zPBYQmJeV9,i=7*`">
                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
                      <field name="OID">shelly.1.SHSW-25#3C6105E53BCD#1.Shutter.Close</field>
                      <field name="WITH_DELAY">TRUE</field>
                      <field name="DELAY_MS">2</field>
                      <field name="UNIT">min</field>
                      <field name="CLEAR_RUNNING">FALSE</field>
                      <value name="VALUE">
                        <block type="logic_boolean" id="mBCAzb!juX/9zWU|yl.x">
                          <field name="BOOL">TRUE</field>
                        </block>
                      </value>
                      <next>
                        <block type="update" id="=aiMhyza*4DTy-!OwS9}">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                          <field name="OID">0_userdata.0.Datenpunkte.MessVariable.RollladenTerrasseIst</field>
                          <field name="WITH_DELAY">FALSE</field>
                          <value name="VALUE">
                            <block type="text" id="i+NQqfW~CfFz`dKFJ:c!">
                              <field name="TEXT">geschlossen</field>
                            </block>
                          </value>
                        </block>
                      </next>
                    </block>
                  </statement>
                  <statement name="ELSE">
                    <block type="control" id="~4B0we/=ZiAx@NBn_CJG">
                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                      <field name="OID">shelly.1.SHSW-25#3C6105E53BCD#1.Shutter.Pause</field>
                      <field name="WITH_DELAY">FALSE</field>
                      <value name="VALUE">
                        <block type="logic_boolean" id="?T@e:|aE-UyWEb=_xTK[">
                          <field name="BOOL">TRUE</field>
                        </block>
                      </value>
                    </block>
                  </statement>
                </block>
              </statement>
              <next>
                <block type="comment" id="FeG^rZp?q`x7^HwIv]`5">
                  <field name="COMMENT">30 Min.nach Sonnenaufgang Rollladen öffnen</field>
                  <next>
                    <block type="astro" id="/6pws5mtVQ3*ss#lf1ZK">
                      <field name="TYPE">sunrise</field>
                      <field name="OFFSET">30</field>
                      <statement name="STATEMENT">
                        <block type="control" id="Upr5%nUi|J]_k$2:QeSk">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
                          <field name="OID">shelly.1.SHSW-25#3C6105E53BCD#1.Shutter.Open</field>
                          <field name="WITH_DELAY">TRUE</field>
                          <field name="DELAY_MS">2</field>
                          <field name="UNIT">min</field>
                          <field name="CLEAR_RUNNING">FALSE</field>
                          <value name="VALUE">
                            <block type="logic_boolean" id="[+t3`{82XPa%w3R%N:b-">
                              <field name="BOOL">TRUE</field>
                            </block>
                          </value>
                          <next>
                            <block type="update" id="$$[gT9]f[uJRdOu.].4*">
                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                              <field name="OID">0_userdata.0.Datenpunkte.MessVariable.RollladenTerrasseIst</field>
                              <field name="WITH_DELAY">FALSE</field>
                              <value name="VALUE">
                                <block type="text" id=",lPj$HVQ2Io;u!T#YOPg">
                                  <field name="TEXT">offen</field>
                                </block>
                              </value>
                            </block>
                          </next>
                        </block>
                      </statement>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </next>
        </block>
      </xml>
      
      

      Hat jemand eine bessere Idee, die dazu auch noch funktioniert 😉
      Danke für euer Feedback

      J paul53 2 Replies Last reply Reply Quote 0
      • J
        Jan1 @mueller-esch last edited by

        @mueller-esch
        Ich habe ein ganz anderen Ansatz, der direkt den Shelly blockiert wenn die Tür offen ist. Hat den Vorteil, dass es so egal ist, was den Rollladen steuert.
        Den DP "offen" setzte ich über Türkontakte.

        ff71a415-c73d-4d10-98a0-9d4f39579abc-grafik.png

        M 1 Reply Last reply Reply Quote 0
        • M
          mueller-esch @Jan1 last edited by mueller-esch

          @jan1 Danke Jan1.
          So ganz kann ich den Blockly noch nicht nachvollziehen:

          • Welchen Wert nimmt der rote "Wert" woher und

          • Wert vom Object ID offen: wo kommt die Object ID her

          • und mit Timeouts habe ich noch nicht gearbeitet. Ich weiß nicht genau, was die machen

          J 1 Reply Last reply Reply Quote 0
          • J
            Jan1 @mueller-esch last edited by

            @mueller-esch
            "Wert" ist auf den Trigger bezogen, also das Objekt welches im Trigger angegeben wird.
            "offen" hatte ich oben schon geschrieben und ist ein DP den ich über Fensterkontakte setzte. Man könnte hier auch den Fensterkontakt selber verwenden.
            Das würde wohl auch ohne den Timeout laufen, ist in dem Fall nur damit das Blockly etwas mehr Zeit hat die Bedingungen zu erfassen, glaube ich, da das Blockly schon älter ist und ich nicht mehr genau weiß was damals mein Gedanken dazu war 😉

            1 Reply Last reply Reply Quote 0
            • paul53
              paul53 @mueller-esch last edited by

              @mueller-esch sagte: Rollladen nicht runterfährt, wenn die Türe offen ist,

              Vorschlag, wenn der Rolladen dann aber runter fahren soll bei Schließen der Tür nachts:

              Bild_2021-04-19_113836.png

              1 Reply Last reply Reply Quote 0
              • M
                mueller-esch last edited by

                Hallo zusammen, nachdem ich einige Vorschläge analysiert habe, konnte ich jetzt auf meine Bedürfnisse das Blockly ans "Laufen" bringen. Es sieht derziet so aus:

                TerrassenTuerFinal.png

                
                BlocklyJavascriptTypeScriptRules
                Protokoll
                Ausgewählte Blöcke exportieren
                <xml xmlns="https://developers.google.com/blockly/xml">
                  <block type="comment" id="~=K~@VWYen;^|zr`[!XD" x="-162" y="-612">
                    <field name="COMMENT">1,5 Std. nach Sonnenuntergang Rollladen schließen</field>
                    <next>
                      <block type="astro" id="WNo!5b}:)]MBft9bAL{)">
                        <field name="TYPE">sunset</field>
                        <field name="OFFSET">90</field>
                        <statement name="STATEMENT">
                          <block type="controls_if" id="L5}@GbtZ${Q#:7iWZQR:">
                            <mutation else="1"></mutation>
                            <value name="IF0">
                              <block type="logic_operation" id="hf{[@^33#H.mK`37?4bh" inline="false">
                                <field name="OP">AND</field>
                                <value name="A">
                                  <block type="logic_compare" id="aE9}aAbgX`sMom?2uW8C">
                                    <field name="OP">EQ</field>
                                    <value name="A">
                                      <block type="get_value" id="Iv_P3VC{{id0!^}6pz.6">
                                        <field name="ATTR">val</field>
                                        <field name="OID">deconz.0.Sensors.15.open</field>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="logic_boolean" id="zoD0}3NfkSYpQX`YmGhk">
                                        <field name="BOOL">FALSE</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <value name="B">
                                  <block type="logic_compare" id="_]zp]#coBO6A)3qi;IuS">
                                    <field name="OP">GT</field>
                                    <value name="A">
                                      <block type="get_value" id="0w[,/}AT^GhrPDizT+m#">
                                        <field name="ATTR">val</field>
                                        <field name="OID">shelly.1.SHSW-25#3C6105E53BCD#1.Shutter.Position</field>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="math_number" id="TQehh!XOJU{]S+5H#_Fc">
                                        <field name="NUM">60</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <statement name="DO0">
                              <block type="control" id="khi/zPBYQmJeV9,i=7*`">
                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
                                <field name="OID">shelly.1.SHSW-25#3C6105E53BCD#1.Shutter.Position</field>
                                <field name="WITH_DELAY">TRUE</field>
                                <field name="DELAY_MS">180</field>
                                <field name="UNIT">sec</field>
                                <field name="CLEAR_RUNNING">FALSE</field>
                                <value name="VALUE">
                                  <block type="math_number" id="pXD#veylQzly]-SCRBUM">
                                    <field name="NUM">0</field>
                                  </block>
                                </value>
                              </block>
                            </statement>
                            <statement name="ELSE">
                              <block type="control" id="|oYc-gfDF/UuYgbP(3,^">
                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                <field name="OID">shelly.1.SHSW-25#3C6105E53BCD#1.Shutter.Position</field>
                                <field name="WITH_DELAY">FALSE</field>
                                <value name="VALUE">
                                  <block type="math_number" id="8*trvUtc~fcBUuaX}[gO">
                                    <field name="NUM">100</field>
                                  </block>
                                </value>
                              </block>
                            </statement>
                          </block>
                        </statement>
                        <next>
                          <block type="comment" id="FeG^rZp?q`x7^HwIv]`5">
                            <field name="COMMENT">30 Min.nach Sonnenaufgang Rollladen öffnen</field>
                            <next>
                              <block type="astro" id="/6pws5mtVQ3*ss#lf1ZK">
                                <field name="TYPE">sunrise</field>
                                <field name="OFFSET">30</field>
                                <statement name="STATEMENT">
                                  <block type="control" id="Upr5%nUi|J]_k$2:QeSk">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
                                    <field name="OID">shelly.1.SHSW-25#3C6105E53BCD#1.Shutter.Position</field>
                                    <field name="WITH_DELAY">TRUE</field>
                                    <field name="DELAY_MS">2</field>
                                    <field name="UNIT">min</field>
                                    <field name="CLEAR_RUNNING">FALSE</field>
                                    <value name="VALUE">
                                      <block type="math_number" id="fV|{.Nb0{Qwn@H#fkzfo">
                                        <field name="NUM">100</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </xml>
                <xml xmlns="https://developers.google.com/blockly/xml">
                  <block type="comment" id="~=K~@VWYen;^|zr`[!XD" x="-162" y="-612">
                    <field name="COMMENT">1,5 Std. nach Sonnenuntergang Rollladen schließen</field>
                    <next>
                      <block type="astro" id="WNo!5b}:)]MBft9bAL{)">
                        <field name="TYPE">sunset</field>
                        <field name="OFFSET">90</field>
                        <statement name="STATEMENT">
                          <block type="controls_if" id="L5}@GbtZ${Q#:7iWZQR:">
                            <mutation else="1"></mutation>
                            <value name="IF0">
                              <block type="logic_operation" id="hf{[@^33#H.mK`37?4bh" inline="false">
                                <field name="OP">AND</field>
                                <value name="A">
                                  <block type="logic_compare" id="aE9}aAbgX`sMom?2uW8C">
                                    <field name="OP">EQ</field>
                                    <value name="A">
                                      <block type="get_value" id="Iv_P3VC{{id0!^}6pz.6">
                                        <field name="ATTR">val</field>
                                        <field name="OID">deconz.0.Sensors.15.open</field>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="logic_boolean" id="zoD0}3NfkSYpQX`YmGhk">
                                        <field name="BOOL">FALSE</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <value name="B">
                                  <block type="logic_compare" id="_]zp]#coBO6A)3qi;IuS">
                                    <field name="OP">GT</field>
                                    <value name="A">
                                      <block type="get_value" id="0w[,/}AT^GhrPDizT+m#">
                                        <field name="ATTR">val</field>
                                        <field name="OID">shelly.1.SHSW-25#3C6105E53BCD#1.Shutter.Position</field>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="math_number" id="TQehh!XOJU{]S+5H#_Fc">
                                        <field name="NUM">60</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <statement name="DO0">
                              <block type="control" id="khi/zPBYQmJeV9,i=7*`">
                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
                                <field name="OID">shelly.1.SHSW-25#3C6105E53BCD#1.Shutter.Position</field>
                                <field name="WITH_DELAY">TRUE</field>
                                <field name="DELAY_MS">180</field>
                                <field name="UNIT">sec</field>
                                <field name="CLEAR_RUNNING">FALSE</field>
                                <value name="VALUE">
                                  <block type="math_number" id="pXD#veylQzly]-SCRBUM">
                                    <field name="NUM">0</field>
                                  </block>
                                </value>
                              </block>
                            </statement>
                            <statement name="ELSE">
                              <block type="control" id="|oYc-gfDF/UuYgbP(3,^">
                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                <field name="OID">shelly.1.SHSW-25#3C6105E53BCD#1.Shutter.Position</field>
                                <field name="WITH_DELAY">FALSE</field>
                                <value name="VALUE">
                                  <block type="math_number" id="8*trvUtc~fcBUuaX}[gO">
                                    <field name="NUM">100</field>
                                  </block>
                                </value>
                              </block>
                            </statement>
                          </block>
                        </statement>
                        <next>
                          <block type="comment" id="FeG^rZp?q`x7^HwIv]`5">
                            <field name="COMMENT">30 Min.nach Sonnenaufgang Rollladen öffnen</field>
                            <next>
                              <block type="astro" id="/6pws5mtVQ3*ss#lf1ZK">
                                <field name="TYPE">sunrise</field>
                                <field name="OFFSET">30</field>
                                <statement name="STATEMENT">
                                  <block type="control" id="Upr5%nUi|J]_k$2:QeSk">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
                                    <field name="OID">shelly.1.SHSW-25#3C6105E53BCD#1.Shutter.Position</field>
                                    <field name="WITH_DELAY">TRUE</field>
                                    <field name="DELAY_MS">2</field>
                                    <field name="UNIT">min</field>
                                    <field name="CLEAR_RUNNING">FALSE</field>
                                    <value name="VALUE">
                                      <block type="math_number" id="fV|{.Nb0{Qwn@H#fkzfo">
                                        <field name="NUM">100</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </xml>
                
                

                Es ist jetzt keine Automatik eingebaut, dass das Rollo an der Terrassentuer sofort runterfährt, wenn die Türe geschlossen wird. Das kann ich vor Ort dann noch manuell per Taster erledigen. Das ist aber auch gut so. Aber schon mal Danke für Eure Hilfe

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

                Support us

                ioBroker
                Community Adapters
                Donate

                563
                Online

                32.0k
                Users

                80.5k
                Topics

                1.3m
                Posts

                3
                6
                359
                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