Difference between revisions of "Templates/de"

From meteoplug
Jump to: navigation, search
(Updating to match new version of source page)
Line 7: Line 7:
 
Während "Sensor" festlegt, um welchen Sensor es sich handelt und welcher Sensorwert verwendten werden soll, gibt "Selektor" an, welche Zeitperiode ausgewertet werden soll. Mit "Konverter" kann optional eine Umrechnung in andere Maßeinheiten realisiert werden. Die "Dezimalstellen"-Angabe bestimmt die numerische Auflösung der Daten und die "Ersatzzeichenkette" bestimmt den Wert, der ausgegeben wird, wenn kein Sensorwert für den definierten Zeitraum vorliegt.
 
Während "Sensor" festlegt, um welchen Sensor es sich handelt und welcher Sensorwert verwendten werden soll, gibt "Selektor" an, welche Zeitperiode ausgewertet werden soll. Mit "Konverter" kann optional eine Umrechnung in andere Maßeinheiten realisiert werden. Die "Dezimalstellen"-Angabe bestimmt die numerische Auflösung der Daten und die "Ersatzzeichenkette" bestimmt den Wert, der ausgegeben wird, wenn kein Sensorwert für den definierten Zeitraum vorliegt.
  
==Sensoren==  
+
==Sensors==
Diese Sensoren sind in Meteobridge definiert:
+
These sensors are defined in Meteobridge.
* '''th0temp''': Außentemperatur in Grad Celsius
+
* '''th0temp''': outdoor temperature in degrees Celsius
* '''th0hum''': Relative Außenluftfeuchte in Prozent
+
* '''th0hum''': relative outdoor humidity as percentage
* '''th0dew''': Außentaupunkttemperatur in Grad Celsius
+
* '''th0dew''': outdoor dew point in degrees Celsius
* '''th0heatindex''': Hitzeindex in Grad Celsius
+
* '''th0heatindex''': outdoor heat index in degrees Celsius
* '''thb0temp''': Innentemperatur in Grad Celsius
+
* '''thb0temp''': indoor temperature in degrees Celsius
* '''thb0hum''': Innenluftfeuchte in Prozent
+
* '''thb0hum''': indoor humidity as percentage
* '''thb0dew''': Innentaupunkttemperatur in Grad Celsius
+
* '''thb0dew''': indoor dewpoint in degrees Celsius
* '''thb0press''': Stationsluftdruck in hPa
+
* '''thb0press''': station pressure in hPa
* '''thb0seapress''': auf Meeresspiegelhöhe berechneter Luftdruck in hPa
+
* '''thb0seapress''': normalized pressure (computed to sea level) in hPa
* '''wind0wind''': ungemittelte Windgeschindigkeit in m/s
+
* '''wind0wind''': wind speed in m/s
* '''wind0avgwind''': gemittelte Windgeschindigkeit in m/s
+
* '''wind0avgwind''': average windspeed in m/s (time used for average depends on station)
* '''wind0dir''': Windrichtung in Grad (0° ist Norden)
+
* '''wind0dir''': wind direction in degress (0° is North)
* '''wind0chill''': Windchill-Temperatur in Grad Celsius
+
* '''wind0chill''': wind chill temperature in degrees Celsius
* '''rain0rate''': Regenrate in mm/h
+
* '''rain0rate''': rain rate in mm/h
* '''rain0total''': gefallene Regenmenge in mm
+
* '''rain0total''': rain fall in mm
* '''uv0index''': UV-Index
+
* '''uv0index''': uv index
* '''sol0rad''': Solarstrahlung in W/m^2
+
* '''sol0rad''': solar radiation in W/m^2
* '''sol0evo''': Evapotranspiration in mm (nur für Davis Vantage verfügbar)
+
* '''sol0evo''': evapotranspiration in mm (only supported on Davis Vantage stations)
Wenn ein Sensor nicht existiert oder seine Daten älter als das maximal tolerierte Sensordatenalter sind, wird Meteohub keine Daten einsetzen und sofern definiert, stattdessen die Ersatzzeichenkette einsetzen. Falls keine Ersatzzeichenkette definiert ist, bleibt die Variable unersetzt als Zeichenkette stehen.
+
If a sensor is not there or data of sensor has passed the "tolerated data age" interval, Meteobridge will not provide data for it and will present the value defined as "replacement". If no replacement is given, variable will not be converted into data but will stay as is.
 +
As some weather stations do also report low battery status, there are also sensors '''thb0lowbat''', '''th0lowbat''', etc available. These sensors provide current low bat status (0 = no low battery, 1 = low battery) for each of the base sensors.  
  
 
Einige Stationen unterstützen zusätzliche Temperatur/Feuchte-Sensoren. Meteobridge zählt diese als "th1temp", "th1hum", "th1dew", etc auf. Der Reiter "Live-Daten" zeigt neben den aktuellen Daten auch die Sensornummern dieser Zusatzsensoren. Wenn man über eine mit Bodenfeuchte- udn Blattfeuchte-Sensoren ausgestattete Davis Vantage verfügt, werden diese Sensoren ebenfalls als Temperatur/Feuchte-Sensoren geführt, allerdings ohne Berechnung eines Taupunktes. Die Bodenfeuchte-Sensoren weden als "th10temp", "th10hum", ..., "th13temp", "th13hum" und die Blattfeuchte-Sensoren als "th15temp", "th15hum", ..., "th18temp", "th18hum" geführt. Die "hum"-Werte repräsenstieren in diesem Fall nicht die relative Luftfeuchte, sondern Werte in "cbar" und "wet". Meteobridge erfindet für diese Spezialsensoren keine neuen Selektoren. Der generische Selektor "hum" dient dazu, auch die Werte in "cbar" und "wet" dieser Sensoren abzufragen.
 
