Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. [Erledigt] Multi State Button

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    [Erledigt] Multi State Button

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

      Hey,

      ich versuche gerade einen Button via Script zu realisieren welcher meine Objekt werte bei Button Druck um eins erhöht, aber iwie klappt es nicht. Kann mir hier wer helfen?

      Wie würde ich den dann in der Visu ansteuern?

      f5ce1c30-b9f9-4a71-a4a1-7680a732fbab-image.png
      f52035c0-dd88-4a95-9d12-318c6c7ecea6-image.png

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

        @Stephan-Schleich
        Der Button-Datenpunkt, der zum Triggern den Wert true annehmen soll, hat den gleichen Namen wie der Multistate-Datenpunkt ?
        In Vis haben die Widgets zum Steuern von Mutistate-DP "ValueList" im Namen.

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

          @paul53 Danke paul, das hat für meinen Denkfehler gereicht 🙂

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

            @paul53 Zu früh gefreut 🙂 - Es klappt nur ein ganzer Durchlauf, danach setzt er den Wert auf 0111... und erweitert pro klick um eine weitere 1, ich denke bei dem Punkt Wert erhöhen passt was nicht
            3ef0665d-b850-4f0e-8c99-9c210a7a327e-image.png

            <xml xmlns="https://developers.google.com/blockly/xml">
              <block type="comment" id="^sIIf]B9{f*ZiL*4*5_a" x="38" y="13">
                <field name="COMMENT">Büro</field>
                <next>
                  <block type="on_ext" id=";L}Sy;WTmAWn0fkS~abP">
                    <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="Mjrp:p;c@h=(}o`g%I?)">
                        <field name="oid">0_userdata.0.Klimaanlage.Büro.FanSpeed_Button</field>
                      </shadow>
                    </value>
                    <statement name="STATEMENT">
                      <block type="controls_if" id="|*}]gI)}oi;X^,694tO}">
                        <mutation else="1"></mutation>
                        <value name="IF0">
                          <block type="logic_compare" id="[]O)7:eCTOC!p%qB`/N9">
                            <field name="OP">NEQ</field>
                            <value name="A">
                              <block type="get_value" id="*lRywNIRsxB6w3#K~f(1">
                                <field name="ATTR">val</field>
                                <field name="OID">0_userdata.0.Klimaanlage.Büro.FanSpeed</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="text" id="l~TJ!HkR/M-tx,b?hp.P">
                                <field name="TEXT">5</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO0">
                          <block type="control" id="j7nkSR@c?7?0b7/},7R@">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">0_userdata.0.Klimaanlage.Büro.FanSpeed</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="math_arithmetic" id=")`(~gD3d~jK([a7=A3~j">
                                <field name="OP">ADD</field>
                                <value name="A">
                                  <shadow type="math_number" id="Dcz4ihy[Ip3$/~+thSI~">
                                    <field name="NUM">1</field>
                                  </shadow>
                                  <block type="get_value" id="QFFkyOs)HMg},$SJ09~V">
                                    <field name="ATTR">val</field>
                                    <field name="OID">0_userdata.0.Klimaanlage.Büro.FanSpeed</field>
                                  </block>
                                </value>
                                <value name="B">
                                  <shadow type="math_number" id="nlcVL-+{?:|~kxq*U2Hj">
                                    <field name="NUM">1</field>
                                  </shadow>
                                </value>
                              </block>
                            </value>
                          </block>
                        </statement>
                        <statement name="ELSE">
                          <block type="control" id="Gl+{j0L=hl.5:Z)6At_;">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">0_userdata.0.Klimaanlage.Büro.FanSpeed</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="text" id="XC_u-=*]Wbd@DKR,5,xL">
                                <field name="TEXT">0</field>
                              </block>
                            </value>
                          </block>
                        </statement>
                      </block>
                    </statement>
                  </block>
                </next>
              </block>
              <block type="comment" id="g=8RpQ-+~UFx$r{Vi^D}" x="37" y="337">
                <field name="COMMENT">Wohnzimmer</field>
                <next>
                  <block type="on_ext" id="ZtaHUS?dP:1WX`.Y-~#D">
                    <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="gSLj-ZrEj9eRp0}uQ#C}">
                        <field name="oid">0_userdata.0.Klimaanlage.Wohnzimmer.FanSpeed_Button</field>
                      </shadow>
                    </value>
                    <statement name="STATEMENT">
                      <block type="controls_if" id="y_B9hCkX({qq3~_Az5b3">
                        <mutation else="1"></mutation>
                        <value name="IF0">
                          <block type="logic_compare" id="^yR8h4+0{slfBy!D6FVP">
                            <field name="OP">NEQ</field>
                            <value name="A">
                              <block type="get_value" id="yDN6Gg5eLal/U0FAX?ds">
                                <field name="ATTR">val</field>
                                <field name="OID">0_userdata.0.Klimaanlage.Wohnzimmer.FanSpeed</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="text" id="HqwCG)KhyH%A!w-Tidmn">
                                <field name="TEXT">5</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO0">
                          <block type="control" id="V!VQCxmP+pArYZ2bN|68">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">0_userdata.0.Klimaanlage.Wohnzimmer.FanSpeed</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="math_arithmetic" id=")v@WHr.xk6v%uIs!QQr;">
                                <field name="OP">ADD</field>
                                <value name="A">
                                  <shadow type="math_number">
                                    <field name="NUM">1</field>
                                  </shadow>
                                  <block type="get_value" id="0:Rn#*z(pWW(g?E+y9kd">
                                    <field name="ATTR">val</field>
                                    <field name="OID">0_userdata.0.Klimaanlage.Wohnzimmer.FanSpeed</field>
                                  </block>
                                </value>
                                <value name="B">
                                  <shadow type="math_number" id="Kl]xo?o!mQQ8-3^OgGa-">
                                    <field name="NUM">1</field>
                                  </shadow>
                                </value>
                              </block>
                            </value>
                          </block>
                        </statement>
                        <statement name="ELSE">
                          <block type="control" id="(n1IuCH2!(~Sj]GbMJNo">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">0_userdata.0.Klimaanlage.Wohnzimmer.FanSpeed</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="text" id="#HgWE#%cNoEUGv!TIWWF">
                                <field name="TEXT">0</field>
                              </block>
                            </value>
                          </block>
                        </statement>
                      </block>
                    </statement>
                  </block>
                </next>
              </block>
              <block type="comment" id=":c2wF.O9n8xIm[U{Lk?q" x="37" y="662">
                <field name="COMMENT">Schlafzimmer</field>
                <next>
                  <block type="on_ext" id="UHe5u(4@s+l6F2_nb{~m">
                    <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="T#b~iTiD;C;8CSz6cJ_O">
                        <field name="oid">0_userdata.0.Klimaanlage.Schlafzimmer.FanSpeed_Button</field>
                      </shadow>
                    </value>
                    <statement name="STATEMENT">
                      <block type="controls_if" id="d|@NTO`fu^V4|QAh^svv">
                        <mutation else="1"></mutation>
                        <value name="IF0">
                          <block type="logic_compare" id="cIo]:==;hy,$|8g`6+CX">
                            <field name="OP">NEQ</field>
                            <value name="A">
                              <block type="get_value" id="I2n%]4Qgf9x@B1t=zozh">
                                <field name="ATTR">val</field>
                                <field name="OID">0_userdata.0.Klimaanlage.Schlafzimmer.FanSpeed</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="text" id="J9gxV$(r8%;w{B^n!F#F">
                                <field name="TEXT">5</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO0">
                          <block type="control" id="P20pvggmie2eYxIz(Td+">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">0_userdata.0.Klimaanlage.Schlafzimmer.FanSpeed</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="math_arithmetic" id="yQID!]YO$68R=sa%,#WN">
                                <field name="OP">ADD</field>
                                <value name="A">
                                  <shadow type="math_number">
                                    <field name="NUM">1</field>
                                  </shadow>
                                  <block type="get_value" id="x0xQSrWP!C-u|fDO[vRY">
                                    <field name="ATTR">val</field>
                                    <field name="OID">0_userdata.0.Klimaanlage.Schlafzimmer.FanSpeed</field>
                                  </block>
                                </value>
                                <value name="B">
                                  <shadow type="math_number" id=";IlvuS~m@#[SL;k/sF.5">
                                    <field name="NUM">1</field>
                                  </shadow>
                                </value>
                              </block>
                            </value>
                          </block>
                        </statement>
                        <statement name="ELSE">
                          <block type="control" id="PT+4W,eYSj/ZOvLG*.%e">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">0_userdata.0.Klimaanlage.Schlafzimmer.FanSpeed</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="text" id="WD]%fe!U,9|gO_i$utPk">
                                <field name="TEXT">0</field>
                              </block>
                            </value>
                          </block>
                        </statement>
                      </block>
                    </statement>
                  </block>
                </next>
              </block>
            </xml>
            
            paul53 1 Reply Last reply Reply Quote 0
            • paul53
              paul53 @Stephan Schleich last edited by

              @Stephan-Schleich:

              danach setzt er den Wert auf 0111.

              Dann ist es keine Zahl, sondern ein String. Ändere den String "0" in eine Zahl 0.

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

                @paul53 Danke, das wars 👍

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

                Support us

                ioBroker
                Community Adapters
                Donate

                569
                Online

                32.0k
                Users

                80.4k
                Topics

                1.3m
                Posts

                2
                6
                456
                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