Difference between revisions of "Push Services/de"

From meteoplug
Jump to: navigation, search
(Updating to match new version of source page)
Line 1: Line 1:
<languages /><br />Meteobridge stellt eine reihe von individualisierbaren Sendedienste zur Verfügung, die auf verschiedene Arten Wetterdaten an andere Systeme weiterleiten können. Zu den Standardmethoden gehört der zeitgesteuerte Versand von E-Mails und Twitter-Nachrichten mit aktuellen Wetterdaten sowie eine Alarmierungsfunktion, die beim Erreichen individuelle definierbarer Schwellwerte Meldungen per E-Mail oder Twitter versendet.  
+
<languages />__NOTOC__
 +
<br />
 +
Meteobridge provides some additional "push services", which can distribute weather information to you via email, twitter, HTTP requests, FTP uploads, mysql queries or by invoking a user defined script. All these services can be triggered by certain alarm conditions, at a certain time of the day or in periodic intervals ranging from a few seconds to minutes or hours.
  
Wenn der "Expertenmodus" ausgewählt und mit "Speichern" bestätigt wurde, stehen weitere, etwas komplexere Übertragunsmodi zur Verfügung. Bei Ausschalten diese Option verschwinden diese Dienste wieder vond er Seite, die sonst recht überladen wäre.
+
Configuring push services is done in two steps.
 +
# When you want to use a email, twitter, mysql or FTP you have to configure the basic authentication for these services fist.
 +
# Having gone the service configuration you can then define a specific event that makes use of one of the services.
  
Die folgenden Abschnitte erläutern wie die Sendedienste im Detail aufgesetz werden. Die Sendedienste sind eher für den technisch versierten Anwender interessant, da man ein Grundverständis über die Funktionsweise dieser Dienste benötigt. Wenn man nur Wetterdaten an vordefinierte Wetternetzwerke übertragen möchte, sollte man diesen Reiter komplett ignorieren.
+
When you first enter this tab has no events defined and looks like this:
  
==Grundlegende Sendedienste==
+
[[File:page6.png]]
In diesem Abschnitt werden zunächst die elementarsten Sendedeinste E-Mail, Twitter und das Versenden bei Erreichen von Alarmbedingungen vorgestellt.
+
  
  
[[File:page6de.png]]
+
==Configuration Of Services==
 +
The services types twitter, email, mysql and FTP need some configuration before you can make use of it.
  
 +
===Twitter Upload===
 +
Meteobridge allows you to send weather data snippets to your twitter account. As twitter requires a bit complicated authentication you will have to run through 5 steps.
  
===An Twitter Senden===
+
=====1. Press "Request PIN" button=====
Meteobridge erlaubt Wetterdaten als kleine Textpakete an den Sienst Twitter zu senden. Da Twitter eine etwas aufwändige Authentifizierung hat, ist initial das Durchlaufen von 6 Schritten erforderlich.
+
  
<gallery perrow=1 widths=500 heigths=350>
+
[[File:twitter0.png]]
File:twitter0de.png|1. Die Taste "PIN anfordern" drücken.
+
File:twitter2.png|2. Ein zusätzliches Fenster erscheint im Browser (bitte den Pop-Up Blocker im Browser dafür gegebenenfalls vorübergehend asschalten), in dem man sich mit seinem Twitter-Account anmelden muss.
+
File:twitter2b.png|3. Nach dem Einloggen wird eine PIN angezeigt, diese bitte in die Zwischenablage kopieren.
+
File:twitter4de.png|4. Auf die Meteobridge-Seite zurückwechseln und die PIN von der Zwischenablage in das Feld neben "PIN aktivieren" kopieren und die Aktivierungstaste drücken.
+
File:twitter3de.png|5. Abschließend den Nachrichtentext und das Hochladeintervall sowie die Anzahl von Sendewiederholungen im Fall eines fehlgeschlagenen Sendens eingeben. Diese Einstellungen mit "Speichern" dauerhaft gesichert. Falls die Authentifizierung mit Twitter fehlschlägt, kann der Prozess mit der Taste "Neue PIN anfordern" von vorne gestartet werden.
+
twitter5.png|6. Beim Nachrichtentext können Variable verwendet werden, um Datum, Uhrzeit und Wetterdaten in den Text einzufügen. Wie diese Variable verwendet werden ist im Menupunkt [[Templates/de|Templates]] beschrieben. Das obige Beispiel ist das Ergebnis des Nachrichtentextes: <font face="Courier"><span style="background-color:lightgrey;">[hh]:[mm]h Outdoor temp: [th0temp-act=F.1:--]°F </span></font face>
+
</gallery>
+
  
 +
=====2. An additional window will pop-up where twitter asks you to log-in to your twitter account=====
  
===E-mail versenden===
+
[[File:twitter2.png||300px]]
Meteobridge kann individuelle E-Mails in definierten Zeitintervallen oder beim Eintritt eines Ererignisses senden. Um diesen Dienst zu aktivieren, müssen die folgenden Einstellungen vorgenommen werden.
+
* '''Sendeinterval''': definiert in welchem zeitabstand E-Mail gesendet werden. Die Einstellung "nur bei ALarm" bewrikt, dass kein zeitgesteuerter Versand erfolgt, sondern nur beim Erfüllen definierter Alarmbedingungen (siehe nächsten Abschnitt) eine E-Mail versendet wird. Das Drop-Down-Menu rechts vom Sendeintervall ermöglicht die Definition ob und wie häufig ein gescheiterter Mailversand wiederholt werden soll. Dabei wird nur der Erfolg des Absetzens der E-Mail an den SMTP-Server berücksichtigt, Weiterleitungsprobleme jenseits diese Servers bemerkt Meteobridge nicht. Das sich daran anschließende Drop-Down-Menu erlaubt die Auswahl der Authentifizierungsmethode, mit der Meteobridge den SMTP-Server kontaktiert:
+
** keine: Der SMTP-Server wird ohne weiter Authentifizierung kontaktet. Diese Zugriffsart gestatten SMTP-Server nur sehr selten und dann auch nur in geschlossenen LANs, da sie sonst als offene Spam-Relays missbraucht werden können.
+
** basis: Ist die klassische Benutzername/Passwort-Authentifikation, die ohne Verschlüsselung dieser Daten auskommt. Zunehmend weniger SMTP-Server erlauben diese gering geschütze Zugriffsart.
+
** tls: Ist eine Authentifizierung mit SSL-Verschlüsselung. Diese Variante der SSL-Verschlüsselung wird allerdings selten von SMTP-Servern verwendet.
+
** starttls: Ist inzwischen die am Häufigsten genutze Zugangsart, die sowohl Zugangs- wie Nutzdaten per SSL verschlüsselt.
+
* '''SMTP-Server''': gibt die IP des oder den Namen des SMTP-Servers an, an den die ausgehenden Mails gesendet werden.
+
* '''Port''': Spezifiziert die Port-Nummer auf der der SMTP-Server auf zur Weiterleitung bestimmte E-Mail lauscht. Standard-Ports sind 25 für non-SSL-Verbindungen und 587 für SSL-verschlüsselte Kommunikation
+
* '''Name''': Benutzername zur Authentifizierung
+
* '''Passwort''': Passwort zu Authentifizierung
+
* '''Empfänger''': E-mail-Adresse, die als Empfänger der Mail fungieren soll.
+
* '''Absender''': E-mail-Adresse, die als Absender der Mail fungieren soll. Viele SMTP-Server verlangen, dass die Absenderadresse in der dem Server zugeordneten Domain liegt und verweigern sonst den Versand, um Spamming zu verhindern.
+
* '''Text''': Dies ist der eigentliche Inhalt der E-Mail. Man kann mit einem "#" eine Betreffzeile vom Mailtext abtrennen. Diese Zeichenkette ist Gegenstand der Zeichenersetzungsregeln bezüglich der Verwendung von Variable, wie auf der Seite [[Templates/de|Templates]] beschrieben.
+
  