Einige Stationen unterstützen zusätzliche Temperatur/Feuchte-Sensoren. Meteobridge zählt diese als "th1temp", "th1hum", "th1dew", etc auf. Der Reiter "Live-Daten" zeigt neben den aktuellen Daten auch die Sensornummern dieser Zusatzsensoren. Wenn man über eine mit Bodenfeuchte- udn Blattfeuchte-Sensoren ausgestattete Davis Vantage verfügt, werden diese Sensoren ebenfalls als Temperatur/Feuchte-Sensoren geführt, allerdings ohne Berechnung eines Taupunktes. Die Bodenfeuchte-Sensoren weden als "th10temp", "th10hum", ..., "th13temp", "th13hum" und die Blattfeuchte-Sensoren als "th15temp", "th15hum", ..., "th18temp", "th18hum" geführt. Die "hum"-Werte repräsenstieren in diesem Fall nicht die relative Luftfeuchte, sondern Werte in "cbar" und "wet". Meteobridge erfindet für diese Spezialsensoren keine neuen Selektoren. Der generische Selektor "hum" dient dazu, auch die Werte in "cbar" und "wet" dieser Sensoren abzufragen.
Line 65: Line 66:
 
Timestamps are strings of format "YYYYMMDDhhmmss". Year "YYYY" is reported in 4 digits, all other values (month "MM", day "DD", hour "hh", minute "mm", second "ss") come with 2 digits, leading zeros are not supressed.  
 
Timestamps are strings of format "YYYYMMDDhhmmss". Year "YYYY" is reported in 4 digits, all other values (month "MM", day "DD", hour "hh", minute "mm", second "ss") come with 2 digits, leading zeros are not supressed.  
 
* '''age''': reports seconds elapsed since last reception of data for that particular sensor.
 
* '''age''': reports seconds elapsed since last reception of data for that particular sensor.
 +
* '''hold''': reports seconds elapsed since last reception of data for that particular sensor, but returns invalid value when age is beyond data hold period of 300 seconds. This allows to return invalid status instead large number of seconds for sensors having dropped off long time ago.
 +
  
 
Neben obigen Selektoren, die fest definierte Zeitfenster selektieren, kann mit den folgenden Selektoren eine Auswertung für einen relativen Zeitraum in die Vergangenheit durchgeführt werden. Die Rückschau reicht wegen der begrenzten Speicherausstattung der Meteobridge nur bis zu 60 Minuten in die Vergangenheit.
 
Neben obigen Selektoren, die fest definierte Zeitfenster selektieren, kann mit den folgenden Selektoren eine Auswertung für einen relativen Zeitraum in die Vergangenheit durchgeführt werden. Die Rückschau reicht wegen der begrenzten Speicherausstattung der Meteobridge nur bis zu 60 Minuten in die Vergangenheit.
Line 73: Line 76:
 
Sensoren wie "rain0total" und "sol0evo", die kumulierte Werte liefern, können wegen der geringeren Abtastdichte (1 Wert pro Minute) bis zu 24 Stunden in die Vergangenheit ausgewertet werden:  
 
Sensoren wie "rain0total" und "sol0evo", die kumulierte Werte liefern, können wegen der geringeren Abtastdichte (1 Wert pro Minute) bis zu 24 Stunden in die Vergangenheit ausgewertet werden:  
 
* '''sum1''', '''sum2''', '''sum3''', ..., '''sum60''', '''sum1h''', '''sum2h''', '''sum3h''', ..., '''sum24h''': selektiert zusammengerechnete Deltawerte der letzten einen bis 60 Minuten oder der letzten einen bis 24 Stunden, welches zum Berechnen der gefallenen Regenmenge im definierten Zeitraum erforderlich ist. Beispiel: "rain0total-sum60" ergibt die gefallene Regenmenge in mm der letzten 60 Minuten.
 
* '''sum1''', '''sum2''', '''sum3''', ..., '''sum60''', '''sum1h''', '''sum2h''', '''sum3h''', ..., '''sum24h''': selektiert zusammengerechnete Deltawerte der letzten einen bis 60 Minuten oder der letzten einen bis 24 Stunden, welches zum Berechnen der gefallenen Regenmenge im definierten Zeitraum erforderlich ist. Beispiel: "rain0total-sum60" ergibt die gefallene Regenmenge in mm der letzten 60 Minuten.
 +
 +
===Meteobridge PRO Additions===
 +
Selectors '''val''', '''min''', '''max''', '''avg''', '''sum''', '''mintime''', '''maxtime''' can be combined with a "@YYYYMMDDhhmm" specifier, which determines the point in time where the data should be taken from. This specifier also defines if data should be used on a per minute, per hour, per day, per month or per year resolution. To get data in a per minute resolution the specifier needs to define the point in time down to the minute. Example: "min@201512190900" selects minimum data from December 19, 2015 at 09:00 (on a per minute base), while "min@2015121909" selects minimum data from December 19, 2015 09:00 until 9:59 (on a per hour base). This is how the specifier works:
 +
* '''@YYYY''' selects data for the specified year. Example: Using "[th0temp-min@2015]" in a template will report minimum outdoor temperature of 2015.
 +
* '''@YYYYMM''' selects data for the specified month. Example: Using "[wind0wind-max@201509]" in a template will report maximum wind speed (gust) of September 2015.
 +
* '''@YYYYMMDD''' selects data for the specified day. Example: Using "[rain0total-sum@20151031]" in a template will report total rainfall on October 31, 2015.
 +
* '''@YYYYMMDDhh''' selects data for the specified hour. Example: Using "[uv0index-avg@2015110316]" in a template will report average UV index on November 3, 2015 between 16:00 and 16:59.
 +
* '''@YYYYMMDDhhmm''' selects data for the specified minute. Example: Using "[thb0seapress-val@201512251200]" in a template will report sealevel pressure on Christmas noon, 2015 at 12:00.
 +
 +
In addition to specify an absolute point in time (as explained above) you can also use points in time relative to now. Relative points in time can be specified in terms of years, months, days, hours and minutes as follows:
 +
* '''@Y'''n addresses yearly data n years in the past. Example: When you are in 2016 and specifiy "[th0temp-max@Y1]" it will return the maximum outdoor temperature of last year (2015), while "@Y3" will address data from 2013.
 +
* '''@M'''n addresses monthly data n months in the past. Example: "[wind0wind-max@M0] will return max wind speed of current month, while "[wind0wind-max@M1]" will return max wind speed of previous month.
 +
* '''@D'''n addresses daily data n days in the past. Example: "[th0temp-min@D7]" will return minimum outdoor temperature of the current day, one week in the past.
 +
