public class WeatherBug
extends java.lang.Object
http://data.backyard2.weatherbug.com/data/livedata.aspxUsing the following parameters:
action [action=live] ID [ID as registered by wunderground.com] Key [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] tempflo - [min temperature F] tempfhi - [max 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://data.backyard2.weatherbug.com/data/livedata.aspx?action=live&ID=p19916&Key=NotSecure&Num=0&softwaretype=ow4j140217&dateutc=2014-02-18+00%3a55%3a54&tempf=43.8&tempfhi=47.9&tempflo=43.8&dewptf=37.1&baromin=29.74&winddir=207&windspeedmph=5.3&windgustmph=11.2&humidity=79&rainin=0.00&dailyrainin=0.00Refer 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 |
WeatherBug.DataExchangeListener
Data exchange listener captures and processes sensor data.
|
private class |
WeatherBug.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
WeatherBug formatter logger.
|
private java.lang.String |
name
Task name.
|
private java.lang.String |
password
WeatherBug password.
|
private ISensorData |
precipitationRate
Individually referenced sensor.
|
private ISensorData |
precipitationTotal
Individually referenced sensor.
|
private static java.text.DecimalFormat |
RAINFALL
Rainfall decimal format.
|
private java.util.Map<java.lang.String,ISensorData> |
sensorData
Map of data sources.
|
private java.lang.String |
stationId
WeatherBug weather station ID.
|
private int |
stationNum
WeatherBug station number.
|
private static java.text.DecimalFormat |
TEMPERATURE
Temperature decimal format.
|
private ISensorData |
thermometer
Individually referenced sensor.
|
private java.lang.String |
url
URL to WeatherBug 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 |
---|
WeatherBug(java.lang.String name,
java.util.Properties config,
IDataExchange dataExchange,
IServiceControl serviceControl)
Creates a new instance of WeatherBug
|
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 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 int stationNum
private java.lang.String url
private IDataExchange dataExchange
private final IDataExchangeListener listener
private long interval
public WeatherBug(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.