Navigation

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

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    Schalten mit Debounce

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

      Hallo zusammen,

      ich möchte gerne meine Poolpumpe+Wärmepumpe in Abhängigkeit von Wassertemperatur und PV Leistung schalten:

      PV Leistung > 2500Watt UND Messzellentemperatur <28°C -> Pumpe + Wärmepumpe einschalten
      PV Leistung < 1500Watt UND Messzellentemperatur >30°C -> Pumpe + Wärmepumpe ausschalten

      Das ganze möchte ich noch entprellen, damit nicht bei jeder Wolke die Wärmepumpe abgeschaltet wird. Folgend der aktuelle Status:

      6bf0fa05-75a6-427c-a5e0-06829b2f237c-image.png

      Leider funktioniert es nicht wirklich, da die Schaltungen nicht den Bedingungen entsprechen.

      Hier der dazugehörige Code:

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable id="z@z3xT3qU}fVdr|=Yv{Q">PV Power</variable>
          <variable id="YT-6Z56$wgpq%dQdH:/M">SchalterWärmepumpe</variable>
          <variable id="2mt4A3,a^/s38ua4Cg-f">SchalterPumpe</variable>
          <variable id=")Urfi2NQtRhvtp.-sH5!">TemperaturMesszelle</variable>
          <variable type="timeout" id="delayOn">delayOn</variable>
          <variable type="timeout" id="delayOff">delayOff</variable>
          <variable id="a`q77kGEjxSiayF)yDWx">WärmePrio</variable>
          <variable id="9}Rqm{/DOtT}cPU{yu19">PumpePrio</variable>
        </variables>
        <block type="on_ext" id="`8+E15.-I_;_*ek?E}oq" x="-737" y="-1587">
          <mutation xmlns="http://www.w3.org/1999/xhtml" items="4"></mutation>
          <field name="CONDITION">ne</field>
          <field name="ACK_CONDITION"></field>
          <value name="OID0">
            <shadow type="field_oid" id="is0*+QO#d+8|Vz.fMriP">
              <field name="oid">fronius.0.site.P_PV</field>
            </shadow>
          </value>
          <value name="OID1">
            <shadow type="field_oid" id="iWjpj/`Kec0S27AgB~I9">
              <field name="oid">tuya.0.bf7200ddef31e2095bgr46.8</field>
            </shadow>
          </value>
          <value name="OID2">
            <shadow type="field_oid" id="^mG,@Nam{!ahZfLNsDE@">
              <field name="oid">shelly.0.SHPLG-S#9A3649#1.Relay0.Switch</field>
            </shadow>
          </value>
          <value name="OID3">
            <shadow type="field_oid" id="0jmTcr4}/(p1QcNJ!6}D">
              <field name="oid">shelly.0.SHPLG-S#FDD9DB#1.Relay0.Switch</field>
            </shadow>
          </value>
          <statement name="STATEMENT">
            <block type="variables_set" id="lkDwX%Up95]2A+aXn=1v">
              <field name="VAR" id="z@z3xT3qU}fVdr|=Yv{Q">PV Power</field>
              <value name="VALUE">
                <block type="get_value" id="$R%sle_$m1f!v1G;##99">
                  <field name="ATTR">val</field>
                  <field name="OID">fronius.0.site.P_PV</field>
                </block>
              </value>
              <next>
                <block type="variables_set" id="sx%aOUt-76J)0_H5r%:8">
                  <field name="VAR" id="YT-6Z56$wgpq%dQdH:/M">SchalterWärmepumpe</field>
                  <value name="VALUE">
                    <block type="get_value" id="O=GN8y!C2pUpiE8W~^I8">
                      <field name="ATTR">val</field>
                      <field name="OID">shelly.0.SHPLG-S#FDD9DB#1.Relay0.Switch</field>
                    </block>
                  </value>
                  <next>
                    <block type="variables_set" id="$pON6E5aZ%0u1sLNu[~^">
                      <field name="VAR" id="2mt4A3,a^/s38ua4Cg-f">SchalterPumpe</field>
                      <value name="VALUE">
                        <block type="get_value" id="U:EB:Cn%O?mjiYvsNxE^">
                          <field name="ATTR">val</field>
                          <field name="OID">shelly.0.SHPLG-S#9A3649#1.Relay0.Switch</field>
                        </block>
                      </value>
                      <next>
                        <block type="variables_set" id="2;1$~e8!rZ6J-SXyFKd5">
                          <field name="VAR" id=")Urfi2NQtRhvtp.-sH5!">TemperaturMesszelle</field>
                          <value name="VALUE">
                            <block type="get_value" id="m.ZOu59@RzMCBDbk?^R(">
                              <field name="ATTR">val</field>
                              <field name="OID">tuya.0.bf7200ddef31e2095bgr46.8</field>
                            </block>
                          </value>
                          <next>
                            <block type="controls_if" id="YO%^jo-T%ZNMWR)WUq0%">
                              <mutation elseif="1"></mutation>
                              <value name="IF0">
                                <block type="logic_multi_and" id="?d2}cF8L2c={b%^Np@6x">
                                  <mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation>
                                  <value name="AND0">
                                    <block type="logic_compare" id="48-b!SAes2pFCvt6@lCD">
                                      <field name="OP">LT</field>
                                      <value name="A">
                                        <block type="variables_get" id="=c7*hE,%!$:Jkf/chU~D">
                                          <field name="VAR" id="z@z3xT3qU}fVdr|=Yv{Q">PV Power</field>
                                        </block>
                                      </value>
                                      <value name="B">
                                        <block type="math_number" id="-M!6-Af%/a.VtaIG!]PI">
                                          <field name="NUM">2500</field>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                  <value name="AND1">
                                    <block type="logic_compare" id="ZymG1x9|55cH}_2rU2Ti">
                                      <field name="OP">GT</field>
                                      <value name="A">
                                        <block type="variables_get" id="Y_-2SLsRD^80W$t`MiPB">
                                          <field name="VAR" id=")Urfi2NQtRhvtp.-sH5!">TemperaturMesszelle</field>
                                        </block>
                                      </value>
                                      <value name="B">
                                        <block type="math_number" id="j(E-_;0_pdt?)e-lLEep">
                                          <field name="NUM">28</field>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <statement name="DO0">
                                <block type="timeouts_cleartimeout" id="I=Jc-:}zDyj7c{Nr$u=(">
                                  <field name="NAME">PV Power</field>
                                </block>
                              </statement>
                              <value name="IF1">
                                <block type="logic_negate" id="6#kDG[3OcG~pkGrFID+Y">
                                  <value name="BOOL">
                                    <block type="timeouts_gettimeout" id="f,=~c@JZEa.AQe5*b$X!">
                                      <field name="NAME">PV Power</field>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <statement name="DO1">
                                <block type="timeouts_settimeout" id="2!7$hUb@3fc#+[%A?*5f">
                                  <field name="NAME">delayOn</field>
                                  <field name="DELAY">2</field>
                                  <field name="UNIT">min</field>
                                  <statement name="STATEMENT">
                                    <block type="controls_if" id=".z6IU0!ur^ZMQEsl@Ly+">
                                      <value name="IF0">
                                        <block type="logic_negate" id="KG.Md2co@9sW5g1c0H,|">
                                          <value name="BOOL">
                                            <block type="logic_multi_and" id="D1c75$9Q:=sTa/t,$w!T">
                                              <mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation>
                                              <value name="AND0">
                                                <block type="variables_get" id="Xwl}(UZRRMZ,Y1~c(E3$">
                                                  <field name="VAR" id="2mt4A3,a^/s38ua4Cg-f">SchalterPumpe</field>
                                                </block>
                                              </value>
                                              <value name="AND1">
                                                <block type="variables_get" id=".L.d9/C,x)o#%b2qNGo9">
                                                  <field name="VAR" id="YT-6Z56$wgpq%dQdH:/M">SchalterWärmepumpe</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                      <statement name="DO0">
                                        <block type="debug" id="x5X^}7lqVj:_coU?ifB4">
                                          <field name="Severity">info</field>
                                          <value name="TEXT">
                                            <shadow type="text" id="7Mm!nvQfBm+./JnkcG+=">
                                              <field name="TEXT">Pumpe+Heizung Pool an!</field>
                                            </shadow>
                                          </value>
                                          <next>
                                            <block type="telegram" id="*^H@BTpVzlRY=Y9kRo?`" collapsed="true">
                                              <field name="INSTANCE"></field>
                                              <field name="LOG"></field>
                                              <field name="SILENT">FALSE</field>
                                              <field name="PARSEMODE">default</field>
                                              <field name="ESCAPING">FALSE</field>
                                              <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field>
                                              <value name="MESSAGE">
                                                <shadow type="text" id="*,jJPIApD:]5/QY~YnCa">
                                                  <field name="TEXT">Pumpe+Heizung Pool an!</field>
                                                </shadow>
                                              </value>
                                            </block>
                                          </next>
                                        </block>
                                      </statement>
                                      <next>
                                        <block type="control" id=")vp|=w8%XO,dDlKm,yYC">
                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                          <field name="OID">shelly.0.SHPLG-S#9A3649#1.Relay0.Switch</field>
                                          <field name="WITH_DELAY">FALSE</field>
                                          <value name="VALUE">
                                            <block type="logic_boolean" id="NGZ{qG}zDB7o,6=HMzKu">
                                              <field name="BOOL">TRUE</field>
                                            </block>
                                          </value>
                                          <next>
                                            <block type="control" id="]EQh$m/n[GqIO2Q?`KpY">
                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                              <field name="OID">shelly.0.SHPLG-S#FDD9DB#1.Relay0.Switch</field>
                                              <field name="WITH_DELAY">FALSE</field>
                                              <value name="VALUE">
                                                <block type="logic_boolean" id="WR@]_q@a?.O{f`Qg9%ys">
                                                  <field name="BOOL">TRUE</field>
                                                </block>
                                              </value>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </statement>
                                </block>
                              </statement>
                              <next>
                                <block type="controls_if" id="{FNY`/(k,QZ,$ZBQox)%">
                                  <mutation elseif="1"></mutation>
                                  <value name="IF0">
                                    <block type="logic_multi_or" id="z1]u}E42I/Q7h5U6+Fv=">
                                      <mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation>
                                      <value name="OR0">
                                        <block type="logic_compare" id="9R+U/dv*VJQrfQqy[Rmu">
                                          <field name="OP">GT</field>
                                          <value name="A">
                                            <block type="variables_get" id="w%xDi*,O3OJX9dm#{|Fq">
                                              <field name="VAR" id="z@z3xT3qU}fVdr|=Yv{Q">PV Power</field>
                                            </block>
                                          </value>
                                          <value name="B">
                                            <block type="math_number" id="Qg.usZF2;i%M_L`*)ke4">
                                              <field name="NUM">1500</field>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                      <value name="OR1">
                                        <block type="logic_compare" id="39Z2^D$D;*{BG:5LoLzk">
                                          <field name="OP">LT</field>
                                          <value name="A">
                                            <block type="get_value" id="xOzj4cc%PE$e|xcOLVoL">
                                              <field name="ATTR">val</field>
                                              <field name="OID">tuya.0.bf7200ddef31e2095bgr46.8</field>
                                            </block>
                                          </value>
                                          <value name="B">
                                            <block type="math_number" id="?I|:G_CfFHYP2)._yH%M">
                                              <field name="NUM">30</field>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                  <statement name="DO0">
                                    <block type="timeouts_cleartimeout" id="ehp7h7Se;ebPzR[=`V:.">
                                      <field name="NAME">delayOn</field>
                                    </block>
                                  </statement>
                                  <value name="IF1">
                                    <block type="logic_negate" id="IXc_j8?(xz5V;Eg(Y2*_">
                                      <value name="BOOL">
                                        <block type="timeouts_gettimeout" id="}GA3tq2sYYrrPDRW:+k=">
                                          <field name="NAME">delayOn</field>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                  <statement name="DO1">
                                    <block type="timeouts_settimeout" id=":yDuj*AX=w%Q9JeBjw;^">
                                      <field name="NAME">delayOff</field>
                                      <field name="DELAY">5</field>
                                      <field name="UNIT">min</field>
                                      <statement name="STATEMENT">
                                        <block type="controls_if" id="vkWFm]D2NT4#+~$y4q+@">
                                          <value name="IF0">
                                            <block type="logic_multi_or" id="Ft`taeeHq]|CJy]YX,yE">
                                              <mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation>
                                              <value name="OR0">
                                                <block type="variables_get" id="u)Jy3;PEih$G4WLdSN(L">
                                                  <field name="VAR" id="2mt4A3,a^/s38ua4Cg-f">SchalterPumpe</field>
                                                </block>
                                              </value>
                                              <value name="OR1">
                                                <block type="variables_get" id="}[C_7ZrbNqpw20RM,dGs">
                                                  <field name="VAR" id="YT-6Z56$wgpq%dQdH:/M">SchalterWärmepumpe</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                          <statement name="DO0">
                                            <block type="controls_if" id="^V)i%}O5zFMo]4mcipls">
                                              <value name="IF0">
                                                <block type="logic_negate" id="R^28}~[2f{xPj!Or:1W)">
                                                  <value name="BOOL">
                                                    <block type="variables_get" id="tB*@CO}}]#1lZvHu_Xg/">
                                                      <field name="VAR" id="a`q77kGEjxSiayF)yDWx">WärmePrio</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <statement name="DO0">
                                                <block type="control" id="VduN~+~]F;b@b/PuP5lD">
                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                  <field name="OID">shelly.0.SHPLG-S#FDD9DB#1.Relay0.Switch</field>
                                                  <field name="WITH_DELAY">FALSE</field>
                                                  <value name="VALUE">
                                                    <block type="logic_boolean" id="^0^t,gU]A#3KcJ#,;xTl">
                                                      <field name="BOOL">FALSE</field>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="telegram" id="!~kz-M]H~TGA?cWZA@Tn" collapsed="true">
                                                      <field name="INSTANCE"></field>
                                                      <field name="LOG"></field>
                                                      <field name="SILENT">FALSE</field>
                                                      <field name="PARSEMODE">default</field>
                                                      <field name="ESCAPING">FALSE</field>
                                                      <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field>
                                                      <value name="MESSAGE">
                                                        <shadow type="text" id=";a?dWGl@`57xiYc1~O?A">
                                                          <field name="TEXT">Pumpe Pool aus!</field>
                                                        </shadow>
                                                      </value>
                                                    </block>
                                                  </next>
                                                </block>
                                              </statement>
                                              <next>
                                                <block type="controls_if" id="%Q~TZ~m.;ELEide2^;Tm">
                                                  <value name="IF0">
                                                    <block type="logic_negate" id="$]!Vj,:84^5{7h!b.B$t">
                                                      <value name="BOOL">
                                                        <block type="variables_get" id="cHU4+#XoX~]Ld7,r;VP6">
                                                          <field name="VAR" id="9}Rqm{/DOtT}cPU{yu19">PumpePrio</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <statement name="DO0">
                                                    <block type="control" id="T8K;JcoiV|34!.V[74=W">
                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                      <field name="OID">shelly.0.SHPLG-S#9A3649#1.Relay0.Switch</field>
                                                      <field name="WITH_DELAY">FALSE</field>
                                                      <value name="VALUE">
                                                        <block type="logic_boolean" id="Szp(,d/WWlgAor{TLiC$">
                                                          <field name="BOOL">FALSE</field>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="telegram" id=",lvMC8Lait]1C=N$pE`{" collapsed="true">
                                                          <field name="INSTANCE"></field>
                                                          <field name="LOG"></field>
                                                          <field name="SILENT">FALSE</field>
                                                          <field name="PARSEMODE">default</field>
                                                          <field name="ESCAPING">FALSE</field>
                                                          <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field>
                                                          <value name="MESSAGE">
                                                            <shadow type="text" id=")$wE?86w0jy#G~:YE]d6">
                                                              <field name="TEXT">Heizung Pool aus!</field>
                                                            </shadow>
                                                          </value>
                                                          <next>
                                                            <block type="debug" id="ma+tEr2JawkjDUiL%B$6">
                                                              <field name="Severity">info</field>
                                                              <value name="TEXT">
                                                                <shadow type="text" id="o!SWg;^CKJcHLhlEg3e~">
                                                                  <field name="TEXT">Pumpe+Heizung Pool aus!</field>
                                                                </shadow>
                                                              </value>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </statement>
                                                </block>
                                              </next>
                                            </block>
                                          </statement>
                                        </block>
                                      </statement>
                                    </block>
                                  </statement>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </statement>
        </block>
      </xml>
      
      paul53 3 Replies Last reply Reply Quote 0
      • paul53
        paul53 @passuff last edited by paul53

        @passuff sagte: Leider funktioniert es nicht wirklich

        Nach einem Blockly-Import muss man erst einmal die richtigen Timer-Variablen bei "clear timeout" und "timeout timeout" zuordnen. Die passen laut Bild nicht.
        Wo werden die Prio-Variablen gesetzt?
        Soll nicht erst die WP und danach die Pumpe ausgeschaltet werden?

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

          @passuff sagte in Schalten mit Debounce:

          der aktuelle Status:

          Hier müssen die "control"-Blöcke mit in den mache-Zweig:

          Blockly_temp.JPG

          Die Telegram-Nachrichten waren vertauscht.

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

            @passuff sagte: in Abhängigkeit von Wassertemperatur und PV Leistung schalten:

            Ich würde Temperatur und PV-Leistung in getrennten Triggern behandeln.

            Blockly_temp.JPG

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

              @paul53 sagte in Schalten mit Debounce:

              @passuff sagte: Leider funktioniert es nicht wirklich

              Nach einem Blockly-Import muss man erst einmal die richtigen Timer-Variablen bei "clear timeout" und "timeout timeout" zuordnen. Die passen laut Bild nicht.
              Wo werden die Prio-Variablen gesetzt?
              Soll nicht erst die WP und danach die Pumpe ausgeschaltet werden?

              Sorry, hatte das Blockly kurzerhand aus einem größeren Konstrukt herauskopiert. Die Timer sind im Original korrekt.
              Die Prio entsteht durch manuelles Heizen oder Pumpen in einem separaten Skript.

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

                @passuff sagte: in einem separaten Skript.

                Variablen müssen im gleichen Skript gesetzt werden. Andernfalls müssen Datenpunktwerte ausgewertet werden.

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

                  @paul53 sagte in Schalten mit Debounce:

                  @passuff sagte: in einem separaten Skript.

                  Variablen müssen im gleichen Skript gesetzt werden. Andernfalls müssen Datenpunktwerte ausgewertet werden.

                  Ja, ist auch im gleichen Skript. Habe ich mich undeutlich ausgedrückt. Ich meinte einen anderen Trigger.
                  Vielen Dank für deine Anmerkungen - ich habe es so umgesetzt und beobachte mal.

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

                    @paul53 sagte in Schalten mit Debounce:

                    @passuff sagte: in Abhängigkeit von Wassertemperatur und PV Leistung schalten:

                    Ich würde Temperatur und PV-Leistung in getrennten Triggern behandeln.

                    Blockly_temp.JPG

                    Wenn ich die TEmperaturfreigabe vor dem Block prüfe, hilft das beim Einschalten , aber Ausschalten kann ich so nicht.
                    6541ecab-5f3f-49f7-bd78-a99ac63419b9-image.png

                    Mir fällt keine Lösung für eine getrennte Prüfung von Temperatur und PV Leistung ein. Ich würde versuchen es wieder in einer gemeinsamen Prüfung umzusetzen.

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

                    Support us

                    ioBroker
                    Community Adapters
                    Donate

                    580
                    Online

                    31.9k
                    Users

                    80.1k
                    Topics

                    1.3m
                    Posts

                    2
                    8
                    428
                    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