* '''@h'''n addresses hourly data n hours in the past.
 +
* '''@m'''n addresses minute data n minutes in the past.
 +
 +
'''val''' will give same results as average and only makes sense on a per minute base, where data of that minute is reported. It can also be averaged, when more than one sensor reading has occurred during that minute.
 +
 +
'''mintime''' and '''maxtime''' report time stamp down to the second when minimum/maximum value of defined time frame has occurred.
  
 
==Converters==
 
==Converters==
Line 89: Line 111:
 
* '''nldir''' converts a wind direction into one of 16 Dutch direction texts.
 
* '''nldir''' converts a wind direction into one of 16 Dutch direction texts.
 
* '''dedir''' converts a wind direction into one of 16 German direction texts.
 
* '''dedir''' converts a wind direction into one of 16 German direction texts.
If an unknown conversion string is used, no conversion will take place, no error message will appear.
+
* '''barotrend''' converts a delta measurement (selector '''delta''') into a barometer trend analysis pattern (1 hPa is about 0.03 inHg):
 +
** '''-2''': delta <= -2 hPa
 +
** '''-1''': -2 hPa < delta <= -1 hPa
 +
** ''' 0''': -1 hPa < delta < +1 hPa
 +
** '''+1''': +1 hPa <= delta < +2 hPa
 +
** '''+2''': +2 hPa <= delta
 +
* '''enbarotrend''' reports trend as strings '''FF''', '''FS''', '''ST''', '''RS''', '''RF'''
  
 
Wenn Variable einen Zeitstempel liefern, kann dieser von lokaler Zeit (Voreinstellung) auf Weltzeit (UTC) umgerechnet weden:
 
Wenn Variable einen Zeitstempel liefern, kann dieser von lokaler Zeit (Voreinstellung) auf Weltzeit (UTC) umgerechnet weden:
Line 114: Line 142:
 
* '''platform''': string that specifies hw platform (example: "TL-MR3020")
 
* '''platform''': string that specifies hw platform (example: "TL-MR3020")
 
* '''station''': string that specifies selected weather station (expample: "WMR-200")
 
* '''station''': string that specifies selected weather station (expample: "WMR-200")
 +
* '''stationnum''': integer that specifies selected weather station (expample: 49)
 
* '''language''': language used on Meteobridge's web interface (example: "English")
 
* '''language''': language used on Meteobridge's web interface (example: "English")
 
* '''timezone''': defined timezone (example: "Europe/Berlin")
 
* '''timezone''': defined timezone (example: "Europe/Berlin")
Line 119: Line 148:
 
* '''longitude''': longitude as float (example: 9.885357)
 
* '''longitude''': longitude as float (example: 9.885357)
 
* '''uptime''': uptime of Meteobridge in seconds
 
* '''uptime''': uptime of Meteobridge in seconds
 +
* '''cpuload1m''', '''cpuload5m''', '''cpuload15m''' shows average cpu load during last 1, 5, 15 minutes
 +
* '''ip''': IP address
 +
* '''lanip''': IP address on the LAN port (if connected)
 +
* '''wlanip''': IP address of the WLAN (if connected)
 
* '''lastdata''': seconds passed since last piece of data received from weather station, returns -1 if no data received. Does not distinguish between useful and useless garbage data
 
* '''lastdata''': seconds passed since last piece of data received from weather station, returns -1 if no data received. Does not distinguish between useful and useless garbage data
 
* '''lastgooddata''': seconds passed since last piece of meaningfull sensor data recorded, returns -1 if no sensor data recorded so far
 
* '''lastgooddata''': seconds passed since last piece of meaningfull sensor data recorded, returns -1 if no sensor data recorded so far
 +
* '''solarmax''': maximum possible solar radiation on that day at that point of the earth. Needs latitude and longitude set and pressure data available.
 
* '''lunarage''': days passes since new moon as integer (example: 28)
 
* '''lunarage''': days passes since new moon as integer (example: 28)
 
* '''lunarpercent''': lunarphase given as percentage from 0% (new moon) to 100% (full moon)
 
* '''lunarpercent''': lunarphase given as percentage from 0% (new moon) to 100% (full moon)
Line 127: Line 161:
 
* '''civildaylength''': alternative method for daylength computation (example: "12:38")
 
* '''civildaylength''': alternative method for daylength computation (example: "12:38")
 
* '''nauticaldaylength''': alternative method for daylength computation (example: "14:00")
 
* '''nauticaldaylength''': alternative method for daylength computation (example: "14:00")
* '''sunrise''': time of sunrise in local time. Can be converterd to UTC by applying "=utc" to the variable (example: "06:47", resp. "05:47")
+
* '''sunrise''': returns time of sunrise in local time. Can be converted to UTC by applying "=utc" to the variable (example: "06:47", resp. "05:47") or can be converted to 12h time mode by applying "=apm" (example: "8:45AM").
* '''sunset'''. time of sunset in local time. Can be converterd to UTC by applying "=utc" to the variable (example: "18:15", resp. "17:15")
+
* '''sunset''': returns time of sunset in local time. Can be converted to UTC by applying "=utc" to the variable (example: "18:15", resp. "17:15") or can be converted to 12h time mode by applying "=apm" (example: "12:45AM").
* '''civilsunrise''', '''civilsunset''', '''nauticalsunrise''', '''nauticalsunset''': alternative computations for sunset and sunrise.
+
* '''civilsunrise''', '''civilsunset''', '''nauticalsunrise''', '''nauticalsunset''': alternative computations for sunset and sunrise. These can also be converted to UTC ("=utc") or AM/PM ("=apm") as "sunrise and sunset".
 
* '''daynightflag''': returns "D" when there is daylight, otherwise "N".
 
* '''daynightflag''': returns "D" when there is daylight, otherwise "N".
 
* '''isday''': returns "1" when there is daylight, otherwise "0".
 
* '''isday''': returns "1" when there is daylight, otherwise "0".
 
* '''isnight''': returns "0" when there is daylight, otherwise "1".
 
