Add-On Services/de

From meteoplug
Revision as of 21:51, 25 February 2013 by Admin (Talk | contribs) (Created page with "<br />Der in Meteobridge enthaltene Web-Server kann neben der Realisierung des Administrationsinterfaces auch Anfragen zu den aktuell vorliegenden Wetterdaten beantworten. Es ...")

Jump to: navigation, search


Der in Meteobridge enthaltene Web-Server kann neben der Realisierung des Administrationsinterfaces auch Anfragen zu den aktuell vorliegenden Wetterdaten beantworten. Es sind zwei URLs definiert, unter denen man diese Daten abrufen kann, entweder als Textdatei oder als XML-Datenstrom. Auch wenn es aus Sicherheitsgründen nicht empfehlenswert ist diesen Zugang für einen Zugriff von außerhalb des LANs zu öffnen, könnte man beim Aufschalten der Firewall des LANs diese von außen zugänglich machen. Für die Anlieferung von Daten ins Internet empfehlen sich die die unter Sendedienste aufgeführten Methoden.

Live-Daten als XML

Mit dem Meteobridge HTTP-Request wie "http://ip-of-meteobridge/cgi-bin/livedataxml.cgi" (wobei "ip-of-meteobridge" durch die korrekte IP der Meteobridge ersetzt werden muss) liefert Meteobridge Wetterdaten in XML-Notation aus. Die von Meteobridge gelieferte Antwort beginnt mit "<logger>" und endet mit "</logger>". Die Wrte der Sensoren werden mit den sensorspezifischen Tags "THB", "TH", "WIND", "RAIN", "UV", "SOLAR" berichtet. Das anhängende Beispiel illustriert das XML-Format:

<logger>
  <THB date="20121227224318" id="thb0" temp="26.0" hum="37" dew="10.2" 
       press="1008.8" seapress="1010.1" fc="2"/>
  <TH date="20130104141909" id="th0" temp="9.1" hum="95" dew="8.3"/>
  <RAIN date="20130104141856" id="rain0" rate="0.0" total="3.0" delta="0.0"/>
  <WIND date="20130104141916" id="wind0" dir="109" gust="0.9" wind="2.2" chill="9.1"/>
</logger>

Each sensor data record has a mandatory "date" and "id" parameter. The other parameters are sensor specific. Meaning of parameters is:

  • date: UTC timestamp of reception of sensor data in format "YYYYMMDDhhmmss"
  • id: Unique ID of sensor, consists of a sensor type description shortcut followed by a number, which is always "0" in Meteobridge, as additional sensors are not supported
  • temp: temperature in degrees Celsius (with one decimal)
  • hum: relative humidity in percent (no decimals)
  • dew: dew point temperature in degrees Celsius (with one decimal)
  • press: station pressure (without altitude correction) in hPa (with one decimal)
  • seapress: normalized pressure with altitude correction (also called sea level pressure) in hPa (with one decimal)
  • fc: stations forecast code, if provided. As this has low evidence and also largely varies between stations, meteobridge does not recommend to make use of this data.
  • rate: measured rain rate in mm per hour (with one decimal).
  • total: current value of rain bucket counter, converted to mm (with one decimal).
  • delta: additional rain fall in mm since previous readout of this data (with one decimal).
  • wind: current average wind speed im m/s (with one decimal).
  • gust: curent not avergaed wind speed in m/s (with one decimal).
  • dir: wind direction in degrees (0-359, no decimals).
  • chill: wind chill temperature in degrees Celsius (with one decimal).
  • more to come...

Live Data as Plain Text

By sending the meteobridge a HTTP request like "http://ip-of-meteobridge/cgi-bin/livedata.cgi" (where "ip-of-meteobridge" must be replaced by the IP itself) meteobridge returns current weather data as plain text. Each reply consists of a series of lines, where each line represnets a sensor. Lines do start with a time stamp and a unique sensor id followed by sensor specific parameters. Example below illustrates the format:

20130104142614 thb0 26.9 38 11.4 1020.4 1021.7 2
20130104142610 rain0 0.0 3.0 0.0
20130104142636 th0 9.1 95 8.3
20130104142652 wind0 160 2.2 1.8 8.0