Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly zum Ändern der Positionsangaben Rollo

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Blockly zum Ändern der Positionsangaben Rollo

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

      Ich möchte die Positionsangabe der Rollos, welche der Shelly 2.5 ausgibt, nach meinen Wünschen anpassen. So soll z.B. die Positionsangabe des Shelly mit 15 % offen (entspricht einem geschlossenen Rollo, bei dem die Lamellenschlitze noch offen sind, der Rollo jedoch schon unten ansteht) geändert werden auf 5 %.

      Dazu habe ich mir ein Blockly-Script geschrieben, das aber nicht funktioniert. Den neuen Datenpunkt (Shelly-Wert-neu) habe ich angelegt.

      a2d21886-eb95-4c03-a679-1b7249a01b34-grafik.png

      Wo ist denn mein Denkfehler?

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable id="C($g)F)mIe0cUak4m7zM">Shelly-Wert-neu</variable>
        </variables>
        <block type="on_ext" id="|{gw`ZoJ#V}kw4dBMwk]" x="263" y="63">
          <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="S]dcw+X(5_IlE9}oi$@|">
              <field name="oid">shelly.0.SHSW-25#5DB000#1.Shutter.Position</field>
            </shadow>
          </value>
          <statement name="STATEMENT">
            <block type="controls_if" id="{r8}GZQ.[1pQq2zM$chY">
              <value name="IF0">
                <block type="logic_compare" id=",[{bq(%o{Dh1l)h|=hq?">
                  <field name="OP">EQ</field>
                  <value name="A">
                    <block type="get_value" id="prjKy*Vi:DEHo:(;js+@">
                      <field name="ATTR">val</field>
                      <field name="OID">shelly.0.SHSW-25#5DB000#1.Shutter.Position</field>
                    </block>
                  </value>
                  <value name="B">
                    <block type="math_number" id="Lx+6%c6:#ks^,@4G2gEY">
                      <field name="NUM">15</field>
                    </block>
                  </value>
                </block>
              </value>
              <statement name="DO0">
                <block type="variables_set" id="j.j^qMO4d{hjsx?.SBa}">
                  <field name="VAR" id="C($g)F)mIe0cUak4m7zM">Shelly-Wert-neu</field>
                  <value name="VALUE">
                    <block type="math_number" id="dNsO-)+otIn,2:m~fzs$">
                      <field name="NUM">5</field>
                    </block>
                  </value>
                </block>
              </statement>
              <next>
                <block type="controls_if" id="a_)|3?w3^=ii5L.a02]6">
                  <value name="IF0">
                    <block type="logic_compare" id="5x~:@IR@O2+M{R(:Euwn">
                      <field name="OP">EQ</field>
                      <value name="A">
                        <block type="get_value" id="PnXq|*5#qxGZuSHV9g3T">
                          <field name="ATTR">val</field>
                          <field name="OID">shelly.0.SHSW-25#5DB000#1.Shutter.Position</field>
                        </block>
                      </value>
                      <value name="B">
                        <block type="math_number" id="*iEf,D9d^O2jpG|2UOjV">
                          <field name="NUM">100</field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <statement name="DO0">
                    <block type="variables_set" id="7nm1E6=#:8J{.ah=(swb">
                      <field name="VAR" id="C($g)F)mIe0cUak4m7zM">Shelly-Wert-neu</field>
                      <value name="VALUE">
                        <block type="math_number" id="*ut|/0O27@Iad2aM3%:4">
                          <field name="NUM">99</field>
                        </block>
                      </value>
                    </block>
                  </statement>
                </block>
              </next>
            </block>
          </statement>
        </block>
      </xml>
      
      T 1 Reply Last reply Reply Quote 0
      • T
        TT-Tom @Erich 1 last edited by TT-Tom

        @erich-1
        du setzt eine Variable " Shelly-wert-neu" kein Datenpunkt. Daten Punkt wird damit gesetzt, kommt aus System

        Bildschirmfoto 2023-03-06 um 20.46.29.png

        Alternative

        Bildschirmfoto 2023-03-06 um 20.52.01.png

        E 1 Reply Last reply Reply Quote 0
        • E
          Erich 1 @TT-Tom last edited by

          @tt-tom Hab jetzt mal geändert, aber der Datenpunkt wird immer noch nicht gesetzt. Irgend etwa übersehe ich noch.

          82aba173-1e78-4c16-8a8a-3983ec951e60-grafik.png

          <xml xmlns="https://developers.google.com/blockly/xml">
            <block type="on_ext" id="|{gw`ZoJ#V}kw4dBMwk]" x="263" y="63">
              <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="S]dcw+X(5_IlE9}oi$@|">
                  <field name="oid">shelly.0.SHSW-25#5DB000#1.Shutter.Position</field>
                </shadow>
              </value>
              <statement name="STATEMENT">
                <block type="logic_switch_case" id="J5+Sw5u*H)@h2.OdkXqe">
                  <value name="CONDITION">
                    <block type="on_source" id="DhVtogbeFLWeKZvrI0V?">
                      <field name="ATTR">state.val</field>
                    </block>
                  </value>
                  <value name="CASECONDITION0">
                    <block type="math_number" id="Lx+6%c6:#ks^,@4G2gEY">
                      <field name="NUM">15</field>
                    </block>
                  </value>
                  <statement name="CASE0">
                    <block type="control" id="z*vtpN69cJ^v]2shH]+.">
                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                      <field name="OID">0_userdata.0.Datenpunkte.Rollopositionen.Shelly-Wert-neu</field>
                      <field name="WITH_DELAY">FALSE</field>
                      <value name="VALUE">
                        <block type="math_number" id=")Lj`UaVz~ef+Gv~`Cq$x">
                          <field name="NUM">5</field>
                        </block>
                      </value>
                    </block>
                  </statement>
                  <next>
                    <block type="logic_switch_case" id="Yp.+iRAuArFlNdF;v^=Z">
                      <value name="CONDITION">
                        <block type="on_source" id="x(_nh!8S,x=QX+u+9uz]">
                          <field name="ATTR">state.val</field>
                        </block>
                      </value>
                      <value name="CASECONDITION0">
                        <block type="math_number" id="rE|PmuFIj|K-jDe~^9}D">
                          <field name="NUM">25</field>
                        </block>
                      </value>
                      <statement name="CASE0">
                        <block type="control" id=";y[pl=s~Aq):M!DE5H$H">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                          <field name="OID">0_userdata.0.Datenpunkte.Rollopositionen.Shelly-Wert-neu</field>
                          <field name="WITH_DELAY">FALSE</field>
                          <value name="VALUE">
                            <block type="math_number" id="c=~NkSa0!iGAu{K8Wmzo">
                              <field name="NUM">20</field>
                            </block>
                          </value>
                        </block>
                      </statement>
                      <next>
                        <block type="logic_switch_case" id="d*-`d%cC[[G0eU/8mB),">
                          <value name="CONDITION">
                            <block type="on_source" id="z~kt)9TexJXh7V+:Ll6Q">
                              <field name="ATTR">state.val</field>
                            </block>
                          </value>
                          <value name="CASECONDITION0">
                            <block type="math_number" id="ie_J],Q2%*UsGQ]u[NoT">
                              <field name="NUM">100</field>
                            </block>
                          </value>
                          <statement name="CASE0">
                            <block type="control" id="2nago5cu_F.Jw[dh^jAS">
                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                              <field name="OID">0_userdata.0.Datenpunkte.Rollopositionen.Shelly-Wert-neu</field>
                              <field name="WITH_DELAY">FALSE</field>
                              <value name="VALUE">
                                <block type="math_number" id=".g!dbOPspHNX@I9Rrj`!">
                                  <field name="NUM">99</field>
                                </block>
                              </value>
                            </block>
                          </statement>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </statement>
            </block>
          </xml>
          
          T 1 Reply Last reply Reply Quote 0
          • T
            TT-Tom @Erich 1 last edited by

            @erich-1

            probiere bitte mal das und poste auch mal das log dazu

            Bildschirmfoto 2023-03-06 um 21.19.47.png

            <block xmlns="https://developers.google.com/blockly/xml" type="on_ext" id="|{gw`ZoJ#V}kw4dBMwk]" x="213" y="138">
              <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="S]dcw+X(5_IlE9}oi$@|">
                  <field name="oid">shelly.0.SHSW-25#5DB000#1.Shutter.Position</field>
                </shadow>
              </value>
              <statement name="STATEMENT">
                <block type="debug" id="T]vSi46~nx1?1GM*WE8k">
                  <field name="Severity">log</field>
                  <value name="TEXT">
                    <shadow type="text" id="7|(d?!4e*fg(C.?H*Ww^">
                      <field name="TEXT">test</field>
                    </shadow>
                    <block type="text_join" id="9Tuz@`bD_Fy%y(Ju#gUd">
                      <mutation items="2"></mutation>
                      <value name="ADD0">
                        <block type="text" id="f6^Gzr}j0AQn!~mK|BA3">
                          <field name="TEXT">Shelly Position: </field>
                        </block>
                      </value>
                      <value name="ADD1">
                        <block type="on_source" id="W;/({#JS(E!Y5Wz_XlTj">
                          <field name="ATTR">state.val</field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <next>
                    <block type="logic_switch_case" id="Yp.+iRAuArFlNdF;v^=Z">
                      <mutation xmlns="http://www.w3.org/1999/xhtml" case="2"></mutation>
                      <value name="CONDITION">
                        <block type="on_source" id="x(_nh!8S,x=QX+u+9uz]">
                          <field name="ATTR">state.val</field>
                        </block>
                      </value>
                      <value name="CASECONDITION0">
                        <block type="math_number" id="Lx+6%c6:#ks^,@4G2gEY">
                          <field name="NUM">15</field>
                        </block>
                      </value>
                      <statement name="CASE0">
                        <block type="control" id="z*vtpN69cJ^v]2shH]+.">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                          <field name="OID">0_userdata.0.Datenpunkte.Rollopositionen.Shelly-Wert-neu</field>
                          <field name="WITH_DELAY">FALSE</field>
                          <value name="VALUE">
                            <block type="math_number" id=")Lj`UaVz~ef+Gv~`Cq$x">
                              <field name="NUM">5</field>
                            </block>
                          </value>
                        </block>
                      </statement>
                      <value name="CASECONDITION1">
                        <block type="math_number" id="rE|PmuFIj|K-jDe~^9}D">
                          <field name="NUM">25</field>
                        </block>
                      </value>
                      <statement name="CASE1">
                        <block type="control" id=";y[pl=s~Aq):M!DE5H$H">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                          <field name="OID">0_userdata.0.Datenpunkte.Rollopositionen.Shelly-Wert-neu</field>
                          <field name="WITH_DELAY">FALSE</field>
                          <value name="VALUE">
                            <block type="math_number" id="c=~NkSa0!iGAu{K8Wmzo">
                              <field name="NUM">20</field>
                            </block>
                          </value>
                        </block>
                      </statement>
                      <value name="CASECONDITION2">
                        <block type="math_number" id="ie_J],Q2%*UsGQ]u[NoT">
                          <field name="NUM">100</field>
                        </block>
                      </value>
                      <statement name="CASE2">
                        <block type="control" id="2nago5cu_F.Jw[dh^jAS">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                          <field name="OID">0_userdata.0.Datenpunkte.Rollopositionen.Shelly-Wert-neu</field>
                          <field name="WITH_DELAY">FALSE</field>
                          <value name="VALUE">
                            <block type="math_number" id=".g!dbOPspHNX@I9Rrj`!">
                              <field name="NUM">99</field>
                            </block>
                          </value>
                        </block>
                      </statement>
                    </block>
                  </next>
                </block>
              </statement>
            </block>
            
            E 1 Reply Last reply Reply Quote 0
            • Homoran
              Homoran Global Moderator Administrators last edited by

              hab am Handy mal gebastelt
              Screenshot_20230306-212449_Firefox.jpg

              ohne Gewähr

              Homoran 1 Reply Last reply Reply Quote 0
              • E
                Erich 1 @TT-Tom last edited by Erich 1

                @tt-tom Brauche ich wohl nicht mehr probieren, es klappt auch mit der vorherigen Änderung. Ich hatte vermutlich übersehen, dass der Wert ja erst noch geändert werden muss.

                Rollo zu 100 % geöffnet, die VIS zeigt mir jetzt 99 % an.
                Rollo auf 25 % Öffnung gefahren, die VIS zeigt mir jetzt 20 % an

                Also alles so, wie ich es mir vorgestellt habe. Hat geklappt aufgrund deines Vorschlags. Vielen Dank dafür.

                Jetzt kann ich das mal so durchtesten und möglicherweise noch eine Formel kreieren ...

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

                  @homoran sorry, was vergessen
                  Screenshot_20230306-212652_Firefox.jpg

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

                  Support us

                  ioBroker
                  Community Adapters
                  Donate

                  727
                  Online

                  31.7k
                  Users

                  79.8k
                  Topics

                  1.3m
                  Posts

                  3
                  7
                  202
                  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