* '''isnight''': returns "0" when there is daylight, otherwise "1".
* '''moonrise''': time of moonrise in local time. Can be converterd to UTC by applying "=utc" to the variable. Please notice that not every day has a moonrise time, therefore, variable can be non-existent on certain days (example: "05:46", resp. "04:46")
+
* '''moonrise''': time of moonrise in local time. Can be converterd to UTC or AP/PM notation by applying "=utc" resp. "=apm" to the variable. Please notice that not every day has a moonrise time, therefore, variable can be non-existent on certain days (example: "05:46", resp. "04:46")
* '''moonset''': time of moonset in local time. Can be converterd to UTC by applying "=utc" to the variable. Please notice that not every day has a moonset time, therefore, variable can be non-existent on certain days (example: "17:00", resp. "16:00")
+
* '''moonset''': time of moonset in local time. Can be converterd to UTC or AP/PM notation by applying "=utc" resp. "=apm" to the variable. Please notice that not every day has a moonset time, therefore, variable can be non-existent on certain days (example: "17:00", resp. "16:00")
 
* '''graphA''': returns URL of the user's Meteoplug chart "*instruments-black"
 
* '''graphA''': returns URL of the user's Meteoplug chart "*instruments-black"
 
* '''graphB''': returns URL of the user's Meteoplug chart "*instruments-black-imp"
 
* '''graphB''': returns URL of the user's Meteoplug chart "*instruments-black-imp"
Line 175: Line 209:
  
 
==Numerical Expressions==
 
==Numerical Expressions==
A numerical expression that Meteobridge should evaluate needs to be enclosed by <font face="Courier"><span style="background-color:lightgrey;">{*</span></font face> and <font face="Courier"><span style="background-color:lightgrey;">*}</span></font face>. The enclosed expression can also include template variables. This allows to do various computations with numerical data. Resulting value is returned with two decimals. You can define how many digits the return value should have by stating the number of decimals betwenn the * and } when closing the numerical expression. For example, <font face="Courier"><span style="background-color:lightgrey;">*0}</span></font face> does set number of decimals to 0, which will return a rounded integer value.
+
A numerical expression that Meteobridge should evaluate needs to be enclosed by <font face="Courier"><span style="background-color:lightgrey;">{*</span></font face> and <font face="Courier"><span style="background-color:lightgrey;">*}</span></font face>. The enclosed expression can also include template variables. This allows to do various computations with numerical data. Resulting value is returned with two decimals. You can define how many digits the return value should have by stating the number of decimals betwenn the * and } when closing the numerical expression. For example, <font face="Courier"><span style="background-color:lightgrey;">*0}</span></font face> does set number of decimals to 0, which will return a rounded integer value. When you are looking for a non-rounded, truncated integer then <font face="Courier"><span style="background-color:lightgrey;">*t}</span></font face> will do the job.
  
 
The following operators can be used within numerical expressions:
 
The following operators can be used within numerical expressions:
Line 201: Line 235:
 
|arithmetic functions: square root, logarithm, logarithmic exponent, sinus, arcus sinus, cosinus, arcus cosinus, tangens, arcus tangens, arcus tangens2, absolute, floting point absolut, lower integer, upper integer, rounded integer
 
|arithmetic functions: square root, logarithm, logarithmic exponent, sinus, arcus sinus, cosinus, arcus cosinus, tangens, arcus tangens, arcus tangens2, absolute, floting point absolut, lower integer, upper integer, rounded integer
 
|}
 
|}
 +
 +
To override operator precedence, brackets "(" and ")" can be used as usual.
 +
 +
==Conditional Expressions==
 +
Templates can work with simple conditional expressions. These expressions are not allowed to be used recursive and they must be used on top-level, i.e. not inside numerical expressions. Expressions must be built in a strict '''#if# ... #then# ... #else# ... #fi#''' manner.
 +
* '''#if#''' indicates start of the expression.
 +
* Between '''#if#''' and '''#then#''' a number is expected. Blanks will be ignored. If number is greater than 0.0 the expression is recognized as true otherwise as false.
 +
* In case of true expression, characters between '''#then#''' and '''#else#''' token will be used to replace the whole conditional expression in the template.
 +
* In case of false expression, characters between '''#else#''' and '''#fi#''' token will be used to replace the whole conditional expression in the template.
 +
As conditional expressions will be evaluated at the very end, any template replacement operations or numerical computations will be done before.
 +
  
 
==Beispiele==
 
==Beispiele==
Line 209: Line 254:
 
# Template <font face="Courier"><span style="background-color:lightgrey;">Max gust in last 10 minutes was: [wind0wind-max10.1:--]m/s, [wind0wind-max10=mph.1:--]mph, [wind0wind-max10=kn.0:--]kn</span></font face> will be converted into <font face="Courier"><span style="background-color:lightgrey;">Max gust in last 10 minutes was: 10.5m/s, 23.5mph, 20kn</span></font face>.
 
# Template <font face="Courier"><span style="background-color:lightgrey;">Max gust in last 10 minutes was: [wind0wind-max10.1:--]m/s, [wind0wind-max10=mph.1:--]mph, [wind0wind-max10=kn.0:--]kn</span></font face> will be converted into <font face="Courier"><span style="background-color:lightgrey;">Max gust in last 10 minutes was: 10.5m/s, 23.5mph, 20kn</span></font face>.
 
# Template <font face="Courier"><span style="background-color:lightgrey;">Max gust in last 10 minutes was: [wind0wind-max10.1:0]m/s, {*[wind0wind-max10.1:0] * 3.6 *1}kph</span></font face> will be converted into <font face="Courier"><span style="background-color:lightgrey;">Max gust in last 10 minutes was: 10.5m/s, 37.8kph</span></font face>.
 
# Template <font face="Courier"><span style="background-color:lightgrey;">Max gust in last 10 minutes was: [wind0wind-max10.1:0]m/s, {*[wind0wind-max10.1:0] * 3.6 *1}kph</span></font face> will be converted into <font face="Courier"><span style="background-color:lightgrey;">Max gust in last 10 minutes was: 10.5m/s, 37.8kph</span></font face>.
 +
