Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. [Geklärt] Zeitplan startet nicht

    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

    [Geklärt] Zeitplan startet nicht

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

      Hallo,
      Ich habe für den Wasserstand unseres Teiches ein Blockly
      erstellt, das um 12:00 ein Ventil und die zugehörige Versorgungsspannung
      einschalten soll. Vorher erfolgt eine Prüfung, ob der Wasserstand OK ist oder nicht. Bei Unterschreitung des Wasserstandes ist der GPIO Kontakt auf on. Jetz soll das Ventil öffnen.
      Um 12:30 erfolgt die Abschaltung, egal ob der Wasserstand OK ist oder nicht.
      Die Aktoren für das Ventil und die Versorgungsspannung sind HM Schaltaktoren.

      // Prüfe ob Wasserstand tief
      schedule('{"time":{"exactTime":true,"start":"12:00"},"period":{"days":1}}', function () {
        console.warn('Prüfe Wasserstand');
        if (getState("fhem.0.GPIOWasserstand.state").val == true) {
          console.warn('falls Wasserstand nicht ok und Zeitplan 12:00');
          if (false) {
            console.warn('Wasserstand einschalten');
            setState("hm-rpc.2.OEQ0482307.13.STATE"/*Ventil Wasserstand Teich.STATE*/, true);
            setState("hm-rpc.2.OEQ0482307.15.STATE"/*Ansteuerung Ventile 24V.STATE*/, true);
          }
        }
      });
      
      schedule('{"time":{"exactTime":true,"start":"12:30"},"period":{"days":1}}', function () {
        if (getState("fhem.0.GPIOWasserstand.state").val != false) {
          console.warn('Wasserstand ausschalten');
          setState("hm-rpc.2.OEQ0482307.13.STATE"/*Ventil Wasserstand Teich.STATE*/, false);
          setState("hm-rpc.2.OEQ0482307.15.STATE"/*Ansteuerung Ventile 24V.STATE*/, false);
        }
      });
      

      Ich habe verschiedene Varianten versucht. Aber immer ohne Erfolg.
      Wer kann mir bitte weiter helfen.
      Danke
      Freundliche Grüße
      Michael

      Homoran paul53 2 Replies Last reply Reply Quote 0
      • Homoran
        Homoran Global Moderator Administrators @Altersrentner last edited by

        @Altersrentner sagte in Zeitplan startet nicht:

        schedule('{"time":{"exactTime":true,"start":"12:00"},"period":{"days":1}}',

        Nimm mal bitte den einfachen CRON-Block

        1 Reply Last reply Reply Quote 0
        • A
          Altersrentner last edited by

          Danke für Deine Antwort,
          Das hatte ich auch schon probiert.
          Jetzt noch mal.

          // Prüfe ob Wasserstand tief
          schedule("0 12 * * *", function () {
            console.warn('Prüfe Wasserstand');
            if (getState("fhem.0.GPIOWasserstand.state").val == true) {
              console.warn('falls Wasserstand nicht ok und Zeitplan 12:00');
              if (false) {
                console.warn('Wasserstand einschalten');
                setState("hm-rpc.2.OEQ0482307.13.STATE"/*Ventil Wasserstand Teich.STATE*/, true);
                setState("hm-rpc.2.OEQ0482307.15.STATE"/*Ansteuerung Ventile 24V.STATE*/, true);
              }
            }
          });
          
          schedule("30 12 * * *", function () {
            if (getState("fhem.0.GPIOWasserstand.state").val != false) {
              console.warn('Wasserstand ausschalten');
              setState("hm-rpc.2.OEQ0482307.13.STATE"/*Ventil Wasserstand Teich.STATE*/, false);
              setState("hm-rpc.2.OEQ0482307.15.STATE"/*Ansteuerung Ventile 24V.STATE*/, false);
            }
          });
          

          Bringt auch kein Erfolg.
          Gruß Michael

          Homoran paul53 2 Replies Last reply Reply Quote 0
          • Homoran
            Homoran Global Moderator Administrators @Altersrentner last edited by

            @Altersrentner Zeig mal das Blockly als Bild

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

              @Altersrentner sagte:

              if (false) {                                                                                                                                                                            
              

              Diese Abfrage in Zeile 6 wird nie wahr, also der nachfolgende Teil nie ausgeführt.

              1 Reply Last reply Reply Quote 0
              • A
                Altersrentner @Homoran last edited by

                @Homoran
                Hier ist das gewünschte Bild:Wasserstand.PNG
                Gruß Michael

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

                  @Altersrentner sagte:

                  Vorher erfolgt eine Prüfung, ob der Wasserstand OK ist oder nicht.

                  Warum zweimal ?

                  @Altersrentner sagte in Zeitplan startet nicht:

                  Um 12:30 erfolgt die Abschaltung, egal ob der Wasserstand OK ist oder nicht.

                  Weshalb dann die Abfrage ?

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

                    @paul53 Habe die erste Prüfung entfernt.
                    Ohne Erfolg
                    Wasserstand1.PNG

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

                      @Altersrentner
                      Was ist mit der Abfrage um 12:30 Uhr ?

                      Stimmt die Uhrzeit im System, d.h. ergibt dies hier die richtige Uhrzeit im Log bei Script-Start ?
                      Blockly_temp.JPG

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

                        @paul53 Habe die Zeit ( Log )nur zum Test umgestellt.
                        Wenn das Skript läuft wird der Zeitplan wieder auf 12:00/12::30 umgestellt.
                        Wie jetzt aus dem Log zu sehen ist ein Problem die Uhrzeit. Die muss
                        umgestellt werden. Aber wie?
                        Das zweite Problem der erste Zeitplan prüft nur
                        debug output:falls Wasserstand nicht ok und Zeitplan 12:00)
                        Wasserstand einschalten erfolgt nicht.
                        Der zweite Zeitplan schaltet nach dem Log ab. Das sollte funktionieren.
                        Wie kann ich nun den ersten Zeitplan zum Laufen bekommen.
                        Gruß Michael
                        Wasserstand LogPNG.PNG

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

                          @Altersrentner sagte:

                          Uhrzeit. Die muss umgestellt werden. Aber wie?

                          Dein OS (welches ?) hat die falsche Zeitzone.

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

                            @paul53 "Dein OS (welches ?) hat die falsche Zeitzone."
                            Tut mir leid😧 😧
                            Was ist das, Höre ich das erste mal.

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

                              @Altersrentner
                              Unter welchem Betriebssystem (Windows, Raspbian, Ubuntu, ...) läuft ioBroker ?

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

                                @paul53
                                Raspbian

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

                                  @Altersrentner
                                  Was sagt auf der Console (SSH) ?

                                  timedatectl
                                  
                                  A 1 Reply Last reply Reply Quote 0
                                  • A
                                    Altersrentner @paul53 last edited by Altersrentner

                                    @paul53

                                    pi@raspberrypi:~ $ timedatectl
                                                   Local time: Sat 2020-04-18 16:37:52 BST
                                               Universal time: Sat 2020-04-18 15:37:52 UTC
                                                     RTC time: n/a
                                                    Time zone: Europe/London (BST, +0100)
                                    System clock synchronized: yes
                                                  NTP service: active
                                              RTC in local TZ: no
                                    pi@raspberrypi:~ $
                                    
                                    ```Das ergibt den Zeitunterschied
                                    paul53 1 Reply Last reply Reply Quote 0
                                    • paul53
                                      paul53 @Altersrentner last edited by

                                      @Altersrentner
                                      Ja, London ist die falsche Zeitzone. Korrektur:

                                      sudo timedatectl set-timezone Europe/Berlin
                                      
                                      A 1 Reply Last reply Reply Quote 0
                                      • A
                                        Altersrentner @paul53 last edited by

                                        @paul53
                                        muss ich ioBroker vorher stoppen?

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

                                          @Altersrentner sagte:

                                          muss ich ioBroker vorher stoppen?

                                          Ich sage mal so: Es schadet nicht und so kannst Du sicher sein, dass beim Neustart auch alle Komponenten von ioBroker die Änderung mitbekommen.

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

                                            @paul53
                                            ist geändert

                                            pi@raspberrypi:~ $ iobroker stop
                                            pi@raspberrypi:~ $ sudo timedatectl set-timezone Europe/Berlin
                                            pi@raspberrypi:~ $ iobroker start
                                            pi@raspberrypi:~ $ timedatectl
                                                           Local time: Sat 2020-04-18 17:51:17 CEST
                                                       Universal time: Sat 2020-04-18 15:51:17 UTC
                                                             RTC time: n/a
                                                            Time zone: Europe/Berlin (CEST, +0200)
                                            System clock synchronized: yes
                                                          NTP service: active
                                                      RTC in local TZ: no
                                            pi@raspberrypi:~ $
                                            
                                            
                                            paul53 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            727
                                            Online

                                            31.9k
                                            Users

                                            80.1k
                                            Topics

                                            1.3m
                                            Posts

                                            blockly javascript monitoring
                                            3
                                            36
                                            1819
                                            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