public class Wunderground
extends java.lang.Object
The following is the URL query syntax for posting data to the wunderground server:
http://weatherstation.wunderground.com/weatherstation/updateweatherstation.phpUsing the following parameters:
action [action=updateraw] ID [ID as registered by wunderground.com] PASSWORD [PASSWORD registered with this ID] dateutc - [YYYY-MM-DD HH:MM:SS (mysql format)] winddir - [0-360] windspeedmph - [mph] windgustmph - [windgustmph] humidity - [%] tempf - [temperature F] rainin - [rain in] dailyrainin - [daily rain in accumulated] baromin - [barom in] dewptf- [dewpoint F] weather - [text] -- metar style (+RA) (not used by WxService) clouds - [text] -- SKC, FEW, SCT, BKN, OVC (not used by WxService) softwaretype - [text] ie: vws or weatherdisplayHere is a typical post for standard updates:
http://weatherstation.wunderground.com/weatherstation/updateweatherstation.php?ID=KWAFERND7&PASSWORD=password&softwaretype=ow4j060304&action=updateraw&dateutc=2005-05-29+00:20:00&tempf=85.7&winddir=228&windspeedmph=1.9&windgustmph=6.9&humidity=30&dewptf=59.1Here is a typical post for rapid fire updates:
http://rtupdate.wunderground.com/weatherstation/updateweatherstation.php?ID=KWAFERND7&PASSWORD=password&softwaretype=ow4j060304&action=updateraw&realtime=1&rtfreq=2.5&dateutc=2005-05-29+00:20:00&tempf=85.7&winddir=228&windspeedmph=1.9&windgustmph=6.9&humidity=30&dewptf=59.1Refer to this internal default resource file for property keys and default values used to configure this formatter. Station ID and password are typically the only values you will need to change.
Modifier and Type | Class and Description |
---|---|
private class |
Wunderground.DataExchangeListener
Data exchange listener captures and processes sensor data.
|
private class |
Wunderground.FormatTask
Timer task to format weather data to Weather Underground Data Exchange.
|
Modifier and Type | Field and Description |
---|---|
private static java.text.DecimalFormat |
AIR_PRESSURE
Barometer decimal format.
|
private ISensorData |
anemometer
Individually referenced sensor.
|
private ISensorData |
barometer
Individually referenced sensor.
|
private IDataExchange |
dataExchange
Data exchange for receiving data.
|
private static java.text.DateFormat |
DATE
URL-encoded formatter for date-time string.
|
private ISensorData |
dewpoint
Individually referenced sensor.
|
private static java.text.DecimalFormat |
HUMIDITY
Humidity decimal format.
|
private ISensorData |
hygrometer
Individually referenced sensor.
|
private long |
interval
Posting interval.
|
private IDataExchangeListener |
listener
Listener for receiving data added events.
|
private static java.util.logging.Logger |
LOGGER
Wunderground formatter logger.
|
private java.lang.String |
name
Task name.
|
private java.lang.String |
password
Wunderground password.
|
private ISensorData |
precipitationRate
Individually referenced sensor.
|
private ISensorData |
precipitationTotal
Individually referenced sensor.
|
private static java.text.DecimalFormat |
RAINFALL
Rainfall decimal format.
|
private boolean |
rapidFire
Rapid fire setting.
|
private java.util.Map<java.lang.String,ISensorData> |
sensorData
Map of data sources.
|
private java.lang.String |
stationId
Wunderground weather station ID.
|
private static java.text.DecimalFormat |
TEMPERATURE
Temperature decimal format.
|
private ISensorData |
thermometer
Individually referenced sensor.
|
private static long |
TIME_WINDOW
Time window in milliseconds for devices to report data to be sent.
|
private java.lang.String |
url
URL to Wunderground servers.
|
private static java.text.DecimalFormat |
WIND_DIRECTION
Wind direction decimal format.
|
private static java.text.DecimalFormat |
WIND_SPEED
Wind speed decimal format.
|
private ISensorData |
windVane
Individually referenced sensor.
|
Constructor and Description |
---|
Wunderground(java.lang.String name,
java.util.Properties config,
IDataExchange dataExchange,
IServiceControl serviceControl)
Creates a new instance of Wunderground
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
toString()
Returns a text representation of this object.
|
private static final java.text.DateFormat DATE
private static final java.text.DecimalFormat TEMPERATURE
private static final java.text.DecimalFormat HUMIDITY
private static final java.text.DecimalFormat AIR_PRESSURE
private static final java.text.DecimalFormat RAINFALL
private static final java.text.DecimalFormat WIND_DIRECTION
private static final java.text.DecimalFormat WIND_SPEED
private static final long TIME_WINDOW
private static final java.util.logging.Logger LOGGER
private final java.util.Map<java.lang.String,ISensorData> sensorData
private ISensorData thermometer
private ISensorData anemometer
private ISensorData windVane
private ISensorData hygrometer
private ISensorData dewpoint
private ISensorData barometer
private ISensorData precipitationRate
private ISensorData precipitationTotal
private java.lang.String name
private java.lang.String stationId
private java.lang.String password
private java.lang.String url
private IDataExchange dataExchange
private final IDataExchangeListener listener
private long interval
private boolean rapidFire
public Wunderground(java.lang.String name, java.util.Properties config, IDataExchange dataExchange, IServiceControl serviceControl)
name
- of this formatter task.config
- properties from the wxservice.properties file.dataExchange
- formatters implement an
IDataExchangeListener
as an inner class and add an
instance to IDataExchange
.serviceControl
- IServiceControl
to initialize the
service.