# Template <font face="Courier"><span style="background-color:lightgrey;">Max gust in last 10 minutes was: #if#{*[wind0wind-age:999]>600*}#then#--#else#[wind0wind-max10.1:0]m/s, {*[wind0wind-max10.1:0] * 3.6 *1}kph#fi#</span></font face> will be converted into <font face="Courier"><span style="background-color:lightgrey;">Max gust in last 10 minutes was: 10.5m/s, 37.8kph</span></font face> when last wind data is less than 10 minutes old (600 seconds) and will be <font face="Courier"><span style="background-color:lightgrey;">Max gust in last 10 minutes was: --</span></font face> otherwise.
 +
# Template <font face="Courier"><span style="background-color:lightgrey;">[th0temp-dmintime=apm.ij]:[th0temp-dmintime=apm.kl][th0temp-dmintime=apm.op]</span></font face> reports the time stamp of lowest outdoor temperature of today in 12 hour AM/PM notation: <font face="Courier"><span style="background-color:lightgrey;">12:34AM</span></font face>

Revision as of 15:56, 7 May 2016

Other languages:
Deutsch • ‎English

Meteobridge stellt einen sehr flexiblen Ersetzungsmechanismus zur Verfügung, mit dem definierte Variable durch konkrete Sensorwerte ersetzt werden. Dies ermöglich Meteobridge in beliebige Zeichenketten Variable "einzuschmuggeln", seien es E-Mail, HTML-Seiten, Alarmbedingungen, etc.

Die Variable werden in dem Moment, in dem die Zeichenkette an den Upload zum Zieldienst übergeben wird surch reale Werte ersetzte. Kann das Datenpaket nicht zugestellt werden, wird die Zustellung gegebenenfalls wiederholt, jedoch mit den bei der Erstbeauftragung eingesetzten Daten.

Jede Variable beginnt und endet mit einer eckigen Klammer "[" und "]". Die Variable in diesen Klammern zeigt die folgende Struktur:
Sensor-Selektor=Konverter.Dezimalstellen:Ersatzzeichenkette

"Konverter", "Dezimalstellen" und "Ersatzzeichenkette" kann weggelassen werden, "Sensor" und "Selektor" müssen angegeben werden. Während "Sensor" festlegt, um welchen Sensor es sich handelt und welcher Sensorwert verwendten werden soll, gibt "Selektor" an, welche Zeitperiode ausgewertet werden soll. Mit "Konverter" kann optional eine Umrechnung in andere Maßeinheiten realisiert werden. Die "Dezimalstellen"-Angabe bestimmt die numerische Auflösung der Daten und die "Ersatzzeichenkette" bestimmt den Wert, der ausgegeben wird, wenn kein Sensorwert für den definierten Zeitraum vorliegt.

Sensors

These sensors are defined in Meteobridge.

  • th0temp: outdoor temperature in degrees Celsius
  • th0hum: relative outdoor humidity as percentage
  • th0dew: outdoor dew point in degrees Celsius
  • th0heatindex: outdoor heat index in degrees Celsius
  • thb0temp: indoor temperature in degrees Celsius
  • thb0hum: indoor humidity as percentage
  • thb0dew: indoor dewpoint in degrees Celsius
  • thb0press: station pressure in hPa
  • thb0seapress: normalized pressure (computed to sea level) in hPa
  • wind0wind: wind speed in m/s
  • wind0avgwind: average windspeed in m/s (time used for average depends on station)
  • wind0dir: wind direction in degress (0° is North)
  • wind0chill: wind chill temperature in degrees Celsius
  • rain0rate: rain rate in mm/h
  • rain0total: rain fall in mm
  • uv0index: uv index
  • sol0rad: solar radiation in W/m^2
  • sol0evo: evapotranspiration in mm (only supported on Davis Vantage stations)

If a sensor is not there or data of sensor has passed the "tolerated data age" interval, Meteobridge will not provide data for it and will present the value defined as "replacement". If no replacement is given, variable will not be converted into data but will stay as is. As some weather stations do also report low battery status, there are also sensors thb0lowbat, th0lowbat, etc available. These sensors provide current low bat status (0 = no low battery, 1 = low battery) for each of the base sensors.

Einige Stationen unterstützen zusätzliche Temperatur/Feuchte-Sensoren. Meteobridge zählt diese als "th1temp", "th1hum", "th1dew", etc auf. Der Reiter "Live-Daten" zeigt neben den aktuellen Daten auch die Sensornummern dieser Zusatzsensoren. Wenn man über eine mit Bodenfeuchte- udn Blattfeuchte-Sensoren ausgestattete Davis Vantage verfügt, werden diese Sensoren ebenfalls als Temperatur/Feuchte-Sensoren geführt, allerdings ohne Berechnung eines Taupunktes. Die Bodenfeuchte-Sensoren weden als "th10temp", "th10hum", ..., "th13temp", "th13hum" und die Blattfeuchte-Sensoren als "th15temp", "th15hum", ..., "th18temp", "th18hum" geführt. Die "hum"-Werte repräsenstieren in diesem Fall nicht die relative Luftfeuchte, sondern Werte in "cbar" und "wet". Meteobridge erfindet für diese Spezialsensoren keine neuen Selektoren. Der generische Selektor "hum" dient dazu, auch die Werte in "cbar" und "wet" dieser Sensoren abzufragen.

Selectors

Sensors are followed by a selector (syntactically separated by a dash) that specifies what period in time should be used for evaluation. Valid selectors are:

  • act: most recent data
  • hmin: minimum value of this hour
  • hmax: maximum value of this hour
  • dmin: minimum value of today
  • dmax: maximum value of today
  • ydmin: minimum value of yesterday
  • ydmax: maximum value of yesterday
  • mmin: minimum value of this month
  • mmax: maximum value of this month
  • ymin: minimum value of this year
  • ymax: maximum value of this year
  • amin: minimum value of all time
  • amax: maximum value of all time

Sensors that deliver cumulated data like "rain0total" and "sol0evo" should be used with the following selectors only:

  • hoursum, daysum or sumday, monthsum, yearsum, allsum, ydaysum: selects summerized delta values from today, this month, this year, all time or yesterday. Example: "rain0total-sumday" is todays rain fall.

