Skip to content
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. Blockly
  5. Vergleichen und Berechnen - Falls Blockly

NEWS

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    17
    1
    3.6k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    1.1k

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    25
    1
    2.5k

Vergleichen und Berechnen - Falls Blockly

Geplant Angeheftet Gesperrt Verschoben Blockly
5 Beiträge 2 Kommentatoren 547 Aufrufe 1 Watching
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • M Offline
    M Offline
    Mento
    schrieb am zuletzt editiert von
    #1

    Hallo,
    ich benötige Unterstützung für ein Teil / Mathe Blockly - "Falls..."
    Ich habe 2 Objekte mit Temperatur Werten.
    Es soll eine Pumpe gesteuert werden wen der Wert von Objekt1 (sonoff.0.creationx), 5 Grad Wärmer, zu Objekt 2 (fritzdect.0.DECT200) gemessen wurde.Ist der Unterschied dann wieder kleiner 5 Grade soll die Pumpe wieder ausgeschaltet werden.
    Für viele von euch sicherlich sehr einfach , aber unter den Mathe Blocklys finde ich leider nichts passendes.
    Kann mir bitte jemand kurz weiterhelfen.

    <xml xmlns="http://www.w3.org/1999/xhtml">
      <block type="controls_if" id="f`]_ZnrJPO+/s2gj8/sr" x="-412" y="-262">
        <mutation elseif="1"></mutation>
        <value name="IF0">
          <block type="get_value" id="ArjRgSLH@Qg`u.X6fgoj">
            <field name="ATTR">val</field>
            <field name="OID">sonoff.0.creationx-1023.DS18B20_Temperature</field>
          </block>
        </value>
        <statement name="DO0">
          <block type="control" id="fn32UPV8!EY@LVl@l441">
            <mutation delay_input="false"></mutation>
            <field name="OID">tuya.0.0320037068c63abb872f.1</field>
            <field name="WITH_DELAY">FALSE</field>
            <value name="VALUE">
              <block type="logic_boolean" id="qANq2i^?87M8iiIJ5)Q!">
                <field name="BOOL">TRUE</field>
              </block>
            </value>
          </block>
        </statement>
        <statement name="DO1">
          <block type="control" id="gG{^EIio~OS*1nMq(CEu">
            <mutation delay_input="false"></mutation>
            <field name="OID">tuya.0.0320037068c63abb872f.1</field>
            <field name="WITH_DELAY">FALSE</field>
            <value name="VALUE">
              <block type="logic_boolean" id="C_xtJ}B3Z+oFPE:v?=+w">
                <field name="BOOL">FALSE</field>
              </block>
            </value>
          </block>
        </statement>
      </block>
      <block type="math_number" id="vZqy];;Q1`wB9p]#nx_8" x="137" y="-263">
        <field name="NUM">5</field>
      </block>
      <block type="get_value" id="kF4YOVaPllDcMoQ6CE%V" x="188" y="-263">
        <field name="ATTR">val</field>
        <field name="OID">fritzdect.0.DECT200_087610178347.temp</field>
      </block>
    </xml>
    
    
    1 Antwort Letzte Antwort
    0
    • iomountainI Offline
      iomountainI Offline
      iomountain
      schrieb am zuletzt editiert von iomountain
      #2

      @Mento sagte in Vergleichen und Berechnen - Falls Blockly:

      Versuch mal:
      a68e129f-d3ad-447b-a9bf-bc946129c3c7-image.png

      des Grüne natürlich passend ersetzen
      0f7e38a4-47e7-464c-9b85-ee1121359d4a-image.png

      <xml xmlns="http://www.w3.org/1999/xhtml">
        <block type="on_ext" id="wNNWp~Y_FZe|v#%-dVwx" x="-413" y="-463">
          <mutation items="2"></mutation>
          <field name="CONDITION">ne</field>
          <field name="ACK_CONDITION"></field>
          <value name="OID0">
            <shadow type="field_oid" id="~?t}50$cE*vhNwt/9d{k">
              <field name="oid">default</field>
            </shadow>
            <block type="text" id="`OU;{Ts83:{NIDVe#_vB">
              <field name="TEXT">sonoff Temp sensor</field>
            </block>
          </value>
          <value name="OID1">
            <shadow type="field_oid" id="Hpa0]B73T)Sl=V{evgz2">
              <field name="oid">default</field>
            </shadow>
            <block type="text" id=")N1;gD!Ns!iwMZbQYYv.">
              <field name="TEXT">fritz temp sensor</field>
            </block>
          </value>
          <statement name="STATEMENT">
            <block type="controls_if" id="f`]_ZnrJPO+/s2gj8/sr">
              <mutation elseif="1"></mutation>
              <value name="IF0">
                <block type="logic_compare" id="uLfZ.8ij68Im%Zp4D[K^">
                  <field name="OP">GT</field>
                  <value name="A">
                    <block type="get_value" id="kF4YOVaPllDcMoQ6CE%V">
                      <field name="ATTR">val</field>
                      <field name="OID">fritzdect.0.DECT200_087610178347.temp</field>
                    </block>
                  </value>
                  <value name="B">
                    <block type="math_arithmetic" id="kO*{.nQyNy]#0AQMs^@E">
                      <field name="OP">ADD</field>
                      <value name="A">
                        <shadow type="math_number" id="S-?[ltaJSwGg=L^bp!Mh">
                          <field name="NUM">1</field>
                        </shadow>
                        <block type="get_value" id="ArjRgSLH@Qg`u.X6fgoj">
                          <field name="ATTR">val</field>
                          <field name="OID">sonoff.0.creationx-1023.DS18B20_Temperature</field>
                        </block>
                      </value>
                      <value name="B">
                        <shadow type="math_number" id="MuGm=)+OJsJ.%A.7J70)">
                          <field name="NUM">1</field>
                        </shadow>
                        <block type="math_number" id="vZqy];;Q1`wB9p]#nx_8">
                          <field name="NUM">5</field>
                        </block>
                      </value>
                    </block>
                  </value>
                </block>
              </value>
              <statement name="DO0">
                <block type="control" id="fn32UPV8!EY@LVl@l441">
                  <mutation delay_input="false"></mutation>
                  <field name="OID">tuya.0.0320037068c63abb872f.1</field>
                  <field name="WITH_DELAY">FALSE</field>
                  <value name="VALUE">
                    <block type="logic_boolean" id="qANq2i^?87M8iiIJ5)Q!">
                      <field name="BOOL">TRUE</field>
                    </block>
                  </value>
                </block>
              </statement>
              <value name="IF1">
                <block type="logic_compare" id="gJ(-S([ECw`S;(0i=r+M">
                  <field name="OP">LT</field>
                  <value name="A">
                    <block type="get_value" id=":;OaqB@6DgEvHKMx[Z/=">
                      <field name="ATTR">val</field>
                      <field name="OID">fritzdect.0.DECT200_087610178347.temp</field>
                    </block>
                  </value>
                  <value name="B">
                    <block type="math_arithmetic" id="!,vG%j$6J{Ikzg:x~x?U">
                      <field name="OP">ADD</field>
                      <value name="A">
                        <shadow type="math_number" id="S-?[ltaJSwGg=L^bp!Mh">
                          <field name="NUM">1</field>
                        </shadow>
                        <block type="get_value" id="C-xfh:R`9N#Rsvj7?gaz">
                          <field name="ATTR">val</field>
                          <field name="OID">sonoff.0.creationx-1023.DS18B20_Temperature</field>
                        </block>
                      </value>
                      <value name="B">
                        <shadow type="math_number" id="MuGm=)+OJsJ.%A.7J70)">
                          <field name="NUM">1</field>
                        </shadow>
                        <block type="math_number" id="B5/nTLNzT9]2HGKj)k=M">
                          <field name="NUM">5</field>
                        </block>
                      </value>
                    </block>
                  </value>
                </block>
              </value>
              <statement name="DO1">
                <block type="control" id="gG{^EIio~OS*1nMq(CEu">
                  <mutation delay_input="false"></mutation>
                  <field name="OID">tuya.0.0320037068c63abb872f.1</field>
                  <field name="WITH_DELAY">FALSE</field>
                  <value name="VALUE">
                    <block type="logic_boolean" id="C_xtJ}B3Z+oFPE:v?=+w">
                      <field name="BOOL">FALSE</field>
                    </block>
                  </value>
                </block>
              </statement>
            </block>
          </statement>
        </block>
      </xml>
      
      M 1 Antwort Letzte Antwort
      0
      • iomountainI iomountain

        @Mento sagte in Vergleichen und Berechnen - Falls Blockly:

        Versuch mal:
        a68e129f-d3ad-447b-a9bf-bc946129c3c7-image.png

        des Grüne natürlich passend ersetzen
        0f7e38a4-47e7-464c-9b85-ee1121359d4a-image.png

        <xml xmlns="http://www.w3.org/1999/xhtml">
          <block type="on_ext" id="wNNWp~Y_FZe|v#%-dVwx" x="-413" y="-463">
            <mutation items="2"></mutation>
            <field name="CONDITION">ne</field>
            <field name="ACK_CONDITION"></field>
            <value name="OID0">
              <shadow type="field_oid" id="~?t}50$cE*vhNwt/9d{k">
                <field name="oid">default</field>
              </shadow>
              <block type="text" id="`OU;{Ts83:{NIDVe#_vB">
                <field name="TEXT">sonoff Temp sensor</field>
              </block>
            </value>
            <value name="OID1">
              <shadow type="field_oid" id="Hpa0]B73T)Sl=V{evgz2">
                <field name="oid">default</field>
              </shadow>
              <block type="text" id=")N1;gD!Ns!iwMZbQYYv.">
                <field name="TEXT">fritz temp sensor</field>
              </block>
            </value>
            <statement name="STATEMENT">
              <block type="controls_if" id="f`]_ZnrJPO+/s2gj8/sr">
                <mutation elseif="1"></mutation>
                <value name="IF0">
                  <block type="logic_compare" id="uLfZ.8ij68Im%Zp4D[K^">
                    <field name="OP">GT</field>
                    <value name="A">
                      <block type="get_value" id="kF4YOVaPllDcMoQ6CE%V">
                        <field name="ATTR">val</field>
                        <field name="OID">fritzdect.0.DECT200_087610178347.temp</field>
                      </block>
                    </value>
                    <value name="B">
                      <block type="math_arithmetic" id="kO*{.nQyNy]#0AQMs^@E">
                        <field name="OP">ADD</field>
                        <value name="A">
                          <shadow type="math_number" id="S-?[ltaJSwGg=L^bp!Mh">
                            <field name="NUM">1</field>
                          </shadow>
                          <block type="get_value" id="ArjRgSLH@Qg`u.X6fgoj">
                            <field name="ATTR">val</field>
                            <field name="OID">sonoff.0.creationx-1023.DS18B20_Temperature</field>
                          </block>
                        </value>
                        <value name="B">
                          <shadow type="math_number" id="MuGm=)+OJsJ.%A.7J70)">
                            <field name="NUM">1</field>
                          </shadow>
                          <block type="math_number" id="vZqy];;Q1`wB9p]#nx_8">
                            <field name="NUM">5</field>
                          </block>
                        </value>
                      </block>
                    </value>
                  </block>
                </value>
                <statement name="DO0">
                  <block type="control" id="fn32UPV8!EY@LVl@l441">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">tuya.0.0320037068c63abb872f.1</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                      <block type="logic_boolean" id="qANq2i^?87M8iiIJ5)Q!">
                        <field name="BOOL">TRUE</field>
                      </block>
                    </value>
                  </block>
                </statement>
                <value name="IF1">
                  <block type="logic_compare" id="gJ(-S([ECw`S;(0i=r+M">
                    <field name="OP">LT</field>
                    <value name="A">
                      <block type="get_value" id=":;OaqB@6DgEvHKMx[Z/=">
                        <field name="ATTR">val</field>
                        <field name="OID">fritzdect.0.DECT200_087610178347.temp</field>
                      </block>
                    </value>
                    <value name="B">
                      <block type="math_arithmetic" id="!,vG%j$6J{Ikzg:x~x?U">
                        <field name="OP">ADD</field>
                        <value name="A">
                          <shadow type="math_number" id="S-?[ltaJSwGg=L^bp!Mh">
                            <field name="NUM">1</field>
                          </shadow>
                          <block type="get_value" id="C-xfh:R`9N#Rsvj7?gaz">
                            <field name="ATTR">val</field>
                            <field name="OID">sonoff.0.creationx-1023.DS18B20_Temperature</field>
                          </block>
                        </value>
                        <value name="B">
                          <shadow type="math_number" id="MuGm=)+OJsJ.%A.7J70)">
                            <field name="NUM">1</field>
                          </shadow>
                          <block type="math_number" id="B5/nTLNzT9]2HGKj)k=M">
                            <field name="NUM">5</field>
                          </block>
                        </value>
                      </block>
                    </value>
                  </block>
                </value>
                <statement name="DO1">
                  <block type="control" id="gG{^EIio~OS*1nMq(CEu">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">tuya.0.0320037068c63abb872f.1</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                      <block type="logic_boolean" id="C_xtJ}B3Z+oFPE:v?=+w">
                        <field name="BOOL">FALSE</field>
                      </block>
                    </value>
                  </block>
                </statement>
              </block>
            </statement>
          </block>
        </xml>
        
        M Offline
        M Offline
        Mento
        schrieb am zuletzt editiert von
        #3

        @iomountain Danke ich habe es mal so angepasst.

        Habe erst mal eine Test Objekt zum Schalten genommen und logge es per Historie. Mal sehen wie es sich verhält. muss mal ein paar Daten Sammeln.
        Blocky sieht so aus:

        <xml xmlns="http://www.w3.org/1999/xhtml">
          <block type="on_ext" id="wNNWp~Y_FZe|v#%-dVwx" x="-413" y="-287">
            <mutation items="2"></mutation>
            <field name="CONDITION">ne</field>
            <field name="ACK_CONDITION"></field>
            <value name="OID0">
              <shadow type="field_oid" id="~?t}50$cE*vhNwt/9d{k">
                <field name="oid">sonoff.0.creationx-1023.DS18B20_Temperature</field>
              </shadow>
            </value>
            <value name="OID1">
              <shadow type="field_oid" id="Hpa0]B73T)Sl=V{evgz2">
                <field name="oid">fritzdect.0.DECT200_087610178347.temp</field>
              </shadow>
            </value>
            <statement name="STATEMENT">
              <block type="controls_if" id="_iCR_}a.Vspq-@AqD~9^">
                <mutation elseif="1"></mutation>
                <value name="IF0">
                  <block type="logic_compare" id="uLfZ.8ij68Im%Zp4D[K^">
                    <field name="OP">GT</field>
                    <value name="A">
                      <block type="get_value" id="0MF^84cfN$rvZt-sMm7V">
                        <field name="ATTR">val</field>
                        <field name="OID">fritzdect.0.DECT200_087610178347.temp</field>
                      </block>
                    </value>
                    <value name="B">
                      <block type="math_arithmetic" id="kO*{.nQyNy]#0AQMs^@E">
                        <field name="OP">ADD</field>
                        <value name="A">
                          <shadow type="math_number" id="S-?[ltaJSwGg=L^bp!Mh">
                            <field name="NUM">1</field>
                          </shadow>
                          <block type="get_value" id="fUzf0{W!S.r?tCW2os-8">
                            <field name="ATTR">val</field>
                            <field name="OID">sonoff.0.creationx-1023.DS18B20_Temperature</field>
                          </block>
                        </value>
                        <value name="B">
                          <shadow type="math_number" id="MuGm=)+OJsJ.%A.7J70)">
                            <field name="NUM">1</field>
                          </shadow>
                          <block type="math_number" id="u9EWK?-EMe(imqdeoX54">
                            <field name="NUM">5</field>
                          </block>
                        </value>
                      </block>
                    </value>
                  </block>
                </value>
                <statement name="DO0">
                  <block type="control" id="/-2XhHkBmKey*R%[!n?d">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">kamera.0.Pool_Trigger</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                      <block type="logic_boolean" id="q7t)HORVod)v9]3W}jo2">
                        <field name="BOOL">TRUE</field>
                      </block>
                    </value>
                  </block>
                </statement>
                <value name="IF1">
                  <block type="logic_compare" id="gJ(-S([ECw`S;(0i=r+M">
                    <field name="OP">LT</field>
                    <value name="A">
                      <block type="get_value" id=":;OaqB@6DgEvHKMx[Z/=">
                        <field name="ATTR">val</field>
                        <field name="OID">fritzdect.0.DECT200_087610178347.temp</field>
                      </block>
                    </value>
                    <value name="B">
                      <block type="math_arithmetic" id="!,vG%j$6J{Ikzg:x~x?U">
                        <field name="OP">ADD</field>
                        <value name="A">
                          <shadow type="math_number" id="S-?[ltaJSwGg=L^bp!Mh">
                            <field name="NUM">1</field>
                          </shadow>
                          <block type="get_value" id="C-xfh:R`9N#Rsvj7?gaz">
                            <field name="ATTR">val</field>
                            <field name="OID">sonoff.0.creationx-1023.DS18B20_Temperature</field>
                          </block>
                        </value>
                        <value name="B">
                          <shadow type="math_number" id="MuGm=)+OJsJ.%A.7J70)">
                            <field name="NUM">1</field>
                          </shadow>
                          <block type="math_number" id="B5/nTLNzT9]2HGKj)k=M">
                            <field name="NUM">5</field>
                          </block>
                        </value>
                      </block>
                    </value>
                  </block>
                </value>
                <statement name="DO1">
                  <block type="control" id="-n]~.72(WFCl(||}MlRa">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">kamera.0.Pool_Trigger</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                      <block type="logic_boolean" id="Zj5F[{eEWHKo]Qm/qo-)">
                        <field name="BOOL">FALSE</field>
                      </block>
                    </value>
                  </block>
                </statement>
              </block>
            </statement>
          </block>
        </xml>
        
        

        Hier versuche ich nun heraus zu finden wann ich schalten sollte und ob ich dann auch den Pool Schalte.
        2019-06-29 13_49_10-vis.png

        1 Antwort Letzte Antwort
        0
        • iomountainI Offline
          iomountainI Offline
          iomountain
          schrieb am zuletzt editiert von
          #4

          @Mento sagte in Vergleichen und Berechnen - Falls Blockly:
          Mit dem "debug output" Baustein kannst du auch schön ins Logfile loggen:
          z.B.:
          9c1c871e-f846-413c-93ce-d38b923e8438-image.png

          Den steuere Pool_Trigger könntest du noch mit falls abfragen wie er gerade steht und nur bei Bedarf schalten. Minimiert die Schaltvorgänge.

          Pool heizen? Abhängig von Tageszeit, Außentemperatur und Anwesenheit usw. viel Spass.

          M 1 Antwort Letzte Antwort
          1
          • iomountainI iomountain

            @Mento sagte in Vergleichen und Berechnen - Falls Blockly:
            Mit dem "debug output" Baustein kannst du auch schön ins Logfile loggen:
            z.B.:
            9c1c871e-f846-413c-93ce-d38b923e8438-image.png

            Den steuere Pool_Trigger könntest du noch mit falls abfragen wie er gerade steht und nur bei Bedarf schalten. Minimiert die Schaltvorgänge.

            Pool heizen? Abhängig von Tageszeit, Außentemperatur und Anwesenheit usw. viel Spass.

            M Offline
            M Offline
            Mento
            schrieb am zuletzt editiert von
            #5

            @iomountain
            auch eine gute Idee,
            mal sehen ob und wie ich es verwerten umsetzten kann. Muss nun erst einmal herausfinden ob ich den Wert Unterschied tatsächlich nehmen kann.
            Also ob sich aus den Werten eine klare Regel erkennbar / ableiten lässt.

            1 Antwort Letzte Antwort
            0
            Antworten
            • In einem neuen Thema antworten
            Anmelden zum Antworten
            • Älteste zuerst
            • Neuste zuerst
            • Meiste Stimmen


            Support us

            ioBroker
            Community Adapters
            Donate

            723

            Online

            32.7k

            Benutzer

            82.4k

            Themen

            1.3m

            Beiträge
            Community
            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
            ioBroker Community 2014-2025
            logo
            • Anmelden

            • Du hast noch kein Konto? Registrieren

            • Anmelden oder registrieren, um zu suchen
            • Erster Beitrag
              Letzter Beitrag
            0
            • Home
            • Aktuell
            • Tags
            • Ungelesen 0
            • Kategorien
            • Unreplied
            • Beliebt
            • GitHub
            • Docu
            • Hilfe