Ankündigung

Einklappen
Keine Ankündigung bisher.

TimeCron Fehler

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    TimeCron Fehler

    Hallo zusammen,

    ich nutze die Time Cron Funktion um z.B:das Radio im Bad wieder aktiv zu schalten, nachdem es über eine andere Funktion für die Nacht deaktiviert wurde und um z.B. die Rollladen am Morgen nach oben zu fahren. Scheinbar gibt es Probleme mit dem Dienstag, da z.B. heute Morgen weder das Radio an, noch die Rollladen oben waren????

    Die Rules
    Code:
    rule Bad_Radio
    when
        Time cron "0 15 06 ? * 2-6" or
        Time cron "0 15 08 ? * 1,7"
    then
        Radio_Bad.sendCommand(ON)
    end
    Code:
    rule Rollladen_Task
    when
    Time cron "0 30 08 ? * 2-7" orTime cron "0 0 09 ? * 1"
    then
    //Alle Rollladen nach oben
    end
    Ich meine, in der letzten Woche war es der Montag als die Rollladen nicht gefahren sind, kann mich da aber auch irren.

    Laut Doku könnte ich auch MON, TUE, etc verwenden, dies hat aber gar nicht funktioniert :-/

    Wo liegt hier wohl mein Denkfehler????


    Viele Grüße
    Joerg

    #2
    Hallo zusammen,

    leider habe ich immer noch das Problem, dass die Rollladen nicht fahren wie sie sollten
    Ich hatte den Time Cron Aufruf nun geändert und den Wochentag ausgeschrieben und anfänglich schon Hoffnung, dass es nun funktioniert. Denn, die Rollladen sind Montags hochgefahren. Leider aber nur bis Mittwoch und dann am gestrigen Donnerstag und auch heute am Freitag nicht mehr?

    Der von mir derzeit eingesetzte Code
    Code:
    [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]rule[/LEFT][/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT][/LEFT][/COLOR][LEFT][/LEFT][/SIZE][LEFT][/LEFT][/COLOR][LEFT][/LEFT][/SIZE][LEFT][SIZE=2][COLOR=#000000] Rollladen_Task[/COLOR][/SIZE][/LEFT][SIZE=2]
    [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]when[/LEFT]
    [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT][/LEFT][/SIZE][LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]Time[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]cron[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"0 30 08 ? * MON-FRI"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]or[/COLOR][/SIZE][/COLOR][/SIZE][/B][/LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]
    [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT][/LEFT][/SIZE][LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]Time[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]cron[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"0 00 09 ? * SAT,SUN"[/COLOR][/SIZE][/COLOR][/SIZE][/LEFT][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f][LEFT] [/LEFT]
    [/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]then[/LEFT]
    [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT][/LEFT][/SIZE][LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (![I]pushNotification[/I]([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Info[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Rollladen[/U] [U]sollten[/U] [U]fahren[/U] !!"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#7d7d7d][SIZE=2][COLOR=#7d7d7d]2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])) {
    [I]sendMail[/I]([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"1234567b[U]@api.prowlapp.com[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Checkoff[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Rollladen[/U] [U]sollten[/U] [U]fahren[/U] !!"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
    }[/SIZE][/LEFT][SIZE=2]
    [/SIZE][SIZE=2][LEFT][/LEFT][/SIZE][LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (Holiday.state == OFF) {
    [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (![I]pushNotification[/I]([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Info[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Rollladen[/U] [U]fahren[/U] [U]auf[/U] !!"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#7d7d7d][SIZE=2][COLOR=#7d7d7d]2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])) {
    [I]sendMail[/I]([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"1234567b[U]@api.prowlapp.com[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Checkoff[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Rollladen[/U] [U]fahren[/U] [U]auf[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
    }
    Bad_Rollo.[/SIZE][I][SIZE=2][COLOR=#ab3000][SIZE=2][COLOR=#ab3000]sendCommand[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2][COLOR=#ab3000][SIZE=2][COLOR=#ab3000][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2](UP)[/SIZE][/LEFT][SIZE=2]
    [/SIZE][SIZE=2][LEFT]} [/LEFT][/SIZE][LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]else[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (Holiday.state == ON) {
    [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (![I]pushNotification[/I]([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Feiertag[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Rollladen[/U] [U]bleiben[/U] [U]unten[/U] !!"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#7d7d7d][SIZE=2][COLOR=#7d7d7d]2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])) {
    [I]sendMail[/I]([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"1234567b[U]@api.prowlapp.com[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Feiertag[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Rollladen[/U] [U]bleiben[/U] [U]unten[/U] !!"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
    }
    }[/SIZE][/LEFT][SIZE=2]
    [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]end[/LEFT]
    [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE]
    Die Abfrage auf Holiday geht im generellen, sonst ware die Rollladen ja an der anderen Tagen nicht gefahren und auch die erste Info kommt schon nicht??

    Habt Ihr einen Tip oder seht den Fehler???

    Viele Grüße
    Joerg

    Kommentar


      #3
      Hi,

      schonmal vor dem Blick ein den Code ein paar Fragen:

      * steht in Deiner Rule wirklich "Timecron ..."? Müßte es nicht eigentlich "Time cron ..." heißen?
      * könntest Du statt (oder zusätzlich zu) den Notifications mal eine Logausgabe machen? Nur um sicherzustellen, dass nicht nachher die Meldung von XMPP oder Email verschluckt wird?

      Code:
      logDebug("Rolladen.rules", "zu loggender Text ...")
      Könntest Du (nur zum Test) mal die Regel in zwei Regeln eine für MO-FR und eine für SA-SO aufbrechen, um die Oder-Verknüpfung der beiden cron-expressions aus dem "when"-Teil zu entfernen?!

      Gruß,

      Thomas E.-E.
      Visualisierung, Rule/Logic-Engine, Integrationsplattform mit openhab (Supportforum)

      Kommentar


        #4
        Hi,

        es steht natürlich Time cron und ist "schön" lila

        Heute Abend kamm dann noch ein neues Phänomen, die Rollladen waren unten aber ich habe keine Prowl Message erhalten?!

        Den Code habe ich jetzt mal wie folgt geändert.

        Code:
        rule Rollladen_Task_week
        when
            Time cron "0 30 08 ? * MON-FRI"
        then
         logDebug("Rolladen_week", "Rollladen sollten fahren ...")
         if (!pushNotification("Info", "Rollladen sollten fahren !!", 2)) {
         sendMail("1234567[EMAIL="1234567@api.prowlapp.com"]@api.prowlapp.com[/EMAIL]", "Info", "Rollladen sollten fahren !!")
         }
         if (Holiday.state == OFF) {
          logDebug("Rolladen_week", "Rollladen fahren auf !!")
          if (!pushNotification("Info", "Rollladen fahren auf !!", 2)) {
          sendMail("1234567[EMAIL="1234567@api.prowlapp.com"]@api.prowlapp.com[/EMAIL]", "Info", "Rollladen fahren auf")
          }
          Bad_Rollo.sendCommand(UP)
         } else if (Holiday.state == ON) {
          if (!pushNotification("Feiertag", "Rollladen bleiben unten !!", 2)) {
          sendMail("1234567[EMAIL="1234567@api.prowlapp.com"]@api.prowlapp.com[/EMAIL]", "Feiertag", "Rollladen bleiben unten !!")
          }
         }
        end
        rule Rollladen_Task_weekend
        when
            Time cron "0 00 09 ? * SAT,SUN"
        then
         logDebug("Rolladen_weekend", "Rollladen sollten fahren ...")
         if (!pushNotification("Info", "Rollladen sollten fahren ...", 2)) {
         sendMail("1234567[EMAIL="1234567@api.prowlapp.com"]@api.prowlapp.com[/EMAIL]", "Info", "Rollladen sollten fahren ...")
         }
         if (Holiday.state == OFF) {
          logDebug("Rolladen_weekend", "Rollladen fahren auf !!")
          if (!pushNotification("Info", "Rollladen fahren auf !!", 2)) {
          sendMail("1234567[EMAIL="1234567@api.prowlapp.com"]@api.prowlapp.com[/EMAIL]", "Info", "Rollladen fahren auf")
          }
          Bad_Rollo.sendCommand(UP)
         } else if (Holiday.state == ON) {
          if (!pushNotification("Feiertag", "Rollladen bleiben unten !!", 2)) {
          sendMail("1234567@api.prowla[EMAIL="1234567@api.prowlapp.com"]pp.com[/EMAIL]", "Feiertag", "Rollladen bleiben unten !!")
          }
         }
        end
        VG
        Joerg

        Kommentar


          #5
          ok! und das testest Du nun aus? Oder weißt Du schon, ob es geht?!
          Visualisierung, Rule/Logic-Engine, Integrationsplattform mit openhab (Supportforum)

          Kommentar


            #6
            TimeCron Fehler

            Hallo Thomas,

            Ja, werde das jetzt austesten. Da es ja eine tägl. Regel ist, wird der sich leider hinziehen. Auch da der 'Fehler' nur an bestimmten Tagen auftritt. Bisher funktionierte die Kombination der beiden when Abfragen am Wochenende und erwartungsgemäß auch heute nach dem trennen.

            Mal sehen, was die nächsten Tage bringen. Ich werde auf jeden Fall berichten!

            Viele Grüße,
            Jörg


            Sent from my iPad using Tapatalk HD

            Kommentar


              #7
              Hmm, wo finde ich denn die EInträge die mit LogDebug erstellt wurden. Entwedet bin ich zu blind, oder mach etwas nicht ganz richtig.

              VG
              Joerg

              Kommentar


                #8
                in der openhab.log solltest Du Einträge finden, die anfangen mit:

                Code:
                11:35:00.093 DEBUG o.o.model.script.Rolladen_week ...
                ABER NUR DANN, wenn Du den allgemeinen Loglevel auf "Debug" eingestellt hast (siehe logback.xml). Wenn Du openHAB mit start_debug.xxx gestartet hast, wird die logback_debug.xml gezogen, die das Level bereits richtig gesetzt hat.

                Gruß,

                Thomas E.-E.
                Visualisierung, Rule/Logic-Engine, Integrationsplattform mit openhab (Supportforum)

                Kommentar


                  #9
                  Na prima, dann habe ich ja wieder alles falsch gemacht.

                  Trotzdem Danke, für die Zukunft etwas gelernt.

                  Aber auch ohne die Einträge im Log (Ich hatte natürlich OpenHAB normal weiterlaufen) kann ich zu mindestens für die vergangenen Woche Erfolg vermelden. An jedem Tag sind die Rollladen aufgefahren.
                  Also scheint es mit der "or" Verknüpfung nicht zu funktionieren oder ich habe da auch einen Fehler drin??

                  Wie mach ihr den solche time cron Abfragen auf unterschiedliche Tage??

                  Viele Grüße
                  Joerg

                  Kommentar


                    #10
                    Zitat von JoergA Beitrag anzeigen
                    Wie mach ihr den solche time cron Abfragen auf unterschiedliche Tage??
                    das Google Calendar Support (GCalBinding - openhab - Documentation of the Google Calendar IO-Bundle - empowering the smart home - Google Project Hosting) nutzen ;-)
                    Visualisierung, Rule/Logic-Engine, Integrationsplattform mit openhab (Supportforum)

                    Kommentar

                    Lädt...
                    X