When you are interested in timestamps of min/max values, you can make use of these selectors:

  • hmintime: timestamp of minimum value of this hour
  • hmaxtime: timestamp of maximum value of this hour
  • dmintime: timestamp of minimum value of today
  • dmaxtime: timestamp of maximum value of today
  • ydmintime: timestamp of minimum value of yesterday
  • ydmaxtime: timestamp of maximum value of yesterday
  • mmintime: timestamp of minimum value of this month
  • mmaxtime: timestamp of maximum value of this month
  • ymintime: timestamp of minimum value of this year
  • ymaxtime: timestamp of maximum value of this year
  • amintime: timestamp of minimum value of all time
  • amaxtime: timestamp of maximum value of all time
  • starttime: timestamp of first recorded value

Timestamps are strings of format "YYYYMMDDhhmmss". Year "YYYY" is reported in 4 digits, all other values (month "MM", day "DD", hour "hh", minute "mm", second "ss") come with 2 digits, leading zeros are not supressed.

  • age: reports seconds elapsed since last reception of data for that particular sensor.
  • hold: reports seconds elapsed since last reception of data for that particular sensor, but returns invalid value when age is beyond data hold period of 300 seconds. This allows to return invalid status instead large number of seconds for sensors having dropped off long time ago.


Neben obigen Selektoren, die fest definierte Zeitfenster selektieren, kann mit den folgenden Selektoren eine Auswertung für einen relativen Zeitraum in die Vergangenheit durchgeführt werden. Die Rückschau reicht wegen der begrenzten Speicherausstattung der Meteobridge nur bis zu 60 Minuten in die Vergangenheit.

  • val1, val2, val13, ..., val60: selektiert den Sensorwert von vor einer bis 60 Minuten
  • max1, max2, max3, ..., max60: selektiert das Maximum der letzten einen bis 60 Minuten
  • min1, min2, min3, ..., min60: selektiert das Minimum der letzten einen bis 60 Minuten
  • avg1, avg2, avg3, ..., avg60: selektiert den Durchschnittswert der letzten einen bis 60 Minuten

Sensoren wie "rain0total" und "sol0evo", die kumulierte Werte liefern, können wegen der geringeren Abtastdichte (1 Wert pro Minute) bis zu 24 Stunden in die Vergangenheit ausgewertet werden:

  • sum1, sum2, sum3, ..., sum60, sum1h, sum2h, sum3h, ..., sum24h: selektiert zusammengerechnete Deltawerte der letzten einen bis 60 Minuten oder der letzten einen bis 24 Stunden, welches zum Berechnen der gefallenen Regenmenge im definierten Zeitraum erforderlich ist. Beispiel: "rain0total-sum60" ergibt die gefallene Regenmenge in mm der letzten 60 Minuten.

Meteobridge PRO Additions

Selectors val, min, max, avg, sum, mintime, maxtime can be combined with a "@YYYYMMDDhhmm" specifier, which determines the point in time where the data should be taken from. This specifier also defines if data should be used on a per minute, per hour, per day, per month or per year resolution. To get data in a per minute resolution the specifier needs to define the point in time down to the minute. Example: "min@201512190900" selects minimum data from December 19, 2015 at 09:00 (on a per minute base), while "min@2015121909" selects minimum data from December 19, 2015 09:00 until 9:59 (on a per hour base). This is how the specifier works:

  • @YYYY selects data for the specified year. Example: Using "[th0temp-min@2015]" in a template will report minimum outdoor temperature of 2015.
  • @YYYYMM selects data for the specified month. Example: Using "[wind0wind-max@201509]" in a template will report maximum wind speed (gust) of September 2015.
  • @YYYYMMDD selects data for the specified day. Example: Using "[rain0total-sum@20151031]" in a template will report total rainfall on October 31, 2015.
  • @YYYYMMDDhh selects data for the specified hour. Example: Using "[uv0index-avg@2015110316]" in a template will report average UV index on November 3, 2015 between 16:00 and 16:59.
  • @YYYYMMDDhhmm selects data for the specified minute. Example: Using "[thb0seapress-val@201512251200]" in a template will report sealevel pressure on Christmas noon, 2015 at 12:00.

In addition to specify an absolute point in time (as explained above) you can also use points in time relative to now. Relative points in time can be specified in terms of years, months, days, hours and minutes as follows:

  • @Yn addresses yearly data n years in the past. Example: When you are in 2016 and specifiy "[th0temp-max@Y1]" it will return the maximum outdoor temperature of last year (2015), while "@Y3" will address data from 2013.
  • @Mn addresses monthly data n months in the past. Example: "[wind0wind-max@M0] will return max wind speed of current month, while "[wind0wind-max@M1]" will return max wind speed of previous month.
  • @Dn addresses daily data n days in the past. Example: "[th0temp-min@D7]" will return minimum outdoor temperature of the current day, one week in the past.
  • @hn addresses hourly data n hours in the past.
  • @mn addresses minute data n minutes in the past.

val will give same results as average and only makes sense on a per minute base, where data of that minute is reported. It can also be averaged, when more than one sensor reading has occurred during that minute.

mintime and maxtime report time stamp down to the second when minimum/maximum value of defined time frame has occurred.

Converters

Sensor data is reported in ISO units (°C, hPa, mm, m/s) by default, but can be converted into non-ISO units (imperial) by adding a conversion token. Defined tokens are:

  • F converts temperature from Celsius to Fahrenheit.
  • psi converts pressure from hPa (equivalent to mbar) to psi.
  • mmHg converts pressure from hPa to millimeters of mercury.
  • inHg converts pressure from hPa to inches of mercury.
  • kmh converts wind speed from meters per second to kilometers per hour.
  • mph converts wind speed from meters per second to miles per hour.
  • kn converts wind speed from meters per second to knots.
  • bft converts wind speed from meters per second to Beaufort scale.
  • in converts millimeters to inches.
  • ft converts meters to feet.
  • endir converts a wind direction into one of 16 English direction texts.
  • nldir converts a wind direction into one of 16 Dutch direction texts.
  • dedir converts a wind direction into one of 16 German direction texts.
  • barotrend converts a delta measurement (selector delta) into a barometer trend analysis pattern (1 hPa is about 0.03 inHg):
    • -2: delta <= -2 hPa
    • -1: -2 hPa < delta <= -1 hPa
    • 0: -1 hPa < delta < +1 hPa
    • +1: +1 hPa <= delta < +2 hPa
    • +2: +2 hPa <= delta
  • enbarotrend reports trend as strings FF, FS, ST, RS, RF

