Ankündigung

Einklappen
Keine Ankündigung bisher.

Garagentor Fahrtrichtung

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

    [Codebeispiel] Garagentor Fahrtrichtung

    Hallo zusammen,

    neben dem Dropbox Zugang kämpfe ich mit folgender Aufgabenstellung.

    Ich möchte erkennen und dann als Prowl Nachricht versenden in welche Richtung mein Garagentor fährt. Dazu habe ich ein Item Garagentor, welche OPEN, Closed, Move als Status haben kann. Wenn ich auf Item changed triggere, kann ich dann abfragen wie der Status vorher war??

    wenn Status vorher = closed dann fährt es auf

    Viele Grüße
    Jörg

    #2
    Hi Jörg,

    ja, kannst Du! Unter dem Keyword "previousState" steht Dir der vorherige Zustand zur Verfügung (nur bei "Item changed" Triggern).

    Viele Grüße,
    Kai

    Kommentar


      #3
      Hallo Kai,

      hmm, ich habe dann jetzt folgendes geschrieben:
      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] Garage[/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]Item[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Tor_Garage [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]changed
      then[/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]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]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] changed: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + Tor_Garage.state, [/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]"f55871[U]@api.prowlapp.com[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] [U]fährt[/U] [U]auf[/U]: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [I]now[/I])
      }
      [/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] (Tor_Garage.state == MOVE && previousState == CLOSED) {
      [/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]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] [U]fährt[/U] [U]auf[/U]: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [I]now[/I], [/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]"f55871[U]@api.prowlapp.com[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] [U]fährt[/U] [U]auf[/U]: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [I]now[/I])
      }
      }
      [/SIZE][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] (Tor_Garage.state == OPEN && previousState == MOVE) {
      [/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]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] [U]ist[/U] [U]geöffnet[/U]: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [I]now[/I], [/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]"f55871[U]@api.prowlapp.com[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] [U]ist[/U] [U]geöffnet[/U]: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [I]now[/I])
      }
      }
      [/SIZE][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] (Tor_Garage.state == MOVE && previousState == OPEN) {
      [/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]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] [U]fährt[/U] [U]zu[/U]: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [I]now[/I], [/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]"f55871[U]@api.prowlapp.com[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] [U]fährt[/U] [U]zu[/U]: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [I]now[/I])
      }
      [/SIZE][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] (Tor_Garage.state == CLOSED && previousState == MOVE) {
      [/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]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] [U]ist[/U] [U]geschlossen[/U]: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [I]now[/I], [/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]"f55871[U]@api.prowlapp.com[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] [U]ist[/U] [U]geschlossen[/U]: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [I]now[/I])
      }
      }
      }[/SIZE][/LEFT][SIZE=2]
      [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]end
      [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE]
      Aber: Geht nur zu Teilen, sprich es wird erkannt das der Status sich ändert und dann wird auch die erste Prowl gesendet

      Auszug aus dem Log
      Code:
      2013-03-08 18:34:18 - Tor_Garage_o state updated to OPEN
      2013-03-08 18:34:26 - Tor_Garage_u state updated to CLOSED
       
      2013-03-08 18:34:47 - Tor_Garage_o state updated to OPEN
      2013-03-08 18:34:56 - Tor_Garage_u state updated to CLOSED
       
      2013-03-08 18:35:05 - Tor_Garage_u state updated to OPEN
      2013-03-08 18:35:05 - Tor_Garage state updated to MOVE
       
      2013-03-08 18:35:17 - Tor_Garage_o state updated to OPEN
       
      2013-03-08 18:35:25 - Tor_Garage_o state updated to CLOSED
      2013-03-08 18:35:25 - Tor_Garage state updated to OPEN
       
      2013-03-08 18:35:35 - Tor_Garage_u state updated to OPEN
       
      2013-03-08 18:35:36 - Tor_Garage_o state updated to OPEN
      2013-03-08 18:35:36 - Tor_Garage state updated to MOVE
       
      2013-03-08 18:35:55 - Tor_Garage_u state updated to CLOSED
      2013-03-08 18:35:55 - Tor_Garage state updated to CLOSED
       
      2013-03-08 18:36:06 - Tor_Garage_o state updated to OPEN
      2013-03-08 18:36:25 - Tor_Garage_u state updated to CLOSED
      und wieder darf ich frage: Wo ist mein Denkfehler

      Viele Grüße
      Joerg

      Kommentar


        #4
        müsste previousState nicht Tor_Garage.previousState sein?

        Kommentar


          #5
          Zitat von Travis Beitrag anzeigen
          müsste previousState nicht Tor_Garage.previousState sein?
          Dann zeigt der Designer einen Fehler?!

          Kommentar


            #6
            Zitat von Travis Beitrag anzeigen
            müsste previousState nicht Tor_Garage.previousState sein?
            nein, da in der when-clause schon das entsprechende Item angegeben wird ...
            Visualisierung, Rule/Logic-Engine, Integrationsplattform mit openhab (Supportforum)

            Kommentar


              #7
              Hi,

              und wo genau ist nun Dein Problem?

              Zum debuggen würde ich die Regel übrigens mit Logstatements versehen. Außerdem sind der Status CLOSED und OPEN doch eindeutig. Da muss weiter kein previousState betrachtet werden, oder?

              Code:
              rule "Garage"
              when
                Item Tor_Garage changed
              then
                logDebug("Garage.rule", "Garagentor changed: " + Tor_Garage.state)
              
                if (Tor_Garage.state == OPEN) {
                  logDebug("Garage.rule", "Garagentor ist geöffnet: " + now)
                }
                elseif (Tor_Garage.state == MOVE && previousState == OPEN) {
                  logDebug("Garage.rule", "Garagentor fährt zu: " + now, 2)
                }
                elseif (Tor_Garage.state == CLOSED) {
                  logDebug("Garage.rule", "Garagentor ist geschlossen: " + now)
                }
                else if (Tor_Garage.state == MOVE && previousState == CLOSED) {
                  logDebug("Garage.rule", "Garagentor fährt auf: " + now)
                }
              end
              Gruß,

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

              Kommentar


                #8
                Zitat von teichsta Beitrag anzeigen
                Hi,

                Außerdem sind der Status CLOSED und OPEN doch eindeutig. Da muss weiter kein previousState betrachtet werden, oder?


                Gruß,

                Thomas E.-E.
                Hallo Thomas,

                ja, aber: Ich würde gerne wissen ob das Tor auf oder zu fährt ;-)

                Den Fehler habe ich nun auch gefunden, ein kleiner feiner "Unterschied".

                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] Garage[/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]Item[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Tor_Garage [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]changed
                then[/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]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (Tor_Garage.state == [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"MOVE"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] && previousState == [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"CLOSED"[/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] (![I]pushNotification[/I]([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] [U]fährt[/U] [U]auf[/U]: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [I]now[/I], [/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]"f55871[U]@api.prowlapp.com[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] [U]fährt[/U] [U]auf[/U]: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [I]now[/I])
                }
                }
                [/SIZE][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] (Tor_Garage.state == [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"OPEN"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] && previousState == [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"MOVE"[/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] (![I]pushNotification[/I]([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] [U]ist[/U] [U]geöffnet[/U]: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [I]now[/I], [/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]"f55871[U]@api.prowlapp.com[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] [U]ist[/U] [U]geöffnet[/U]: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [I]now[/I])
                }
                }
                [/SIZE][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] (Tor_Garage.state == [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"MOVE"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] && previousState == [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"OPEN"[/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] (![I]pushNotification[/I]([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] [U]fährt[/U] [U]zu[/U]: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [I]now[/I], [/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]"f55871[U]@api.prowlapp.com[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] [U]fährt[/U] [U]zu[/U]: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [I]now[/I])
                }
                }
                [/SIZE][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] (Tor_Garage.state == [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"CLOSED"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] && previousState == [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"MOVE"[/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] (![I]pushNotification[/I]([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] [U]ist[/U] [U]geschlossen[/U]: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [I]now[/I], [/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]"f55871b[U]@api.prowlapp.com[/U]"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Information"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"[U]Garagentor[/U] [U]ist[/U] [U]geschlossen[/U]: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [I]now[/I])
                }
                }[/SIZE][/LEFT][SIZE=2]
                [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]end
                [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE]
                Kaum sind die Kriterien in Anführungszeichen, geht es.

                Viele Grüße
                Joerg

                Kommentar


                  #9
                  schön!

                  Zitat von JoergA Beitrag anzeigen
                  ja, aber: Ich würde gerne wissen ob das Tor auf oder zu fährt ;-)
                  ja richtig, aber für die Meldung "Tor zu" brauchst Du doch nur die Info, dass das Tor zu ist, oder?

                  Zitat von JoergA Beitrag anzeigen
                  Kaum sind die Kriterien in Anführungszeichen, geht es
                  Das hätte man leichter erkennen können, wenn man den Item-Typ gekannt hätte. Beim nächsten Mal einfach dazulegen?!
                  Visualisierung, Rule/Logic-Engine, Integrationsplattform mit openhab (Supportforum)

                  Kommentar

                  Lädt...
                  X