Navigation

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

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    3 Datenpunkte vergleichen

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

      Hallo zusammen,

      ich habe 3 Datenpunkte, diese sind befüllt mit Nummern für den Wetterzustand (1= Sonne, 2= teils bewölkt, 3= bewölkt, 4= bedeckt usw)

      Diese 3 Werte möchte ich gerne vergleichen und den Mindestwert aus den 3 nehmen, mit diesem Wert würde ich dann zeitgesteuert Gertäte einschalten.

      Ich weiß aber leider nicht wie ich den mindestwert erhalte (das wüßte ich) aber ich brauche ja den in Abhängigkeit von einem der 3 Punkte.

      Beispiel:

      WertA= 2
      WertB= 3
      WertC = 12

      hier sollte nun der Wert A als Mindestwert hergenommen werden, da ja in meinem Fall die Bewölkung eher gering ist, aber dafür bräuchte ich natürlich auch welcher wert das ist (also 8-11 uhr, oder 11 - 14 uhr, oder 14-17uhr)

      Kann mir hier jemand helfen, danke

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

        @babl sagte: Mindestwert aus den 3 nehmen

        Schau mal hier.

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

          @paul53 danke, ja dann habe ich den mindestwert, aber noch nciht den dazugehörigen datenpunkt. Habs jetzt mal so gelöst.

          <block xmlns="https://developers.google.com/blockly/xml" type="procedures_defnoreturn" id="^ey=@1mMZkChkusZQ4g4" x="-837" y="813">
            <field name="NAME">Vergleich</field>
            <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
            <statement name="STACK">
              <block type="controls_if" id="yp!aQQGb:Hgs/-VcU.+/">
                <mutation else="1"></mutation>
                <value name="IF0">
                  <block type="logic_operation" id="v*LzvZ,Xf*,tmwqa$h?s" inline="false">
                    <field name="OP">AND</field>
                    <value name="A">
                      <block type="logic_compare" id="ZPkbJYkHQAWe?T5J-a.c">
                        <field name="OP">LT</field>
                        <value name="A">
                          <block type="variables_get" id="Xfn;e_c3DN@MTk3stMtg">
                            <field name="VAR" id="(JO:=)e=+tJR#}bXtA[u">8-11uhr</field>
                          </block>
                        </value>
                        <value name="B">
                          <block type="variables_get" id="#-}UCXIioZHc3LJm2~ws">
                            <field name="VAR" id="gHLWUH_VgSv2JT6o:`}:">11-14uhr</field>
                          </block>
                        </value>
                      </block>
                    </value>
                    <value name="B">
                      <block type="logic_compare" id="P%FGOmt2wrVMI(lg#l9i">
                        <field name="OP">LT</field>
                        <value name="A">
                          <block type="variables_get" id="iIh67n4v4D)pCkKvzOa6">
                            <field name="VAR" id="(JO:=)e=+tJR#}bXtA[u">8-11uhr</field>
                          </block>
                        </value>
                        <value name="B">
                          <block type="variables_get" id="PWH`s]mI6uA5BSiICB#/">
                            <field name="VAR" id="@`9|:c](WH@z6b$jA_;{">14-17uhr</field>
                          </block>
                        </value>
                      </block>
                    </value>
                  </block>
                </value>
                <statement name="DO0">
                  <block type="variables_set" id="uL*Z4reWmGbf5d.nnV/r">
                    <field name="VAR" id="7a$/IRd53g%KB_-#Y8R8">ladung</field>
                    <value name="VALUE">
                      <block type="math_number" id="rZ|#Qyc(ezdCOMiGoI[s">
                        <field name="NUM">1</field>
                      </block>
                    </value>
                  </block>
                </statement>
                <statement name="ELSE">
                  <block type="variables_set" id="b^MhltsV@w/.*;kqzC?1">
                    <field name="VAR" id="7a$/IRd53g%KB_-#Y8R8">ladung</field>
                    <value name="VALUE">
                      <block type="math_number" id="NoQ6QjHD]}@FlPPOy^4s">
                        <field name="NUM">0</field>
                      </block>
                    </value>
                  </block>
                </statement>
                <next>
                  <block type="debug" id="4T^VTf,i)zv:(^Os,vhU">
                    <field name="Severity">log</field>
                    <value name="TEXT">
                      <shadow type="text" id="S@!Zx-#|w1LC;aoW#*#S">
                        <field name="TEXT">test</field>
                      </shadow>
                      <block type="text_join" id="%{L:zCQJsby[b?k*1~:W">
                        <mutation items="2"></mutation>
                        <value name="ADD0">
                          <block type="text" id="E~e0RQQ$9!=$h!h(m8qq">
                            <field name="TEXT">ladung </field>
                          </block>
                        </value>
                        <value name="ADD1">
                          <block type="variables_get" id="XT6zF_@[qrJlogSBxtC_">
                            <field name="VAR" id="7a$/IRd53g%KB_-#Y8R8">ladung</field>
                          </block>
                        </value>
                      </block>
                    </value>
                    <next>
                      <block type="controls_if" id=")q%CZ(wr/;:+zL:[aGG/">
                        <mutation else="1"></mutation>
                        <value name="IF0">
                          <block type="logic_operation" id="USZ$j`Z*[*UD%vdrCFYd" inline="false">
                            <field name="OP">AND</field>
                            <value name="A">
                              <block type="logic_compare" id="$J=CU?FZt-B;uj#T]deB">
                                <field name="OP">LT</field>
                                <value name="A">
                                  <block type="variables_get" id="hF/no$#5JZxP-;+tJn$t">
                                    <field name="VAR" id="gHLWUH_VgSv2JT6o:`}:">11-14uhr</field>
                                  </block>
                                </value>
                                <value name="B">
                                  <block type="variables_get" id="XFV(Uaq*{xuWGa}5,3!Q">
                                    <field name="VAR" id="(JO:=)e=+tJR#}bXtA[u">8-11uhr</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <value name="B">
                              <block type="logic_compare" id="KD^6!{stzDsKy!#CeR)0">
                                <field name="OP">LT</field>
                                <value name="A">
                                  <block type="variables_get" id="gbC*i3$oO@*?=D|WmE^m">
                                    <field name="VAR" id="gHLWUH_VgSv2JT6o:`}:">11-14uhr</field>
                                  </block>
                                </value>
                                <value name="B">
                                  <block type="variables_get" id="(qe|)oIZ!Ic_IwMJE#BW">
                                    <field name="VAR" id="@`9|:c](WH@z6b$jA_;{">14-17uhr</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO0">
                          <block type="variables_set" id="}XhH[oJaGE1Bub4v:x`v">
                            <field name="VAR" id="qg/,j#?UTK==/2H9j|/D">ladung1</field>
                            <value name="VALUE">
                              <block type="math_number" id="~L=+8V]OM%@gpVy./-#d">
                                <field name="NUM">1</field>
                              </block>
                            </value>
                          </block>
                        </statement>
                        <statement name="ELSE">
                          <block type="variables_set" id="3zH3r45qZg3{9N),x)fY">
                            <field name="VAR" id="qg/,j#?UTK==/2H9j|/D">ladung1</field>
                            <value name="VALUE">
                              <block type="math_number" id="Z0J~T,v/RZ3No$!)rWnR">
                                <field name="NUM">0</field>
                              </block>
                            </value>
                          </block>
                        </statement>
                        <next>
                          <block type="debug" id="M|IbERnhA}J-$y!{D/`]">
                            <field name="Severity">log</field>
                            <value name="TEXT">
                              <shadow type="text">
                                <field name="TEXT">test</field>
                              </shadow>
                              <block type="text_join" id="hFL^Eqz]cbM)L+!$,zFY">
                                <mutation items="2"></mutation>
                                <value name="ADD0">
                                  <block type="text" id="PMg)KO^[tJk;If#r8wrY">
                                    <field name="TEXT">ladung1 </field>
                                  </block>
                                </value>
                                <value name="ADD1">
                                  <block type="variables_get" id="0#e,hm.oCM%-e}PzqECK">
                                    <field name="VAR" id="qg/,j#?UTK==/2H9j|/D">ladung1</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <next>
                              <block type="controls_if" id="pykuRk/e6l-2=(-6I3Y|">
                                <mutation else="1"></mutation>
                                <value name="IF0">
                                  <block type="logic_operation" id="-oc_EOmr$neQK[;yn+pD" inline="false">
                                    <field name="OP">AND</field>
                                    <value name="A">
                                      <block type="logic_compare" id="`v.I5^PNglvhDo82v#Bw">
                                        <field name="OP">LT</field>
                                        <value name="A">
                                          <block type="variables_get" id="4%ww)uae3*uE6q3`ejp;">
                                            <field name="VAR" id="@`9|:c](WH@z6b$jA_;{">14-17uhr</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="variables_get" id="s#WO^NHjs3WHUpg=!5pk">
                                            <field name="VAR" id="(JO:=)e=+tJR#}bXtA[u">8-11uhr</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="logic_compare" id="YN{lN#pW5GK;DPQ$NJ|8">
                                        <field name="OP">LT</field>
                                        <value name="A">
                                          <block type="variables_get" id="I#leYk|QobPO!e!F$LvN">
                                            <field name="VAR" id="@`9|:c](WH@z6b$jA_;{">14-17uhr</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="variables_get" id="[x*CqIS,i[toRoG=+QhW">
                                            <field name="VAR" id="gHLWUH_VgSv2JT6o:`}:">11-14uhr</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <statement name="DO0">
                                  <block type="variables_set" id="L#Y[~N}|-,:-@JjcZF/!">
                                    <field name="VAR" id="G00M.8WH)J#1V3RPX[OH">ladung2</field>
                                    <value name="VALUE">
                                      <block type="math_number" id="5eI*6}wn995gkJJ];E6/">
                                        <field name="NUM">1</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                                <statement name="ELSE">
                                  <block type="variables_set" id="qj;u(vNMc17$y_)0lq{#">
                                    <field name="VAR" id="G00M.8WH)J#1V3RPX[OH">ladung2</field>
                                    <value name="VALUE">
                                      <block type="math_number" id="@3i@A{*T8i~Un2,6cHSd">
                                        <field name="NUM">0</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                                <next>
                                  <block type="debug" id="eX9jS?w4fP^CP$.]@fA4">
                                    <field name="Severity">log</field>
                                    <value name="TEXT">
                                      <shadow type="text">
                                        <field name="TEXT">test</field>
                                      </shadow>
                                      <block type="text_join" id="io]tyTF3W/.fF$7O$Jdc">
                                        <mutation items="2"></mutation>
                                        <value name="ADD0">
                                          <block type="text" id="C?o/M;dP0722RZo,(:Rr">
                                            <field name="TEXT">ladung2  </field>
                                          </block>
                                        </value>
                                        <value name="ADD1">
                                          <block type="variables_get" id="u@@KoW{[HY,niwSz_#as">
                                            <field name="VAR" id="G00M.8WH)J#1V3RPX[OH">ladung2</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </statement>
          </block>
          
          
          

          vergleich.jpg

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

            @babl sagte: Habs jetzt mal so gelöst.

            Das geht einfacher.

            Bild_2022-08-15_105126670.png

            B 1 Reply Last reply Reply Quote 1
            • B
              babl @paul53 last edited by

              @paul53 danke war mir schon klar, daß das einfacher geht, ich bin ja schon froh daß es überhaupt funktioniert, aber danke dir. Wie immer Top Hilfe

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

              Support us

              ioBroker
              Community Adapters
              Donate

              816
              Online

              32.0k
              Users

              80.5k
              Topics

              1.3m
              Posts

              blockly
              2
              5
              298
              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