Wenn Variable einen Zeitstempel liefern, kann dieser von lokaler Zeit (Voreinstellung) auf Weltzeit (UTC) umgerechnet weden:

  • utc gibt den Zeitstempel nicht in lokaler Zeit (Voreinstellung) sondern in Weltzeit aus.

Vorhersage-Variable

Wenn Meteobridge mit einer Davis Vantage verbunden ist, stehen die Vorhersagen der Vantage in Meteobridge als Variable zur Verfügung. Alle Vorhersagevariable tragen als Sensornamen "forecast" gefolgt von einem der folgenden Selektoren:

  • rule: berichtet die Vorhersagenummer. Wenn keine Vantage angschlossen ist oder keine Vorhersage verfügbar ist, ist diese Zahl negativ.
  • text: Vorhersagetext in Englisch
  • textde: Vorhersagetext in Deutsch (UTF-8-kofiert)
  • textdeiso: Vorhersagetext in Deutsch (ISO-8859-kodiert)
  • textdehtml: Vorhersagetext in Deutsch (HTML-kodiert)
  • textit: Vorhersagetext in Italienisch
  • textnl: Vorhersagetext in Holländisch
  • textest: Vorhersagetext in Estonisch
  • texthr: Vorhersagetext in Ungarisch
  • textcz: Vorhersagetext in Tschechisch

System Variables

Meteobridge provides some additional variables that tell details not directly related to weather conditions. Sensor name is "mbsystem", defined selectors are:

  • mac: Meteobridge MAC hardware address (example: "40:01:FE:23:12:A8")
  • swversion: Meteobridge version string (example: "1.1")
  • buildnum: build number as integer (example: 1673)
  • platform: string that specifies hw platform (example: "TL-MR3020")
  • station: string that specifies selected weather station (expample: "WMR-200")
  • stationnum: integer that specifies selected weather station (expample: 49)
  • language: language used on Meteobridge's web interface (example: "English")
  • timezone: defined timezone (example: "Europe/Berlin")
  • latitude: latitude as float (example: 53.875120)
  • longitude: longitude as float (example: 9.885357)
  • uptime: uptime of Meteobridge in seconds
  • cpuload1m, cpuload5m, cpuload15m shows average cpu load during last 1, 5, 15 minutes
  • ip: IP address
  • lanip: IP address on the LAN port (if connected)
  • wlanip: IP address of the WLAN (if connected)
  • lastdata: seconds passed since last piece of data received from weather station, returns -1 if no data received. Does not distinguish between useful and useless garbage data
  • lastgooddata: seconds passed since last piece of meaningfull sensor data recorded, returns -1 if no sensor data recorded so far
  • solarmax: maximum possible solar radiation on that day at that point of the earth. Needs latitude and longitude set and pressure data available.
  • lunarage: days passes since new moon as integer (example: 28)
  • lunarpercent: lunarphase given as percentage from 0% (new moon) to 100% (full moon)
  • lunarsegment: lunarphase segment as integer (0 = new moon, 1-3 = growing moon: quarter, half, three quarters, 4 = full moon, 5-7 = shrinking moon: three quarter, half, quarter)
  • daylength: length of day (example: "11:28")
  • civildaylength: alternative method for daylength computation (example: "12:38")
  • nauticaldaylength: alternative method for daylength computation (example: "14:00")
  • sunrise: returns time of sunrise in local time. Can be converted to UTC by applying "=utc" to the variable (example: "06:47", resp. "05:47") or can be converted to 12h time mode by applying "=apm" (example: "8:45AM").
  • sunset: returns time of sunset in local time. Can be converted to UTC by applying "=utc" to the variable (example: "18:15", resp. "17:15") or can be converted to 12h time mode by applying "=apm" (example: "12:45AM").
  • civilsunrise, civilsunset, nauticalsunrise, nauticalsunset: alternative computations for sunset and sunrise. These can also be converted to UTC ("=utc") or AM/PM ("=apm") as "sunrise and sunset".
  • daynightflag: returns "D" when there is daylight, otherwise "N".
  • isday: returns "1" when there is daylight, otherwise "0".
  • isnight: returns "0" when there is daylight, otherwise "1".
  • moonrise: time of moonrise in local time. Can be converterd to UTC or AP/PM notation by applying "=utc" resp. "=apm" to the variable. Please notice that not every day has a moonrise time, therefore, variable can be non-existent on certain days (example: "05:46", resp. "04:46")
  • moonset: time of moonset in local time. Can be converterd to UTC or AP/PM notation by applying "=utc" resp. "=apm" to the variable. Please notice that not every day has a moonset time, therefore, variable can be non-existent on certain days (example: "17:00", resp. "16:00")
  • graphA: returns URL of the user's Meteoplug chart "*instruments-black"
  • graphB: returns URL of the user's Meteoplug chart "*instruments-black-imp"
  • graphC: returns URL of the user's Meteoplug chart "*iphone-black"
  • graphD: returns URL of the user's Meteoplug chart "*iphone-black-imp"
  • graphE: returns URL of the user's Meteoplug chart "*iphone-tw-2d"
  • graphF: returns URL of the user's Meteoplug chart "*iphone-tw-2d-imp"
  • graphG: returns URL of the user's Meteoplug chart "*iphone-pr-2d"
  • graphH: returns URL of the user's Meteoplug chart "*iphone-pr-2d-imp"

Zeit/Datums-Variable

Die Ausgaben der aktuellen Zeit oder des aktuellen Datums entspricht nicht dem "Sensor-Selektor=Konverter" Schema, sondern ist wie folgt definiert.