Mit dem "Test"-Knopf wird eine E-Mail mit dem Betreff "Meteobridge Test" an die angegebenen Empfänger-Adresse gesendet. Man kann admit prüfen, ob die AMTP-Konfiguration funktioniert. Wenn ein Fehler auftritt, wird eine entsprechende Systemmeldung eingeblendet.
+
=====3. Please log-in and copy the pin that twitter does present to you=====
  
 +
[[File:twitter2b.png||300px]]
  
[[File:email0de.png]]
+
=====4. Insert pin into input field next to "Activate PIN" button and press the button=====
  
 +
[[File:twitter4.png]]
  
Der Text <font face="Courier"><span style="background-color:lightgrey;">weather conditions#temp [th0temp-act.1:--]°C\n[wind0wind-max60=kmh.1:--]km/h</span></font face> imobigen Beispiel sendet eine E-Mail an "test@mydomain.com" mit dem Betrefff "weather conditions" und einem zweizeiligen Nachrichtentext (Zeilen sind durch das Zeilenumbruchzeichen "\n" getrennt). Die erste Zeile enthält die aktuelle Außentemperatur (wie z.B. "13.4°C") und die zweite Zeile zeigt die maximale Böengeschwindigkeit der letzten 60 Minuten (z.B. "34.7km/h"). Details zur Verwendung von Variable sind auf der Seite [[Templates/de|Template]] beschrieben.
+
=====5. When PIN was accepted twitter service is marked with "Authentication: done" flag=====
  
===Alarmierungsdienst===
+
[[File:twitter3.png]]
Meteobridge ermöglicht das Versenden von E-Mails oder Twitter-Kurznachichten, wenn individuell definierte Bedingungen erfüllt sind. Um diese Option auswählen zu können, muss mindestens einer der Dienste E-Mail oder Twitter in Meteobridge aktiviert un konfiguriert sein. Der Alarmierungsdienst greift auf bereits für E-Mail und Twitter spezifizierten Einstellungen zurück und definiert diese nicht neu. Die Eingabefelder haben die folgenden Bedeutungen:
+
* '''Alarmierungsmodus''': Dieser kann entweder "ausgeschaltet" oder "Sende E-Mail" oder "Sende Twitter" sein. Desweiteren kann man zwischen "Einmalalarm" und "inkrementelle Alarme" wählen. Beim "Einmalalarm" wird bei Erfüllen einer Auslösebedingung exakt eine Alarmmeldung gesendet. Es bedarf dann des Eintretens der Rücksetzbedingung, um eine erneute Alarmauslösung zu ermöglichen. Bei inkrementellen Alarmen wird eine Nachricht beim erstmaligen Zutreffen der Auslösebedingung gesendet. Tritt danach ein weiteres Ereignis ein, bei dem die bisher überschrittene Alarmierungsschwelle noch deutlicher überschritten wird, erfolgt ein erneuter Alarmversand.
+
* '''Auslösebedingung''': definiert die Bedingung die in Form einer Ungleichung oder Gleicung erfüllt sein muss, damit der Alarm ausgelöst wird. Details zur Formulierung von Bedingungen sind im folgenden Abschnit "Bedingungen" beschrieben.
+
* '''Rücksetzbedingung''': definiert die Bedingung die zum Zurücksetzen der Alarmierung erfüllt sein muss. Details zur Fomulierung der Bedingungen sind im folgenden Abschnitt "Bedingungen" beschrieben.
+
* '''Nachricht''': beschreibt den Text der via Twitter oder E-Mail im Alarmierungsfall versendet wird. Der Text kann Meteobridge Variable enthalten.
+
  
[[File:alarmde.png]]
+
Now twitter is ready to be used by events you will define later on.
  
 +
===Sending E-mails===
 +
Meteobridge can largely customizable e-mails. To get this service initialized you have to work through the following settings:
 +
* '''Authentication''': This drop-down box allows you to define the authentication mode used with the SMTP server. You can choose between:
 +
** none: This setting does not send any authentication information to the SMTP server. Only servers in closed LANs will provide that (if at all).
 +
** basic: Old-fashioned user name and password authentication, without SSL encryption
 +
** tls: authentication with SSL encryption (a variant not used very often)
 +
** starttls: standard authentication with SSL encryption (most often used)
 +
* '''SMTP Host''': specifies the IP or name of the SMTP server to use.
 +
* '''Port''': port number where SMTP server listens for mails (standard ports are 25 for non-SSL and 587 for SSL communication)
 +
* '''User''': user name to be used for authentication
 +
* '''Password''': password to be used
 +
* '''To-Addr.''': E-mail address of the recipient
 +
* '''From-Addr.''': E-mail address of the sender (many SMTP servers only accept mails with a sender address being in the same domain as the SMTP server itself)
  
Der Nachrichtentext <font face="Courier"><span style="background-color:lightgrey;">Gust Warning#Gust speed of [wind0wind-act=kmh.1:--]km/h</span></font face> im obigen Beispiel erzeugt eine E-Mail mit dem Betreff "Gust Warning" und die Nachricht in der Art "Gust speed of 65.2km/h", wenn die Auslösebedingung des Beispiels bei einer Böengeschwindigkeit größer 50 km/h erfüllt ist.
+
[[File:email0.png]]
  
====Conditions====
+
Pressing the "Test" button sends an e-mail with subject "Meteobridge Test" to the given address. If sending the mail does not work, an error message will pop-up, trying to explain what went wrong.
There are two type of conditions that are formulated exactly the same way, but have different meaning. If a "raise condition" is satisfied, an alarm will be triggered and sent via e-mail or twitter. To send out the next email, it needs the "clear condition" to be satisfied first. The idea behind that is to suppress a large amount of follow-up messages on an event already given attention. For example, when raise condition is set to "outdoor temp at least 35°C" and clear condition is set to "outdoor temp below 30 °C" and resolution used for comparison is integer level (zero decimals) you will get a message once the temperature reaches 35° but will not get additional messages on that until the temperature has dropped below 30°C again. When you have selected "incremental alarms" and temperature raises from 34°C up to 37.2°C you will get one messages about reaching 35°C, one about reaching 36° and one about reaching 37°C threshold. This gives you the chance to get informed how much the given threshold was passed.   
+
 
 +
===MYSQL Uploads===
 +
When you prefer to store your weather station's data in your own MYSQL database, Meteobridge can feed sensor data to it in a very easy way. In order to support MYSQL queries some genric data must be specified.
 +
