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. Schwimmer träge machen???

NEWS

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

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

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    25
    1
    2.0k

Schwimmer träge machen???

Geplant Angeheftet Gesperrt Verschoben Blockly
60 Beiträge 3 Kommentatoren 3.8k Aufrufe 3 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.
  • FredFF FredF

    @Aphofis
    Entpreller?
    Das nutze ich für meinen Briefkasten. Mit dem Timeout wird die "Reaktionszeit" eingestellt:
    80735c59-bbc3-4ef6-81a0-41ca97bb5bdf-grafik.png

    paul53P Offline
    paul53P Offline
    paul53
    schrieb am zuletzt editiert von
    #3

    @FredF sagte:

    Entpreller?

    Ja, entprellen sollte helfen.

    Blockly_temp.JPG

    Nicht wundern: Bevor auf die Variable timeout zugegriffen werden kann, muss erst die Verzögerung und eine Dummy-Variable erzeugt werden.

    Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
    Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

    AphofisA 1 Antwort Letzte Antwort
    1
    • paul53P paul53

      @FredF sagte:

      Entpreller?

      Ja, entprellen sollte helfen.

      Blockly_temp.JPG

      Nicht wundern: Bevor auf die Variable timeout zugegriffen werden kann, muss erst die Verzögerung und eine Dummy-Variable erzeugt werden.

      AphofisA Offline
      AphofisA Offline
      Aphofis
      schrieb am zuletzt editiert von
      #4

      @paul53
      also könnte ich das so realisieren ???

      <xml xmlns="http://www.w3.org/1999/xhtml">
        <variables>
          <variable type="" id="m)7Im6q=OM@`E$B^zJA8">Entpreller</variable>
          <variable type="undefined" id="timeout">timeout</variable>
        </variables>
        <block type="variables_set" id="cZx[D;c!8dg?hRD%Cg?C" x="-1638" y="-862">
          <field name="VAR" id="m)7Im6q=OM@`E$B^zJA8" variabletype="">Entpreller</field>
          <value name="VALUE">
            <block type="math_number" id="IEej!n.DBgjZpSIu?V6l">
              <field name="NUM">0</field>
            </block>
          </value>
          <next>
            <block type="on" id="NpCJd9st%*${~aYJ98s_">
              <field name="OID">sonoff.0.Aqua_Float.POWER3</field>
              <field name="CONDITION">gt</field>
              <field name="ACK_CONDITION"></field>
              <statement name="STATEMENT">
                <block type="controls_if" id="{6HESZ~.#;Tt=Qu7~LSG">
                  <value name="IF0">
                    <block type="logic_operation" id="I@jN(=SGo3[x{rE!}IGF" inline="false">
                      <field name="OP">AND</field>
                      <value name="A">
                        <block type="logic_compare" id="mjT6Z`Ol_zp?c%RdLO:`">
                          <field name="OP">EQ</field>
                          <value name="A">
                            <block type="variables_get" id=")@y(-D~Du-s~Al}sBS3x">
                              <field name="VAR" id="m)7Im6q=OM@`E$B^zJA8" variabletype="">Entpreller</field>
                            </block>
                          </value>
                          <value name="B">
                            <block type="math_number" id="Bg|**1#RYqGr;wlEm;*s">
                              <field name="NUM">0</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <value name="B">
                        <block type="logic_compare" id="S!Dj!NhgM6U+[TS1?VS$">
                          <field name="OP">EQ</field>
                          <value name="A">
                            <block type="on_source" id=",D4B1|wSr6}o9K.nAxZR">
                              <field name="ATTR">state.val</field>
                            </block>
                          </value>
                          <value name="B">
                            <block type="logic_boolean" id="ALsBR.mLXLdrn|9vvlCQ">
                              <field name="BOOL">TRUE</field>
                            </block>
                          </value>
                        </block>
                      </value>
                    </block>
                  </value>
                  <statement name="DO0">
                    <block type="variables_set" id="j9bqc1L@RRUY0N`KI_CP">
                      <field name="VAR" id="m)7Im6q=OM@`E$B^zJA8" variabletype="">Entpreller</field>
                      <value name="VALUE">
                        <block type="math_number" id="I/5qJ9],h_LPd_wcT!3J">
                          <field name="NUM">1</field>
                        </block>
                      </value>
                      <next>
                        <block type="control" id="VnjQxNIYwLDlo[I%P%ir">
                          <mutation delay_input="false"></mutation>
                          <field name="OID">sonoff.0.Aqua_Control.POWER2</field>
                          <field name="WITH_DELAY">FALSE</field>
                          <value name="VALUE">
                            <block type="logic_boolean" id="4B!lWyTt6#V^uhJLbS2V">
                              <field name="BOOL">TRUE</field>
                            </block>
                          </value>
                          <next>
                            <block type="timeouts_settimeout" id="ds(P.J-;H|$.}q4@${q7">
                              <field name="NAME">timeout</field>
                              <field name="DELAY">2</field>
                              <field name="UNIT">sec</field>
                              <statement name="STATEMENT">
                                <block type="variables_set" id="|4xmLfQou}Qm,nl}:W?@">
                                  <field name="VAR" id="m)7Im6q=OM@`E$B^zJA8" variabletype="">Entpreller</field>
                                  <value name="VALUE">
                                    <block type="math_number" id="VkR;uUUm~0YKAg{R:vOk">
                                      <field name="NUM">0</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="control" id="`-{Ks@NkjVxcq_oMUiWO">
                                      <mutation delay_input="false"></mutation>
                                      <field name="OID">sonoff.0.Aqua_Control.POWER2</field>
                                      <field name="WITH_DELAY">FALSE</field>
                                      <value name="VALUE">
                                        <block type="logic_boolean" id="_]ypttal!yH89J7?)A-e">
                                          <field name="BOOL">FALSE</field>
                                        </block>
                                      </value>
                                    </block>
                                  </next>
                                </block>
                              </statement>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </statement>
                </block>
              </statement>
            </block>
          </next>
        </block>
      </xml>
      

      Bildschirmfoto 2019-09-09 um 13.26.55.png

      var Entpreller, timeout;
      
      
      Entpreller = 0;
      on({id: "sonoff.0.Aqua_Float.POWER3"/*Vliesfilter_Normal*/, change: "gt"}, function (obj) {
        var value = obj.state.val;
        var oldValue = obj.oldState.val;
        if (Entpreller == 0 && (obj.state ? obj.state.val : "") == true) {
          Entpreller = 1;
          setState("sonoff.0.Aqua_Control.POWER2"/*Vliesmotor*/, true);
          timeout = setTimeout(function () {
            Entpreller = 0;
            setState("sonoff.0.Aqua_Control.POWER2"/*Vliesmotor*/, false);
          }, 2000);
        }
      });
      
      paul53P 1 Antwort Letzte Antwort
      0
      • AphofisA Aphofis

        @paul53
        also könnte ich das so realisieren ???

        <xml xmlns="http://www.w3.org/1999/xhtml">
          <variables>
            <variable type="" id="m)7Im6q=OM@`E$B^zJA8">Entpreller</variable>
            <variable type="undefined" id="timeout">timeout</variable>
          </variables>
          <block type="variables_set" id="cZx[D;c!8dg?hRD%Cg?C" x="-1638" y="-862">
            <field name="VAR" id="m)7Im6q=OM@`E$B^zJA8" variabletype="">Entpreller</field>
            <value name="VALUE">
              <block type="math_number" id="IEej!n.DBgjZpSIu?V6l">
                <field name="NUM">0</field>
              </block>
            </value>
            <next>
              <block type="on" id="NpCJd9st%*${~aYJ98s_">
                <field name="OID">sonoff.0.Aqua_Float.POWER3</field>
                <field name="CONDITION">gt</field>
                <field name="ACK_CONDITION"></field>
                <statement name="STATEMENT">
                  <block type="controls_if" id="{6HESZ~.#;Tt=Qu7~LSG">
                    <value name="IF0">
                      <block type="logic_operation" id="I@jN(=SGo3[x{rE!}IGF" inline="false">
                        <field name="OP">AND</field>
                        <value name="A">
                          <block type="logic_compare" id="mjT6Z`Ol_zp?c%RdLO:`">
                            <field name="OP">EQ</field>
                            <value name="A">
                              <block type="variables_get" id=")@y(-D~Du-s~Al}sBS3x">
                                <field name="VAR" id="m)7Im6q=OM@`E$B^zJA8" variabletype="">Entpreller</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="math_number" id="Bg|**1#RYqGr;wlEm;*s">
                                <field name="NUM">0</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <value name="B">
                          <block type="logic_compare" id="S!Dj!NhgM6U+[TS1?VS$">
                            <field name="OP">EQ</field>
                            <value name="A">
                              <block type="on_source" id=",D4B1|wSr6}o9K.nAxZR">
                                <field name="ATTR">state.val</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="logic_boolean" id="ALsBR.mLXLdrn|9vvlCQ">
                                <field name="BOOL">TRUE</field>
                              </block>
                            </value>
                          </block>
                        </value>
                      </block>
                    </value>
                    <statement name="DO0">
                      <block type="variables_set" id="j9bqc1L@RRUY0N`KI_CP">
                        <field name="VAR" id="m)7Im6q=OM@`E$B^zJA8" variabletype="">Entpreller</field>
                        <value name="VALUE">
                          <block type="math_number" id="I/5qJ9],h_LPd_wcT!3J">
                            <field name="NUM">1</field>
                          </block>
                        </value>
                        <next>
                          <block type="control" id="VnjQxNIYwLDlo[I%P%ir">
                            <mutation delay_input="false"></mutation>
                            <field name="OID">sonoff.0.Aqua_Control.POWER2</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="logic_boolean" id="4B!lWyTt6#V^uhJLbS2V">
                                <field name="BOOL">TRUE</field>
                              </block>
                            </value>
                            <next>
                              <block type="timeouts_settimeout" id="ds(P.J-;H|$.}q4@${q7">
                                <field name="NAME">timeout</field>
                                <field name="DELAY">2</field>
                                <field name="UNIT">sec</field>
                                <statement name="STATEMENT">
                                  <block type="variables_set" id="|4xmLfQou}Qm,nl}:W?@">
                                    <field name="VAR" id="m)7Im6q=OM@`E$B^zJA8" variabletype="">Entpreller</field>
                                    <value name="VALUE">
                                      <block type="math_number" id="VkR;uUUm~0YKAg{R:vOk">
                                        <field name="NUM">0</field>
                                      </block>
                                    </value>
                                    <next>
                                      <block type="control" id="`-{Ks@NkjVxcq_oMUiWO">
                                        <mutation delay_input="false"></mutation>
                                        <field name="OID">sonoff.0.Aqua_Control.POWER2</field>
                                        <field name="WITH_DELAY">FALSE</field>
                                        <value name="VALUE">
                                          <block type="logic_boolean" id="_]ypttal!yH89J7?)A-e">
                                            <field name="BOOL">FALSE</field>
                                          </block>
                                        </value>
                                      </block>
                                    </next>
                                  </block>
                                </statement>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </statement>
                  </block>
                </statement>
              </block>
            </next>
          </block>
        </xml>
        

        Bildschirmfoto 2019-09-09 um 13.26.55.png

        var Entpreller, timeout;
        
        
        Entpreller = 0;
        on({id: "sonoff.0.Aqua_Float.POWER3"/*Vliesfilter_Normal*/, change: "gt"}, function (obj) {
          var value = obj.state.val;
          var oldValue = obj.oldState.val;
          if (Entpreller == 0 && (obj.state ? obj.state.val : "") == true) {
            Entpreller = 1;
            setState("sonoff.0.Aqua_Control.POWER2"/*Vliesmotor*/, true);
            timeout = setTimeout(function () {
              Entpreller = 0;
              setState("sonoff.0.Aqua_Control.POWER2"/*Vliesmotor*/, false);
            }, 2000);
          }
        });
        
        paul53P Offline
        paul53P Offline
        paul53
        schrieb am zuletzt editiert von
        #5

        @Aphofis sagte:

        also könnte ich das so realisieren ???

        Soll der Vliesmotor wirklich schon nach 2 s wieder abschalten ?

        Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
        Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

        AphofisA 1 Antwort Letzte Antwort
        0
        • paul53P paul53

          @Aphofis sagte:

          also könnte ich das so realisieren ???

          Soll der Vliesmotor wirklich schon nach 2 s wieder abschalten ?

          AphofisA Offline
          AphofisA Offline
          Aphofis
          schrieb am zuletzt editiert von Aphofis
          #6

          @paul53
          Naja er soll nur anspringen wenn der Schwimmer definitiv im true zustand ist und dann auch nur so lange bis der schwimmer auf false wechselt. Da durch Einströmendes Wasseer dieser Zustand schwer zu ermitteln ist, wäre so eine entprellung schon gut, damit der Motor nicht immer nur für ein paar millisekunden anspringt und im Enteffekt garnicht gedreht wird.
          Vlies Schwimmer Video
          Wenn die Server Qualität ausreicht ist vielleicht ein Video ganz hilfreich, damit man es sich besser vorstellen kann, was ich mit dem schwankendem Wasser meine. links der große Schwimmer ist für Vliesfilter Max und der kleine in der mitte ist der Schwimmer der den Vliesmotor betätigen soll. Der aber ständig angetippt wird durch das Wasser.

          paul53P 1 Antwort Letzte Antwort
          0
          • AphofisA Aphofis

            @paul53
            Naja er soll nur anspringen wenn der Schwimmer definitiv im true zustand ist und dann auch nur so lange bis der schwimmer auf false wechselt. Da durch Einströmendes Wasseer dieser Zustand schwer zu ermitteln ist, wäre so eine entprellung schon gut, damit der Motor nicht immer nur für ein paar millisekunden anspringt und im Enteffekt garnicht gedreht wird.
            Vlies Schwimmer Video
            Wenn die Server Qualität ausreicht ist vielleicht ein Video ganz hilfreich, damit man es sich besser vorstellen kann, was ich mit dem schwankendem Wasser meine. links der große Schwimmer ist für Vliesfilter Max und der kleine in der mitte ist der Schwimmer der den Vliesmotor betätigen soll. Der aber ständig angetippt wird durch das Wasser.

            paul53P Offline
            paul53P Offline
            paul53
            schrieb am zuletzt editiert von
            #7

            @Aphofis sagte:

            wenn der Schwimmer definitiv im true zustand ist und dann auch nur so lange bis der schwimmer auf false wechselt.

            Dann würde ich erst schalten, wenn der Schwimmerschalter für eine bestimmte Zeit einen konstanten Wert hat, also so:

            Blockly_temp.JPG

            Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
            Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

            1 Antwort Letzte Antwort
            1
            • FredFF FredF

              @Aphofis
              Entpreller?
              Das nutze ich für meinen Briefkasten. Mit dem Timeout wird die "Reaktionszeit" eingestellt:
              80735c59-bbc3-4ef6-81a0-41ca97bb5bdf-grafik.png

              paul53P Offline
              paul53P Offline
              paul53
              schrieb am zuletzt editiert von
              #8

              @FredF
              Wenn auf "ist größer als letztes" getriggert wird, kann die Abfrage "und Wert = wahr" entfallen, denn sie ist bereits in der Triggerbedingung enthalten.

              Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
              Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

              AphofisA 1 Antwort Letzte Antwort
              2
              • paul53P paul53

                @FredF
                Wenn auf "ist größer als letztes" getriggert wird, kann die Abfrage "und Wert = wahr" entfallen, denn sie ist bereits in der Triggerbedingung enthalten.

                AphofisA Offline
                AphofisA Offline
                Aphofis
                schrieb am zuletzt editiert von Aphofis
                #9

                @paul53
                OK ich teste mal

                1 Antwort Letzte Antwort
                0
                • AphofisA Offline
                  AphofisA Offline
                  Aphofis
                  schrieb am zuletzt editiert von
                  #10

                  Das ja mal sehr simpel! aufgebaut

                  1 Antwort Letzte Antwort
                  0
                  • AphofisA Offline
                    AphofisA Offline
                    Aphofis
                    schrieb am zuletzt editiert von
                    #11

                    Wann wird dann der Motor eingeschaltet wenn schwimmer 2 sek. auf true steht und wann wird der Motor wieder abgeschaltet!?

                    paul53P 1 Antwort Letzte Antwort
                    0
                    • AphofisA Aphofis

                      Wann wird dann der Motor eingeschaltet wenn schwimmer 2 sek. auf true steht und wann wird der Motor wieder abgeschaltet!?

                      paul53P Offline
                      paul53P Offline
                      paul53
                      schrieb am zuletzt editiert von
                      #12

                      @Aphofis sagte:

                      wann wird der Motor wieder abgeschaltet!?

                      Wenn der Schwimmer 2 s lang auf false stand.

                      Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                      Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                      AphofisA 1 Antwort Letzte Antwort
                      0
                      • paul53P paul53

                        @Aphofis sagte:

                        wann wird der Motor wieder abgeschaltet!?

                        Wenn der Schwimmer 2 s lang auf false stand.

                        AphofisA Offline
                        AphofisA Offline
                        Aphofis
                        schrieb am zuletzt editiert von
                        #13

                        @paul53 ok!

                        1 Antwort Letzte Antwort
                        0
                        • AphofisA Offline
                          AphofisA Offline
                          Aphofis
                          schrieb am zuletzt editiert von
                          #14

                          ist es vielleicht möglich diese beiden steuerungen zusammen zu führen ?
                          Damit der motor nur dreht wenn wirklich true ist und auch nicht mehr als 50 cm am Tag

                          var Restzeit, Vliesmotor_Kontrolle, Vliesmotor_Kontrolle;
                          
                          /**
                           * Beschreibe diese Funktion …
                           */
                          function Vliesmotor_Ein() {
                            if (!Vliesmotor_Kontrolle && Restzeit > 0) {
                              Vliesmotor_Kontrolle = setInterval(function () {
                                if (Restzeit > 0 && getState("sonoff.0.Aqua_Float.POWER3").val) {
                                  Restzeit = (typeof Restzeit == 'number' ? Restzeit : 0) + -1;
                                } else {
                                  setState("sonoff.0.Aqua_Control.POWER2"/*Vliesmotor*/, false);
                                  (function () {if (Vliesmotor_Kontrolle) {clearInterval(Vliesmotor_Kontrolle); Vliesmotor_Kontrolle = null;}})();
                                }
                              }, 2000);
                              setState("sonoff.0.Aqua_Control.POWER2"/*Vliesmotor*/, true);
                            }
                          }
                          
                          
                          Restzeit = 25;
                          Vliesmotor_Kontrolle = null;
                          
                          on({id: 'sonoff.0.Aqua_Float.POWER3', change: "gt"}, function (obj) {
                            var value = obj.state.val;
                            var oldValue = obj.oldState.val;
                            Vliesmotor_Ein();
                          });
                          schedule("0 0 * * *", function () {
                            Restzeit = 25;
                            if (getState("sonoff.0.Aqua_Float.POWER3").val) {
                              Vliesmotor_Ein();
                            }
                          });
                          
                          var timeout;
                          
                          
                          on({id: "sonoff.0.Aqua_Float.POWER3"/*Vliesfilter_Normal*/, change: "ne"}, function (obj) {
                            var value = obj.state.val;
                            var oldValue = obj.oldState.val;
                            (function () {if (timeout) {clearTimeout(timeout); timeout = null;}})();
                            timeout = setTimeout(function () {
                              setState("sonoff.0.Aqua_Control.POWER2"/*Vliesmotor*/, (obj.state ? obj.state.val : ""));
                            }, 2000);
                          });
                          
                          
                          paul53P 1 Antwort Letzte Antwort
                          0
                          • AphofisA Aphofis

                            ist es vielleicht möglich diese beiden steuerungen zusammen zu führen ?
                            Damit der motor nur dreht wenn wirklich true ist und auch nicht mehr als 50 cm am Tag

                            var Restzeit, Vliesmotor_Kontrolle, Vliesmotor_Kontrolle;
                            
                            /**
                             * Beschreibe diese Funktion …
                             */
                            function Vliesmotor_Ein() {
                              if (!Vliesmotor_Kontrolle && Restzeit > 0) {
                                Vliesmotor_Kontrolle = setInterval(function () {
                                  if (Restzeit > 0 && getState("sonoff.0.Aqua_Float.POWER3").val) {
                                    Restzeit = (typeof Restzeit == 'number' ? Restzeit : 0) + -1;
                                  } else {
                                    setState("sonoff.0.Aqua_Control.POWER2"/*Vliesmotor*/, false);
                                    (function () {if (Vliesmotor_Kontrolle) {clearInterval(Vliesmotor_Kontrolle); Vliesmotor_Kontrolle = null;}})();
                                  }
                                }, 2000);
                                setState("sonoff.0.Aqua_Control.POWER2"/*Vliesmotor*/, true);
                              }
                            }
                            
                            
                            Restzeit = 25;
                            Vliesmotor_Kontrolle = null;
                            
                            on({id: 'sonoff.0.Aqua_Float.POWER3', change: "gt"}, function (obj) {
                              var value = obj.state.val;
                              var oldValue = obj.oldState.val;
                              Vliesmotor_Ein();
                            });
                            schedule("0 0 * * *", function () {
                              Restzeit = 25;
                              if (getState("sonoff.0.Aqua_Float.POWER3").val) {
                                Vliesmotor_Ein();
                              }
                            });
                            
                            var timeout;
                            
                            
                            on({id: "sonoff.0.Aqua_Float.POWER3"/*Vliesfilter_Normal*/, change: "ne"}, function (obj) {
                              var value = obj.state.val;
                              var oldValue = obj.oldState.val;
                              (function () {if (timeout) {clearTimeout(timeout); timeout = null;}})();
                              timeout = setTimeout(function () {
                                setState("sonoff.0.Aqua_Control.POWER2"/*Vliesmotor*/, (obj.state ? obj.state.val : ""));
                              }, 2000);
                            });
                            
                            
                            paul53P Offline
                            paul53P Offline
                            paul53
                            schrieb am zuletzt editiert von paul53
                            #15

                            @Aphofis sagte:

                            ist es vielleicht möglich diese beiden steuerungen zusammen zu führen ?

                            Ist es.

                            const idSchwimmer = 'sonoff.0.Aqua_Float.POWER3';
                            const idMotor     = 'sonoff.0.Aqua_Control.POWER2';
                            
                            var schwimmer = getState(idSchwimmer).val;
                            var restzeit  = 25;
                            var entprell  = null;
                            var intervall = null;
                            
                            function Vliesmotor() {
                              if(schwimmer) {
                                if (!intervall && restzeit > 0) {
                                  setState(idMotor, true);
                                  intervall = setInterval(function () {
                                    if (restzeit > 0 && schwimmer) {
                                      restzeit--;
                                    } else {
                                      setState(idMotor, false);
                                      clearInterval(intervall); 
                                      intervall = null;
                                    }
                                  }, 2000);
                                }
                              } else if(getState(idMotor).val) setState(idMotor, false);	
                            }
                            
                            Vliesmotor(); // Skriptstart
                            
                            on(idSchwimmer, function(dp) {
                              if(entprell) clearTimeout(entprell);
                              entprell = setTimeout(function() {
                                 schwimmer = dp.state.val;	
                                 Vliesmotor();
                              }, 2000);
                            });
                            
                            schedule('0 0 * * *', function () {
                              restzeit = 25;
                              Vliesmotor();
                            });
                            

                            Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                            Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                            AphofisA 1 Antwort Letzte Antwort
                            1
                            • paul53P paul53

                              @Aphofis sagte:

                              ist es vielleicht möglich diese beiden steuerungen zusammen zu führen ?

                              Ist es.

                              const idSchwimmer = 'sonoff.0.Aqua_Float.POWER3';
                              const idMotor     = 'sonoff.0.Aqua_Control.POWER2';
                              
                              var schwimmer = getState(idSchwimmer).val;
                              var restzeit  = 25;
                              var entprell  = null;
                              var intervall = null;
                              
                              function Vliesmotor() {
                                if(schwimmer) {
                                  if (!intervall && restzeit > 0) {
                                    setState(idMotor, true);
                                    intervall = setInterval(function () {
                                      if (restzeit > 0 && schwimmer) {
                                        restzeit--;
                                      } else {
                                        setState(idMotor, false);
                                        clearInterval(intervall); 
                                        intervall = null;
                                      }
                                    }, 2000);
                                  }
                                } else if(getState(idMotor).val) setState(idMotor, false);	
                              }
                              
                              Vliesmotor(); // Skriptstart
                              
                              on(idSchwimmer, function(dp) {
                                if(entprell) clearTimeout(entprell);
                                entprell = setTimeout(function() {
                                   schwimmer = dp.state.val;	
                                   Vliesmotor();
                                }, 2000);
                              });
                              
                              schedule('0 0 * * *', function () {
                                restzeit = 25;
                                Vliesmotor();
                              });
                              
                              AphofisA Offline
                              AphofisA Offline
                              Aphofis
                              schrieb am zuletzt editiert von
                              #16

                              @paul53
                              Magst du das in Blockly Blöcken hier rein packen???
                              Danke

                              paul53P 1 Antwort Letzte Antwort
                              0
                              • AphofisA Aphofis

                                @paul53
                                Magst du das in Blockly Blöcken hier rein packen???
                                Danke

                                paul53P Offline
                                paul53P Offline
                                paul53
                                schrieb am zuletzt editiert von
                                #17

                                @Aphofis

                                Blockly_Vlies.JPG

                                Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                                Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                                AphofisA 1 Antwort Letzte Antwort
                                0
                                • paul53P paul53

                                  @Aphofis

                                  Blockly_Vlies.JPG

                                  AphofisA Offline
                                  AphofisA Offline
                                  Aphofis
                                  schrieb am zuletzt editiert von
                                  #18

                                  @paul53
                                  Dankeschön

                                  1 Antwort Letzte Antwort
                                  0
                                  • AphofisA Offline
                                    AphofisA Offline
                                    Aphofis
                                    schrieb am zuletzt editiert von Aphofis
                                    #19

                                    Ist es so korrekt ???

                                    var schwimmer, restzeit, Intervall, timeout, Intervall;
                                    
                                    /**
                                     * Beschreibe diese Funktion …
                                     */
                                    function Vliesmotor() {
                                      if (schwimmer) {
                                        if (!Intervall && restzeit > 0) {
                                          setState("sonoff.0.Aqua_Control.POWER2"/*Vliesmotor*/, true);
                                          Intervall = setInterval(function () {
                                            if (restzeit > 0 && schwimmer) {
                                              Intervall = (typeof Intervall == 'number' ? Intervall : 0) - 1;
                                            } else {
                                              setState("sonoff.0.Aqua_Control.POWER2"/*Vliesmotor*/, false);
                                              (function () {if (Intervall) {clearInterval(Intervall); Intervall = null;}})();
                                            }
                                          }, 2000);
                                        }
                                      } else if (getState("sonoff.0.Aqua_Control.POWER2").val) {
                                        setState("sonoff.0.Aqua_Control.POWER2"/*Vliesmotor*/, false);
                                      }
                                    }
                                    
                                    
                                    schwimmer = getState("sonoff.0.Aqua_Float.POWER3").val;
                                    restzeit = 25;
                                    on({id: 'sonoff.0.Aqua_Float.POWER3', change: "ne"}, function (obj) {
                                      var value = obj.state.val;
                                      var oldValue = obj.oldState.val;
                                      (function () {if (timeout) {clearTimeout(timeout); timeout = null;}})();
                                      timeout = setTimeout(function () {
                                        schwimmer = (obj.state ? obj.state.val : "");
                                        Vliesmotor();
                                      }, 2000);
                                    });
                                    schedule("0 0 * * *", function () {
                                      restzeit = 25;
                                      Vliesmotor();
                                    });
                                    Vliesmotor();
                                    
                                    paul53P 1 Antwort Letzte Antwort
                                    0
                                    • AphofisA Aphofis

                                      Ist es so korrekt ???

                                      var schwimmer, restzeit, Intervall, timeout, Intervall;
                                      
                                      /**
                                       * Beschreibe diese Funktion …
                                       */
                                      function Vliesmotor() {
                                        if (schwimmer) {
                                          if (!Intervall && restzeit > 0) {
                                            setState("sonoff.0.Aqua_Control.POWER2"/*Vliesmotor*/, true);
                                            Intervall = setInterval(function () {
                                              if (restzeit > 0 && schwimmer) {
                                                Intervall = (typeof Intervall == 'number' ? Intervall : 0) - 1;
                                              } else {
                                                setState("sonoff.0.Aqua_Control.POWER2"/*Vliesmotor*/, false);
                                                (function () {if (Intervall) {clearInterval(Intervall); Intervall = null;}})();
                                              }
                                            }, 2000);
                                          }
                                        } else if (getState("sonoff.0.Aqua_Control.POWER2").val) {
                                          setState("sonoff.0.Aqua_Control.POWER2"/*Vliesmotor*/, false);
                                        }
                                      }
                                      
                                      
                                      schwimmer = getState("sonoff.0.Aqua_Float.POWER3").val;
                                      restzeit = 25;
                                      on({id: 'sonoff.0.Aqua_Float.POWER3', change: "ne"}, function (obj) {
                                        var value = obj.state.val;
                                        var oldValue = obj.oldState.val;
                                        (function () {if (timeout) {clearTimeout(timeout); timeout = null;}})();
                                        timeout = setTimeout(function () {
                                          schwimmer = (obj.state ? obj.state.val : "");
                                          Vliesmotor();
                                        }, 2000);
                                      });
                                      schedule("0 0 * * *", function () {
                                        restzeit = 25;
                                        Vliesmotor();
                                      });
                                      Vliesmotor();
                                      
                                      paul53P Offline
                                      paul53P Offline
                                      paul53
                                      schrieb am zuletzt editiert von
                                      #20

                                      @Aphofis sagte:

                                      Ist es so korrekt ???

                                      Nicht ganz: Du hast zwei Variablen Intervall und zählst eine davon runter anstelle von restzeit (Zeile 12).

                                      Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                                      Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                                      AphofisA 1 Antwort Letzte Antwort
                                      0
                                      • paul53P paul53

                                        @Aphofis sagte:

                                        Ist es so korrekt ???

                                        Nicht ganz: Du hast zwei Variablen Intervall und zählst eine davon runter anstelle von restzeit (Zeile 12).

                                        AphofisA Offline
                                        AphofisA Offline
                                        Aphofis
                                        schrieb am zuletzt editiert von
                                        #21

                                        @paul53
                                        also so ???Bildschirmfoto 2019-09-10 um 13.05.43.png

                                        paul53P 1 Antwort Letzte Antwort
                                        0
                                        • AphofisA Aphofis

                                          @paul53
                                          also so ???Bildschirmfoto 2019-09-10 um 13.05.43.png

                                          paul53P Offline
                                          paul53P Offline
                                          paul53
                                          schrieb am zuletzt editiert von
                                          #22

                                          @Aphofis sagte in Schwimmer träge machen???:

                                          also so ???

                                          Nein: erhöhe restzeit um -1

                                          Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                                          Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                                          AphofisA 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

                                          744

                                          Online

                                          32.6k

                                          Benutzer

                                          82.0k

                                          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