Datum und Uhrzeit ist wie folgt definiert:

  • YYYY: Jahr, vierstellig
  • YY: Jahr, zweistellig
  • MM: Monat, zweistellig (ggf mit führender Null)
  • M: Monat (ohne führende Null)
  • DD: Tag, zweistellig (ggf mit führender Null)
  • D: Tag (ohne führende Null)
  • hh: Stunde in 24h-Notation, zweistellig (ggf mit führende Null)
  • h: Stunde in 24h-Notation (ohne führende Null)
  • HH: Stunde in 12h-Notation, zweistellig (ggf mit führende Null)
  • H: Stunde in 12h-Notation (ohne führende Null)
  • apm: ergibt "am" oder "pm" je nach Tageszeit
  • APM: ergibt "AM" oder "PM" je nach Tageszeit
  • mm: Minuten, zweistellig (ggf mit führender Null)
  • m: Minuten (ohne führende Null)
  • ss: Sekunden, zweistellig (ggf mit führender Null)
  • s: Sekunden (ohne führende NuLL)

Wenn ein großes "U" vorangestellt ist, wird mit Weltzeit gearbeitet (UTC), ansonsten mit lokaler Zeit. Beispiel: "[Uhh]:[Umm]:[Uss] UTC" wird zu einer Zeichenkette der Art "16:03:33 UTC" übersetzt

Nachkommastellen

Sofern nicht anders definiert werden Zahlen mit einer Dezimalstelle berichtet. Durch Setzen des Wertes für die Nachkommastellen kann die Anzahl der bei der Ausgabe verwendten Dezimalstellen bestimmt werden.

Wenn die Variable einen Zeichenkette anstelle einer Zahl zurückliefert - wie beispielsweise bei Zeitstempeln -, dann hat die "Nachkommastellen"-Definition eine andere Form und Bedeutung. Die Angabe enthält dann zwei Positionszeichen, die die Start- und eine Endeposition des herausuzulösenden Sub-Strings bezeichnen. Die Positionszeichen sind Kleinbuchstaben. Der erste gibt die Startposition an. "a" steht für das erste Zeichen der Zeichenkette, "b" für das zweite, etc. Das zweite Positionszeichen hat dieselbe Form und gibt das letzte Zeichen der herauszulösdenden Zeichenkette an. Beispiel: Aus dem Zeitstempel "20130303121055" werde mit den Positionszeichen ".ad" die ersten vier Zeichen selektiert. Wenn man die zeit der tiefsten Außentempratur des heutigen Tages erhalten möchte, kann man das Template [th0temp-dmintime.ij:--]:[th0temp-dmintime.kl:--] verwenden. "ij" selektieren den Stundenwert an Position 9-10 und "kl" den Minutenwert an Position 11-12 des Zeitstempels.

Ersatzzeichenkette

Wenn eine Variable nicht definiert ist oder keinen gültigen Wert liefern kann, wird die spezifizierte Ersatzzeichenkette ausgegeben, die auch leer sein kann. Fehlt die Angabe der Ersatzzeichenkette bleibt die Variabledefinition unverändert in der Zeichenkette stehen und wird nicht ersetzt.

Numerical Expressions

A numerical expression that Meteobridge should evaluate needs to be enclosed by {* and *}. The enclosed expression can also include template variables. This allows to do various computations with numerical data. Resulting value is returned with two decimals. You can define how many digits the return value should have by stating the number of decimals betwenn the * and } when closing the numerical expression. For example, *0} does set number of decimals to 0, which will return a rounded integer value. When you are looking for a non-rounded, truncated integer then *t} will do the job.

The following operators can be used within numerical expressions:

operators in increasing precedence (from top to bottom)
Operator / Function 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", "divide" and "modulus" (which rounds the operands to integers first)
^ arithmetic operator "power"
sqrt(), log(), exp(), sin(), asin(), cos(), acos(), tan(), atan(), atan2(), abs(), fabs(), floor(), ceil(), round() arithmetic functions: square root, logarithm, logarithmic exponent, sinus, arcus sinus, cosinus, arcus cosinus, tangens, arcus tangens, arcus tangens2, absolute, floting point absolut, lower integer, upper integer, rounded integer

To override operator precedence, brackets "(" and ")" can be used as usual.

Conditional Expressions

Templates can work with simple conditional expressions. These expressions are not allowed to be used recursive and they must be used on top-level, i.e. not inside numerical expressions. Expressions must be built in a strict #if# ... #then# ... #else# ... #fi# manner.

  • #if# indicates start of the expression.
  • Between #if# and #then# a number is expected. Blanks will be ignored. If number is greater than 0.0 the expression is recognized as true otherwise as false.
  • In case of true expression, characters between #then# and #else# token will be used to replace the whole conditional expression in the template.
  • In case of false expression, characters between #else# and #fi# token will be used to replace the whole conditional expression in the template.

As conditional expressions will be evaluated at the very end, any template replacement operations or numerical computations will be done before.


Beispiele

Anbei ein paar Beispiele, die helfen, den Ersetzungsmechanismus besser zu verstehen.

  1. Template Outdoor temperature is [th0temp-act=F.1:--]°F will be converted into Outdoor temperature is 3.4°F when there is outdoor temp data and into Outdoor temperature is --°F if outdoor temp sensor does not provide recent data.
  2. Template Local time is [hh]:[mm] will be converted into Local time is 09:27.
  3. Template Max gust in last 10 minutes was: [wind0wind-max10.1:--]m/s, [wind0wind-max10=mph.1:--]mph, [wind0wind-max10=kn.0:--]kn will be converted into Max gust in last 10 minutes was: 10.5m/s, 23.5mph, 20kn.
  4. Template Max gust in last 10 minutes was: [wind0wind-max10.1:0]m/s, {*[wind0wind-max10.1:0] * 3.6 *1}kph will be converted into Max gust in last 10 minutes was: 10.5m/s, 37.8kph.
  5. Template Max gust in last 10 minutes was: #if#{*[wind0wind-age:999]>600*}#then#--#else#[wind0wind-max10.1:0]m/s, {*[wind0wind-max10.1:0] * 3.6 *1}kph#fi# will be converted into Max gust in last 10 minutes was: 10.5m/s, 37.8kph when last wind data is less than 10 minutes old (600 seconds) and will be Max gust in last 10 minutes was: -- otherwise.
  6. Template [th0temp-dmintime=apm.ij]:[th0temp-dmintime=apm.kl][th0temp-dmintime=apm.op] reports the time stamp of lowest outdoor temperature of today in 12 hour AM/PM notation: 12:34AM