* '''Host''': server name or IP of server (when DNS can't resolve the name)
 +
* '''Port''': port number where to reach MYSQL database on your server
 +
* '''Database''': name of database to feed
 +
* '''User''': name of database user to use for data upload
 +
* '''Password''': password for user name.
 +
 
 +
[[File:mysql.png]]
 +
 
 +
When mysql service is not defined and not used bx events, Meteobridge removes the storage intensive mysql libraries during boot. This is indicated by the orange "inactive" sticker. You can still define the mysql server credentials, but it will need an event definition making use of mysql saved and then the Meteobridge rebooted to get the mysql libraries ready for operation.
 +
 
 +
===FTP Uploads===
 +
Meteobridge allows you define a FTP server that can be bu used for uploading files. Meteobridge can just handle one FTP server, but you can define distinct directories and file names for each upload event later on. Setup of generic FTP upload credentials is done as follows:
 +
* '''FTP Host''': server name or IP of server (when DNS can't resolve the name)
 +
* '''Port''': port number where to reach MYSQL database on your server
 +
* '''FTP User''': user name to be used for FTP upload
 +
* '''FTP Password''': password to be used for FTP upload
 +
 
 +
[[File:ftp.png]]
 +
 
 +
In order to check if FTP credentials do work, you can press "Test Upload" button. Meteobridge will upload a file named "test-upload" with current time stamp as content to your FTP server. File will be located at directory that is default when doing FTP login. When you want to test upload to different directories you can specify an path in "Test Path" field. This path is used for test uploads only.
 +
 
 +
 
 +
==Definition Of Events==
 +
Meteobridge allows you to define up to 20 events that make use of push services. You have defined events listed at the top of the tab.
 +
 
 +
Adding an event is extremely easy. Just pull down the "Select Service" selector and choose the service type you want to use.
 +
 
 +
[[File:event0.png]]
 +
 
 +
Next choose the type of event you want to define and then you press "Add Service Event" button.
 +
 
 +
[[File:event1.png]]
 +
 
 +
Having done that a new service event will be added to the list of events and you can specify details of this specific event. Each event definition consists of a section where the trigger conditions are specified and a section that defines the payload the event is expected to transport via the service underneath.
 +
 
 +
===Event Types===
 +
There are three event types to choose from that can be applied to all push services Meteobridge provides.
 +
 
 +
====Periodical====
 +
This allows you to define the interval the event will be triggered. For some services it goes down to every 5 seconds and for the rest it is in the range of minutes up to hours. You simply select the repeating interval by a drop-down list.
 +
 
 +
[[File:event2.png]]
 +
 
 +
====Specific Time====
 +
Here you can define the time of day when the event has to be triggered. Time can be selected from a drop-down list in 15 minute steps.
 +
 
 +
[[File:event3.png]]
 +
 
 +
====Alarm Conditions====
 +
This allows you to specify the alarm trigger mode and conditions used for raising and clearing the alarm.
 +
 
 +
[[File:event4.png]]
 +
 
 +
You can choose between "One-Time Alarms" which are triggered once and need to be cleared before they can fire again, and "Incremental Alarms" which allow a re-triggering of a non-cleared alarm, when the triggering event matches "raise condition" by a larger magnitude than the last trigger event.
 +
* '''Raise Condition''': defines the condition to be met in order to fire an alarm. Once an alarm is fired, it will not be fired again until the alarm is cleared again. When you have selected incremental alarms, an alarm can be fired again under certain circumstances. Details on condition statements are explained in "conditions" subsection below.
 +
* '''Clear Condition''': defines the condition to be met to clear a fired alarm. Details on condition statements are explained in "Alarm Conditions" subsection below.
 +
 
 +
There are two type of conditions that are formulated exactly the same way, but have different meaning. If a "raise condition" is satisfied, the related event service will be triggered. To trigger the services event again, it needs the "clear condition" to be satisfied first. The idea behind that is to suppress a large amount of follow-up event evocations on an event already given attention. For example, when raise condition is set to "outdoor temp at least 35°C" and clear condition is set to "outdoor temp below 30 °C" and resolution used for comparison is integer level (zero decimals) you will get a message once the temperature reaches 35° but will not get additional messages on that until the temperature has dropped below 30°C again. When you have selected "incremental alarms" and temperature raises from 34°C up to 37.2°C you will get one messages about reaching 35°C, one about reaching 36° and one about reaching 37°C threshold. This gives you the chance to notice how much the given threshold was passed.   
  
 
There are two types of condition expressions. The '''simple''' one is just comparing two numbers, the '''complex''' variant allows for full arithmetic expressions.  
 
There are two types of condition expressions. The '''simple''' one is just comparing two numbers, the '''complex''' variant allows for full arithmetic expressions.  
  
=====Einfache Bedingungen=====
+
=====Simple Condition Expression=====
In diesem Fall besteht die Bedingung aus drei durch Leerzeichen getrennte Teile.
+
In this case the expression consists of three parts separated by blanks.
  
* Der erste Teil ist die '''Variable'''. Variable in Bedingungen haben dieselbe Syntax wie Variable in Meteobridge [[Templates/de|Templates]], man muss also nichts Neues lernen. Während die Variable in den Templates in eckige Klammern eingeschlossen sind, um sie vom Rest des Textes abzusetzen, stehen die Variable in Bedingungen ohne diese Klammern. Die Auslösebedingung im obigen Beispiel verwendet die Variable <font face="Courier"><span style="background-color:lightgrey;">wind0wind-act=kmh.1:0</span></font face>, die für die aktuelle Böengeschwindigkeit, konvertiert in km/h und ohne Nachkommastellen steht. Wenn der Sensor keine Daten liefert wird stattdessen der Wert "0" verwendet.
+
* First part is the '''variable'''. Variables in conditions are exactly the same as in Meteobridge [[Templates]], so you don't have to learn a new syntax here. While variables in templates are embedded into a pair of square brackets, variables in condition statements don't have that brackets. A raise condition like <font face="Courier"><span style="background-color:lightgrey;">wind0wind-act=kmh.1:0 > 35</span></font face> makes use of variable definition "wind0wind-act=kmh.1:0", which stands for actual non averaged wind speed, converted to km/h with no decimals and when there is no sensor data there, then 0 is taken as speed.
  
* Der zweite Teil ist der '''Vergleichsoperator'''. Definierte Operatoren sind:
+
* Second part is a '''comparison operator'''. Defined operators are
** '''=''' gleich, '''!=''' ungleich
+
** '''=''' equal, '''!=''' non equal
** '''<''' kleiner als, '''<=''' kleiner oder gleich
+
** '''<''' less than, '''<=''' less than or equal
** '''>''' größer als, '''>=''' größer oder gleich
+
** '''>''' greater than, '''>=''' greater than or equal
  
* Der dritte Teil ist der '''Vergleichswert''', der ganzzahlig oder eine Fließkommazahl sein kann.
+
* Third part is a '''numerical value''', which can be integer or float.
  
 
Examples:<BR>
 
Examples:<BR>
Line 81: Line 137:
 
* <font face="Courier"><span style="background-color:lightgrey;">th0temp-act=c.1:0 < 0</span></font face> triggers when outdoor temp goes below 0°C
 
* <font face="Courier"><span style="background-color:lightgrey;">th0temp-act=c.1:0 < 0</span></font face> triggers when outdoor temp goes below 0°C
  
=====Komplexe Bedingungen=====
+
=====Complex Condition Expression=====
Komplexe Bedingungen können mehrere Operatoren und Klammern enthalten. Wetterdaten werden durch Meteobridge-Variable repräsentiert, wie im Abschnitt [[Templates]] erläutert. Die Variablen müssen in vollständiger Template-Notation eingegeben werden, inklusive eckiger Klammern. Definierte Operatoren sind:
+
Complex expressions can make use multiple operators and brackets. Weather data can be used in terms of Meteobridge variables as explained in [[Templates]] section. Variables need to be in full template-like notation, including the surrounding square brackets. Defined operators are:
  
 
{| style="background:none" border="1" cellpadding="5" cellspacing="0"
 
{| style="background:none" border="1" cellpadding="5" cellspacing="0"
|+ align="bottom"|''Operatoren in steigender Präzedenz (von Oben nach Unten)''
+
|+ align="bottom"|''operators in increasing precedence (from top to bottom)''
 
! Operator
 
! Operator
! Beschreibung
+
! Description
 
|-
 
|-
 
|'''&&''', '''&#124;&#124;'''  
 
|'''&&''', '''&#124;&#124;'''  
|logische "und", "oder" Operatoren, die auf dem Wertebereich "1=wahr" und "0=falsch" arbeiten
+
|logical "and", "or" operators working on value range: 1=true, 0=false
 
|-
 
|-
 
|'''==''', '''!=''', '''>''', '''>=''', '''<''', '''<='''
 
|'''==''', '''!=''', '''>''', '''>=''', '''<''', '''<='''
|Vergleichsoperatoren, die auf dem Wertebereich "1=wahr" und "0=falsch" arbeiten
+
|comparison operations working on value range: 1=true, 0=false
 
|-
 
|-
 
|'''+''', '''-'''  
 
|'''+''', '''-'''  
|Arithmetische Operatoren "Addition" und "Subtraktion"
+
|arithmetic operators "plus" and "minus"
 
|-
 
|-
 
|'''*''', '''/'''
 
|'''*''', '''/'''
|Arithmetische Operatoren "Multiplikation" und "Division"
+
|arithmetic operators "multiply" and "divide"
 
|-
 
|-
 
|'''^'''
 
|'''^'''
|Arithmetischer Operator "Potenz"
+
|arithmetic operator "power"
 
|}
 
|}
Das Ergebnis der Berechnung des Ausdruckes wird als boolscher Wert interpretiert. Werte über Null sind "wahr", Werte kleiner oder gleich NUll sind "falsch". Wenn die Option "inkrementeller Alarm" gewählt wird, vergleicht Meteobridge den neuen Wert mit dem der letzten Überprüfung, sofern diese das Ergebnis "wahr" geliefert hatte. Ist der aktuelle Wert größer als der vorangegangene, wird erneut ein Alarm ausgelöst, auch wenn dieser vorher nicht gelöscht wurde.
+
Result of the expression is interpreted as a boolean. Values above zero are regarded "true", values below or equal zero are regarded "false". When "incremental alarm" is specified, Meteobridge compares new value with former value and does trigger an alarm, when new value is bigger then the one that has triggered an alarm before.
  
Beispiele:<br />
+
Examples:<BR />
* <font face="Courier"><span style="background-color:lightgrey;">[rain0total-sumday=mm:0] - 10</span></font face><br />löst einen Alarm aus, wenn die heutige Regenmenge 10 mm übersteigt. Wenn die Option des "inkrementellen Alarm" aktiviert ist, wird jedes Mal, wenn der Regenfall einen neuen Höchststand jenseits der 10 mm erreicht, ein Alarm ausgelöst. Dies erfolgt, das der Ausdruck keinen echten boolschen Wert liefert, sondern eine Zahl, die jenseits von 10 mm regenfall einen Wert größer Null liefert und somit als "wahr" interpretiert wird. Weiteres Ansteigen des Wertes führt in diesem Modus zu erneuter Alarmauslösung und somit zu Folgealarmen, ohne dass der Alarm vorher durch ein anderes Ereignis zurückgesetzt werden muss.
+
* <font face="Courier"><span style="background-color:lightgrey;">[rain0total-sumday=mm:0] - 10</span></font face><BR />triggers an alarm when todays rain exceeds 10mm. When alarm mode is set to "incremental alarm", every time rain increases above 10mm, a new alarm will be triggered. This happens because the expression does not return a boolean, but a value that regarded "true" when result is above zero (here, 10mm rain fall). Further increases will keep the condition "true" but will also increment the number and therefore, will fire additional alarms.  
* <font face="Courier"><span style="background-color:lightgrey;">[wind0wind-act=kmh.1:0] > 20 && ([wind0dir-act:180] >= 315 || [wind0dir-act:180] <= 45)</span></font face><br />löst einen Alarm aus, wenn die nicht gemittelte Windgeschwindigkeit über 20 km/h steigt und die Windrichtung ungefähr Nord ist(NW-NNW-N-NNO-NO).
+
* <font face="Courier"><span style="background-color:lightgrey;">[wind0wind-act=kmh.1:0] > 20 && ([wind0dir-act:180] >= 315 || [wind0dir-act:180] <= 45)</span></font face><BR />triggers an alarm when non-averaged wind speed is more than 20 km/h and wind direction is mainly North (NW-NNW-N-NNE-NE).
  
==Fortgeschrittene Sendedienste==
+
===Event Deletion===
Wenn der "Expertenmodus" aktiviert ist, werden drei weitere Sendedienste angeboten, die es erlauben Daten via HTTP-Requests, MYSQL-Anfragen oder FTP an andere Systeme zu übertragen.  
+
Getting rid of a defined event definition is simply done by pulling down the select box in front of the event definition and to press "save" after that.
  
 +
[[File:event5.png]]
  
[[File:page6bde.png]]
+
===Twitter Event===
 +
When you define a twitter event you just have to fill the "text message" with the message to be posted. Text message can make full use of Meteobridge template variables. The example below sends out a twitter message every day at noon that contains outdoor temperature in degrees Celsius.
  
 +
[[File:event6.png]]
  
===Individeller HTTP-Upload===
+
===Email Event===
Diese Option erlaubt es Wetterdaten als HTTP-GET Requests an eine URL zu senden. Die URL und der Parameterstring können frei definiert werden. Die Parameter werden üblicher Weise als Name-Wert-Paare getrennt durch ein "&" in der URL aufgeführt. Dabei können Meteobridge-Variable verwendet werden und somit aktuele Wetterdaten als Parameter übergeben werden. Die Wettrdaten werden beim Senden des HTTP-GET-Requests seitens Meteobridge eingesetzt. Anbei ein Beispiel:
+
When you define an email event you have the fill the mandatory email body text field. If the optional "Addr.-To" field is left blank, then the email address from the email service definition at the bottom of the tab is used as default.
  
 +
[[File:event7.png]]
  
[[file:http-uploadde.png]]
+
In the example above every hour an email is sent out with a subject like "weather at 11:23" and a body text like shown below. Please notice that the "#" symbol divides subject from body text.<pre>temp 12.3°C
 +
gust 6.7kmh</pre>
  
 +
===FTP Event===
 +
Data to be uploaded via FTP cannot be stored on the Meteobridge as it does not provide the necessary persistent storage capacity. Therefore the templates to be filled with weather data have to reside on a server where Meteobridge can request it from by an URL. When the template URL is specified you have to press "Reload Template" to store the current version of the template into the RAM of the Meteobridge for further use. Beside the URL to the template you also have to define a path that defines to which folder of the FTP server the filled template should be uploaded to.
  
Das Hochladeintervall ist auf "alle 10 Sekunden" eingestellt, Die URL beschreibt die Adresse des empfangenden Servers ("http://myserver.com/upload.php" im obigen Bespiel). "Erfolgskriterium" nennt die Zeichenkette, die im Falle eines erfolgreichen daten-Uploads vom Server zurückgemeldet wird. Durch Vergleich der Zeichenketten stellt Meteobridge fest, ob das Hochladen gelappt hat oder gegebenenfalls ein erneutes Hochladen desselben Datensatzes versucht werden soll.
+
====FTP Dashboard Example====
  
Die Wetterdaten werden an den Server als URL-Parameter übertragen. Meteobridge kann in diesen Parametern eingefügte Variable auswerten. Die Seite [[Templates/de|Templates]] beschreibt die zur Verfügung stehenden Variable und wie diese parameteriert werden können.
+
[[File:event8.png]]
 
+
===Individualer MYSQL-Upload===
+
Wenn man Wetterdaten gerne in eine MYSQL-Datenbank speichern möchte,bietet sich dieser Sendedienst an. Die folgenden Angaben sind erforderlich:
+
* '''Server''': Servername oder IP des Servers (wenn DNS den Namen nicht auflösen kann)
+
* '''Port''': Portnummer, unter der die MYSQL-Datenbank Verbindungen annimmt.
+
* '''Datenbank''': Name der Datenbank, in die Werte gespeichert werden sollen.
+
* '''Benutzer''': Name des Benutzers, unter dem sich Meteobridge an der Datenbank anmelden soll.
+
* '''Passwort''': Passwort des benutzers für die Datenbank.
+
* '''Anfrage''': auszuführendes SQL-Statement. Dies ist typischer Weise ein "INSERT" SQL-Kommando, mit dem pro Datenanlieferung eine Zeile mit Daten in die gewählte Tabelle (hier "upload") der Datenbank (hier "test") eingefügt wird. Der Anfragetext unterliegt dem Meteobridge Variablenersetzungsmechanismus, mit dem bei der Ausführung konkrete Werte in die Anfrage eingesetzt werden.
+
 
+
 
+
[[File:mysqlde.png]]
+
 
+
 
+
Die Anfrage <font face="Courier"><span style="background-color:lightgrey;">insert upload (temp, wind) values ([th0temp-act.1:-9999], [wind0wind-act=kmh.1:-9999])</span></font face> in obigem Beispiel speichert die aktuelle Außentemperatur in das Feld "temp" der Tabelle "upload" der Datenbank "test". Das Feld "wind" wird mit der aktuellen nicht gemittelten Windgeschwindigkeit in km/h gefüllt. Wenn keine Daten für Wind oder Temperatur vorliegen wrd der Wert -9999 gespeichert.
+
 
+
Details zur Verwendung der Variable in Meteobridge finden sich auf der Seite [[Templates/de|Template]].
+
 
+
===Individueller FTP-Upload===
+
Meteobridge ermöglicht bis zu vier verschiedene dateien auf einen FTP-Server zeitgesteuert hochzuladen. Beim Hochladen wird zunächst das Tempate der Datei aus dem Internet geladen, die darin enthaltenen Variable werden duch konkrete Werte ersetzt und die resultierende Datei wird dann unter einem spezifierten Dateinamen per FTP auf den Ziel-Server hochgeladen. Meteobridge kann nur einen Ziel-Server versorgen, auf diesem Server aber unterschiedliche Verzeichnisse pro Upload ansprechen. Die Konfiguration dieses FTP-Dienstes erfolgt so:
+
* '''FTP-Server''': Servername oder IP des Servers
+
* '''Port''': Port-Nummer des FTP-Dienstes auf dem Server
+
* '''Benutzer''': Benutzername, der für den FTP-Upload verwendet werden soll.
+
* '''Passwort''': Mit dem Benutznamen verbundenes Passwort
+
 
+
Um zu testen, ob die FTP Login-Daten funktionieren, kann man die Taste "Hochladen Testen" drücken. Meteobridge wird versuchen eine Datei Namens "test-upload" mit dem aktuellen zeitstempel als Inhalt auf den FTP-Server unter dem angegebenen Testpfad abzulegen. Wenn kein testpfad angegeben wird, speichert Meteobridge die Datei im auf dem FTP-Server für diesen Benutzer voreingestellten Verzeichnis. Der angegebene Testpfad wird nur für diesen Hochlade-Test verwendet.
+
 
+
Die zu übertragenden dateien werden in den folgenden vier Zeolen spezifiziert. Die pro zeile verfügbaren Felder haben die folgenden Bedeutungen:
+
* Hochladeintervall: hier wird eingestellt wie oft die Datei mit Werten gefüllt und hochgeladen werden soll. Bei der Einstellung "kein Hochladen" erfolgen keine Uploads.
+
* Template-Datei: definiert die URL unter der die mit Werten zu füllende Textdatei im Internert gespeichert ist.
+
* Pfad: bezeichnet den Pfad und Dateinamen (in Unix-Notation) unter dem die Datei auf den FTP-Server hochgeladen werden soll. Es gibt hier keine Voreinstellung, die Pfadangabe (inklusive dateiname) ist zwingend erforderlich.
+
 
+
Um den Datenverkehr mit dem Internet zu minimieren, lädt Meteobirdge die Templates nicht vor jedem Hochladezyklus neu. Vielmehr beliben die Templates auf dem Meteobridge statisch gespeichert, bis der Knopf "Templates Laden" gedrückt wird. Bei der Veränderung von Templates auf dem Internet-Server ist es also notwendig, diese abschließend per "Templates Laden" manuell auf die Meteobridge zu übertragen, damit die Änderungen wirksam werden.
+
 
+
Wenn eine Ubiquiti AirCam angeschlossen ist, können deren Wetterkamerabilder auf Ihren Server hochgeladen werden. In diesem Fall wird keine Template-Datei benötigt und ist lediglich die Angabe des Zielpfads auf dem FTP-Server erforderlich.
+
 
+
[[File:ftpde.png]]
+
 
+
 
+
Example above defines an upload schema to FTP server "ftp.myserver.com" for user "myself". Template [http://templates.meteobridge.com/simpledash.html templates.meteobridge.com/simpledash.html] has been loaded on start up of Meteobridge and will be updated with recent data every minute and then uploaded to FTP server as file "mydash.html". When you view "mydash.html" with your browser it looks like this:
+
  
 +
Example above makes use of a pre-defined dashboard html file and fills it every 10 minutes with recent weather data and uploads it as file name "/public_html/dashboard.html" to the specified FTP server.
 +
The file "dashboard.html" is a simple HTML file with some Meteobridge weather variables included. When you view "dashboard.html" with your browser it looks like this:
  
 
[[File:mydash.png]]
 
[[File:mydash.png]]
  
 
+
Details of using variables in templates are explained in [[Templates]] section.  
Details über die Variablenersetzung in Meteobridge werden auf der Seite [[Templates/de|Templates]] erläutert. Das anhängende Beispiel zeigt wie einfach Variable in HTML-Seiten einzubetten sind (wobei die CSS-Definitionen zur Steuerung der Formatierung der Tablle der Einfachheit halber weggelassen wurden):
+
To illustrate that using these variables is quite easy the HTML body part (omitting the CSS styles for formatting it nicely) of the template of above's example is attached below:
 
<pre>
 
<pre>
 
<body>
 
<body>
Line 229: Line 254:
 
</pre>
 
</pre>
  
====Saratoga Template-Upload====
 
Meteobridge kann die bekannten Saratoga-Templates bedienen, die einfach auf einer Homepage zu installieren sind und umfangreich und übersichtlich über die Wettersituation Auskunft geben. Wie die Installation genau vorzunehmen ist und Meteobridge eingerichtet werden muss ist detailliert [http://saratoga-weather.org/wxtemplates/install.php hier] beschrieben.
 
  
Wenn die Wetterseite mit den Saratoga-Templates aufgesetzt ist, wird sie in etwa so aussehen:
+
====Saratoga Template Example====
 +
 
 +
[[File:event13.png]]
 +
 
 +
Meteobridge is supported by the well-known Saratoga templates, which allow you to easily build your own powerful weather homepage. Procedure how to install the php scripts and how to configure Meteobridge's FTP upload is described in detail [http://saratoga-weather.org/wxtemplates/setup-Meteobridge.php here].
 +
 
 +
When having done the well explained and easy to do setup, your website will look like this:
  
 
[[File:saratoga.png]]
 
[[File:saratoga.png]]
  
===Individual Script Invocation===
+
===FTP Camera Event===
Meteobridge allows to execute user-defined bash scripts. The script has to be available on a web server. Meteobridge downloads the script via a given URL. Each time the trigger interval is fired, weather variables inside the script are replaced by current values and the script is executed. A parameter line can be used to hand over user-defined parameters to the script.
+
If Meteobridge drags pictures from a web cam or an Ubiquiti AirCam these pictures can also be uploaded via FTP. Here you just have to define the target path and file name, which can include date and time variables as specified by "strftime" GNU C function.
This kind of script invocation allows Meteobridge not only fire user-defined actions on the Meteobridge itself but the even more interesting thing is, that by have "wgets" placed in the script this can also initiate actions in the Internet. This does give additional freedom to let your Meteobridge act on weather conditions and to trigger events outside Meteobridge as well.
+
 
"Reload" button does load script from Internet and "Test" button does a test invocation to check if the script runs fine or thows some errors.  
+
[[File:event9.png]]
 +
 
 +
Example above stores a web cam picture every ten minutes and gives it a file name reflecting date and time like "2014-06-23_12:34_weatherpic.jpg". Details about "strftime" syntax can be found [http://man7.org/linux/man-pages/man3/strftime.3.html here].
 +
 
 +
===HTTP Event===
 +
Meteobridge can send HTTP GET requests containing weather data as URL parameter. This can be used to feed individual weather networks. Beside the mandatory URL you can optionally define a success string that is matched against the data the requested web server returns to the Meteobridge.  
 +
* When the success string is empty, no checking against the returned data is done
 +
* If the success string is not empty the returned data is analyzed and if the given success string is found in the returned data the transmission is expected to be successful, otherwise an Error is signaled.
 +
* If the success string starts with an exclamation mark "!" the transmission is regarded successful when the string is not found in the returned data.
 +
 
 +
[[File:event10.png]]
 +
 
 +
In the example above Meteobridge sends recent wind speed every 15 seconds to the specified server and assumes transmission went fine, when returned data does not include the string "Error".
 +
 
 +
===MYSQL Event===
 +
Meteobridge can send queries to a mysql server, which can be used to register weather data into a regular database. The mandatory query text field will usually contain a mysql insert statement followed by a table name and a list of column names and values. The query is subject to template replacement, so you can use Meteobridge variables to upload weather data to your database.
 +
 
 +
[[File:event11.png]]
 +
 
 +
In the example above Meteobridge sends recent temperature and average wind speed every 10 minutes to a mysql database.
 +
 
 +
===Script Execution Event===
 +
Meteoridge can download executable shell scripts from an URL and can execute these scripts. When you define a new event of this type, please lead the script by the "Reload Script" button before trying to execute the script. The parameter text field is optional, in case the script can handle additional parameters. The documentation string is derived from the loaded script and just displays the first line of the script containing a "###" pattern.
  
[[File:scriptde.png]]
+
[[File:event12.png]]
  
Settings above define to trigger script stored at "http://templates.meteobridge.com/reboot.sh" every day at 23:20. There are no paramters to be handed over to the script.
+
Settings above define to trigger script stored at "http://templates.meteobridge.com/reboot.sh" every day at 23:45. There are no parameters to be handed over to the script.
 
The script provides a one-line documentation, which is marked in the script by three leading '#'.
 
The script provides a one-line documentation, which is marked in the script by three leading '#'.
 
As you can see the script below does mainly issue a "reboot" of the Meteobridge.
 
As you can see the script below does mainly issue a "reboot" of the Meteobridge.

Revision as of 09:04, 28 June 2014

Other languages:
Deutsch • ‎English


Meteobridge provides some additional "push services", which can distribute weather information to you via email, twitter, HTTP requests, FTP uploads, mysql queries or by invoking a user defined script. All these services can be triggered by certain alarm conditions, at a certain time of the day or in periodic intervals ranging from a few seconds to minutes or hours.

Configuring push services is done in two steps.

  1. When you want to use a email, twitter, mysql or FTP you have to configure the basic authentication for these services fist.
  2. Having gone the service configuration you can then define a specific event that makes use of one of the services.

When you first enter this tab has no events defined and looks like this:

Page6.png


Configuration Of Services

The services types twitter, email, mysql and FTP need some configuration before you can make use of it.

Twitter Upload

Meteobridge allows you to send weather data snippets to your twitter account. As twitter requires a bit complicated authentication you will have to run through 5 steps.

1. Press "Request PIN" button

Twitter0.png

2. An additional window will pop-up where twitter asks you to log-in to your twitter account

Twitter2.png

3. Please log-in and copy the pin that twitter does present to you

Twitter2b.png

4. Insert pin into input field next to "Activate PIN" button and press the button

Twitter4.png

5. When PIN was accepted twitter service is marked with "Authentication: done" flag

Twitter3.png

Now twitter is ready to be used by events you will define later on.

Sending E-mails

Meteobridge can largely customizable e-mails. To get this service initialized you have to work through the following settings:

  • Authentication: This drop-down box allows you to define the authentication mode used with the SMTP server. You can choose between:
    • none: This setting does not send any authentication information to the SMTP server. Only servers in closed LANs will provide that (if at all).
    • basic: Old-fashioned user name and password authentication, without SSL encryption
    • tls: authentication with SSL encryption (a variant not used very often)
    • starttls: standard authentication with SSL encryption (most often used)
  • SMTP Host: specifies the IP or name of the SMTP server to use.
  • Port: port number where SMTP server listens for mails (standard ports are 25 for non-SSL and 587 for SSL communication)
  • User: user name to be used for authentication
  • Password: password to be used
  • To-Addr.: E-mail address of the recipient
  • From-Addr.: E-mail address of the sender (many SMTP servers only accept mails with a sender address being in the same domain as the SMTP server itself)

Email0.png

Pressing the "Test" button sends an e-mail with subject "Meteobridge Test" to the given address. If sending the mail does not work, an error message will pop-up, trying to explain what went wrong.

MYSQL Uploads

When you prefer to store your weather station's data in your own MYSQL database, Meteobridge can feed sensor data to it in a very easy way. In order to support MYSQL queries some genric data must be specified.

  • Host: server name or IP of server (when DNS can't resolve the name)
  • Port: port number where to reach MYSQL database on your server
  • Database: name of database to feed
  • User: name of database user to use for data upload
  • Password: password for user name.

Mysql.png

When mysql service is not defined and not used bx events, Meteobridge removes the storage intensive mysql libraries during boot. This is indicated by the orange "inactive" sticker. You can still define the mysql server credentials, but it will need an event definition making use of mysql saved and then the Meteobridge rebooted to get the mysql libraries ready for operation.

FTP Uploads

Meteobridge allows you define a FTP server that can be bu used for uploading files. Meteobridge can just handle one FTP server, but you can define distinct directories and file names for each upload event later on. Setup of generic FTP upload credentials is done as follows:

  • FTP Host: server name or IP of server (when DNS can't resolve the name)
  • Port: port number where to reach MYSQL database on your server
  • FTP User: user name to be used for FTP upload
  • FTP Password: password to be used for FTP upload

Ftp.png

In order to check if FTP credentials do work, you can press "Test Upload" button. Meteobridge will upload a file named "test-upload" with current time stamp as content to your FTP server. File will be located at directory that is default when doing FTP login. When you want to test upload to different directories you can specify an path in "Test Path" field. This path is used for test uploads only.


Definition Of Events

Meteobridge allows you to define up to 20 events that make use of push services. You have defined events listed at the top of the tab.

Adding an event is extremely easy. Just pull down the "Select Service" selector and choose the service type you want to use.

Event0.png

Next choose the type of event you want to define and then you press "Add Service Event" button.

Event1.png

Having done that a new service event will be added to the list of events and you can specify details of this specific event. Each event definition consists of a section where the trigger conditions are specified and a section that defines the payload the event is expected to transport via the service underneath.

Event Types

There are three event types to choose from that can be applied to all push services Meteobridge provides.

Periodical

This allows you to define the interval the event will be triggered. For some services it goes down to every 5 seconds and for the rest it is in the range of minutes up to hours. You simply select the repeating interval by a drop-down list.

Event2.png

Specific Time

Here you can define the time of day when the event has to be triggered. Time can be selected from a drop-down list in 15 minute steps.

Event3.png

Alarm Conditions

This allows you to specify the alarm trigger mode and conditions used for raising and clearing the alarm.

Event4.png

You can choose between "One-Time Alarms" which are triggered once and need to be cleared before they can fire again, and "Incremental Alarms" which allow a re-triggering of a non-cleared alarm, when the triggering event matches "raise condition" by a larger magnitude than the last trigger event.

  • Raise Condition: defines the condition to be met in order to fire an alarm. Once an alarm is fired, it will not be fired again until the alarm is cleared again. When you have selected incremental alarms, an alarm can be fired again under certain circumstances. Details on condition statements are explained in "conditions" subsection below.
  • Clear Condition: defines the condition to be met to clear a fired alarm. Details on condition statements are explained in "Alarm Conditions" subsection below.

There are two type of conditions that are formulated exactly the same way, but have different meaning. If a "raise condition" is satisfied, the related event service will be triggered. To trigger the services event again, it needs the "clear condition" to be satisfied first. The idea behind that is to suppress a large amount of follow-up event evocations on an event already given attention. For example, when raise condition is set to "outdoor temp at least 35°C" and clear condition is set to "outdoor temp below 30 °C" and resolution used for comparison is integer level (zero decimals) you will get a message once the temperature reaches 35° but will not get additional messages on that until the temperature has dropped below 30°C again. When you have selected "incremental alarms" and temperature raises from 34°C up to 37.2°C you will get one messages about reaching 35°C, one about reaching 36° and one about reaching 37°C threshold. This gives you the chance to notice how much the given threshold was passed.

There are two types of condition expressions. The simple one is just comparing two numbers, the complex variant allows for full arithmetic expressions.

Simple Condition Expression

In this case the expression consists of three parts separated by blanks.

  • First part is the variable. Variables in conditions are exactly the same as in Meteobridge Templates, so you don't have to learn a new syntax here. While variables in templates are embedded into a pair of square brackets, variables in condition statements don't have that brackets. A raise condition like wind0wind-act=kmh.1:0 > 35 makes use of variable definition "wind0wind-act=kmh.1:0", which stands for actual non averaged wind speed, converted to km/h with no decimals and when there is no sensor data there, then 0 is taken as speed.
  • Second part is a comparison operator. Defined operators are
    • = equal, != non equal
    • < less than, <= less than or equal
    • > greater than, >= greater than or equal
  • Third part is a numerical value, which can be integer or float.

Examples:

  • wind0wind-act=kmh.1:0 > 10 triggers when current, non-averaged wind speed exceeds 10 km/h
  • th0temp-act=c.1:0 < 0 triggers when outdoor temp goes below 0°C
Complex Condition Expression

Complex expressions can make use multiple operators and brackets. Weather data can be used in terms of Meteobridge variables as explained in Templates section. Variables need to be in full template-like notation, including the surrounding square brackets. Defined operators are:

operators in increasing precedence (from top to bottom)
Operator Description
&&, || logical "and", "or" operators working on value range: 1=true, 0=false
==, !=, >, >=, <, <= comparison operations working on value range: 1=true, 0=false
+, - arithmetic operators "plus" and "minus"
*, / arithmetic operators "multiply" and "divide"
^ arithmetic operator "power"

Result of the expression is interpreted as a boolean. Values above zero are regarded "true", values below or equal zero are regarded "false". When "incremental alarm" is specified, Meteobridge compares new value with former value and does trigger an alarm, when new value is bigger then the one that has triggered an alarm before.

Examples:

  • [rain0total-sumday=mm:0] - 10
    triggers an alarm when todays rain exceeds 10mm. When alarm mode is set to "incremental alarm", every time rain increases above 10mm, a new alarm will be triggered. This happens because the expression does not return a boolean, but a value that regarded "true" when result is above zero (here, 10mm rain fall). Further increases will keep the condition "true" but will also increment the number and therefore, will fire additional alarms.
  • [wind0wind-act=kmh.1:0] > 20 && ([wind0dir-act:180] >= 315 || [wind0dir-act:180] <= 45)
    triggers an alarm when non-averaged wind speed is more than 20 km/h and wind direction is mainly North (NW-NNW-N-NNE-NE).

Event Deletion

Getting rid of a defined event definition is simply done by pulling down the select box in front of the event definition and to press "save" after that.

Event5.png

Twitter Event

When you define a twitter event you just have to fill the "text message" with the message to be posted. Text message can make full use of Meteobridge template variables. The example below sends out a twitter message every day at noon that contains outdoor temperature in degrees Celsius.

Event6.png

Email Event

When you define an email event you have the fill the mandatory email body text field. If the optional "Addr.-To" field is left blank, then the email address from the email service definition at the bottom of the tab is used as default.

Event7.png

In the example above every hour an email is sent out with a subject like "weather at 11:23" and a body text like shown below. Please notice that the "#" symbol divides subject from body text.
temp 12.3°C
gust 6.7kmh

FTP Event

Data to be uploaded via FTP cannot be stored on the Meteobridge as it does not provide the necessary persistent storage capacity. Therefore the templates to be filled with weather data have to reside on a server where Meteobridge can request it from by an URL. When the template URL is specified you have to press "Reload Template" to store the current version of the template into the RAM of the Meteobridge for further use. Beside the URL to the template you also have to define a path that defines to which folder of the FTP server the filled template should be uploaded to.

FTP Dashboard Example

Event8.png

Example above makes use of a pre-defined dashboard html file and fills it every 10 minutes with recent weather data and uploads it as file name "/public_html/dashboard.html" to the specified FTP server. The file "dashboard.html" is a simple HTML file with some Meteobridge weather variables included. When you view "dashboard.html" with your browser it looks like this:

Mydash.png

Details of using variables in templates are explained in Templates section. To illustrate that using these variables is quite easy the HTML body part (omitting the CSS styles for formatting it nicely) of the template of above's example is attached below:

<body>
  <table id="table-2">
    <thead><tr><th>Sensor</th>
               <th>Current</th>
               <th>Today (min)</th>
               <th>Today (max)</th></tr></thead>
    <tbody>
      <tr><td>Outdoor Temperature</td>
          <td>[th0temp-act.1:--]° C</td>
          <td>[th0temp-dmin.1:--]° C</td>
          <td>[th0temp-dmax.1:--]° C</td></tr>
      <tr><td>Outdoor Humidity</td>
          <td>[th0hum-act.0:--] %</td>
          <td>[th0hum-dmin.0:--] %</td>
          <td>[th0hum-dmax.0:--] %</td></tr>
      <tr><td>Outdoor Dew Point</td>
          <td>[th0dew-act.1:--]° C</td>
          <td>[th0dew-dmin.1:--]° C</td>
          <td>[th0dew-dmax.1:--]° C</td></tr>
      <tr><td>Wind Chill Temperature</td>
          <td>[wind0chill-act.1:--]° C</td>
          <td>[wind0chill-dmin.1:--]° C</td>
          <td>[wind0chill-dmax.1:--]° C</td></tr>
      <tr><td>Air Pressure</td>
          <td>[thb0seapress-act.1:--] hPa</td>
          <td>[thb0seapress-dmin.1:--] hPa</td>
          <td>[thb0seapress-dmax.1:--] hPa</td></tr>
      <tr><td>Wind Direction</td>
          <td>[wind0dir-act.0:--]°</td>
          <td></td><td></td></tr>
      <tr><td>Wind Speed (averaged)</td>
          <td>[wind0avgwind-act.1:--] m/s</td>
          <td>[wind0avgwind-dmin.1:--] m/s</td>
          <td>[wind0avgwind-dmax.1:--] m/s</td></tr>
      <tr><td>Gust Speed</td>
          <td>[wind0wind-max5.1:--] m/s</td>
          <td>[wind0wind-dmin.1:--] m/s</td>
          <td>[wind0wind-dmax.1:--] m/s</td></tr>
      <tr><td>Rain</td>
          <td>rate: [rain0rate-act.1:--] mm/h</td>
          <td>sum [rain0total-sumday.1:--] mm</td>
          <td></td></tr>
      <tr><td>Solar Radiation</td>
          <td>[sol0rad-act.0:--] W/qm</td>
          <td>[sol0rad-dmin.0:--] W/qm</td>
          <td>[sol0rad-dmax.0:--] W/qm</td></tr>
      <tr><td>UV Index</td>
          <td>[uv0index-act.1:--] uvi</td>
          <td>[uv0index-dmin.1:--] uvi</td>
          <td>[uv0index-dmax.1:--] uvi</td></tr>
    </tbody>
  </table>
</body>


Saratoga Template Example

Event13.png

Meteobridge is supported by the well-known Saratoga templates, which allow you to easily build your own powerful weather homepage. Procedure how to install the php scripts and how to configure Meteobridge's FTP upload is described in detail here.

When having done the well explained and easy to do setup, your website will look like this:

Saratoga.png

FTP Camera Event

If Meteobridge drags pictures from a web cam or an Ubiquiti AirCam these pictures can also be uploaded via FTP. Here you just have to define the target path and file name, which can include date and time variables as specified by "strftime" GNU C function.

Event9.png

Example above stores a web cam picture every ten minutes and gives it a file name reflecting date and time like "2014-06-23_12:34_weatherpic.jpg". Details about "strftime" syntax can be found here.

HTTP Event

Meteobridge can send HTTP GET requests containing weather data as URL parameter. This can be used to feed individual weather networks. Beside the mandatory URL you can optionally define a success string that is matched against the data the requested web server returns to the Meteobridge.

  • When the success string is empty, no checking against the returned data is done
  • If the success string is not empty the returned data is analyzed and if the given success string is found in the returned data the transmission is expected to be successful, otherwise an Error is signaled.
  • If the success string starts with an exclamation mark "!" the transmission is regarded successful when the string is not found in the returned data.

Event10.png

In the example above Meteobridge sends recent wind speed every 15 seconds to the specified server and assumes transmission went fine, when returned data does not include the string "Error".

MYSQL Event

Meteobridge can send queries to a mysql server, which can be used to register weather data into a regular database. The mandatory query text field will usually contain a mysql insert statement followed by a table name and a list of column names and values. The query is subject to template replacement, so you can use Meteobridge variables to upload weather data to your database.

Event11.png

In the example above Meteobridge sends recent temperature and average wind speed every 10 minutes to a mysql database.

Script Execution Event

Meteoridge can download executable shell scripts from an URL and can execute these scripts. When you define a new event of this type, please lead the script by the "Reload Script" button before trying to execute the script. The parameter text field is optional, in case the script can handle additional parameters. The documentation string is derived from the loaded script and just displays the first line of the script containing a "###" pattern.

Event12.png

Settings above define to trigger script stored at "http://templates.meteobridge.com/reboot.sh" every day at 23:45. There are no parameters to be handed over to the script. The script provides a one-line documentation, which is marked in the script by three leading '#'. As you can see the script below does mainly issue a "reboot" of the Meteobridge.

#!/bin/sh
#
### reboot Meteobridge; no parms
reboot
exit 0