Meteostick Binding

This is the binding for the Meteostick weather receiver dongle. This is an RF receiver that can receive data directly from Davis weather devices (and others).

Supported Things

This binding support 2 different things types

ThingTypeDescription
meteostick_bridgeBridgeThis is the Meteostick USB stick
meteostick_davis_issThingThis is the Davis Vue ISS

Binding Configuration

The Meteostick things need to be manually added - there is no discovery in the Meteostick binding.

First add and configure the Meteostick bridge - the port and frequency band for your region need to be set. Next add the sensor and configure the channel number.

Thing Configuration

meteostick_bridge Configuration Options

OptionDescription
portSets the serial port to be used for the stick
modeSets the mode (frequency band)

Set mode to one of the following depending on your device and region:

ModeDeviceRegionFrequency
0DavisNorth America915 Mhz
1DavisEurope868 Mhz
2DavisAustralia915 Mhz
3Fine OffsetNorth America915 Mhz
4Fine OffsetEurope868 Mhz
5DavisNew Zealand931.5 Mhz

meteostick_davis_iss Configuration Options

OptionDescription
channelSets the RF channel used for this sensor
spoonSize of rain spoon assembly for this sensor in mm. Default value is 0.254 (0.01") for use with Davis part number 7345.280. Set to 0.2 for use with Davis part number 7345.319

Channels

Meteostick

Channel Type IDItem TypeDescription
pressureNumber:PressureAir pressure
indoor-temperatureNumber:TemperatureIndoor temperature

Davis ISS

Channel Type IDItem TypeDescription
outdoor-temperatureNumber:TemperatureOutside temperature
humidityNumberHumidity
wind-directionNumber:AngleWind direction
wind-direction-last2min-averageNumber:AngleWind direction average over last 2 minutes
wind-speedNumber:SpeedWind speed
wind-speed-last2min-averageNumber:SpeedWind speed average over last 2 minutes
wind-speed-last2min-maximumNumber:SpeedWind speed maximum over last 2 minutes
rain-rawNumberRaw rain counter from the tipping spoon sensor
rain-currenthourNumber:LengthThe rainfall in the last 60 minutes
rain-lasthourNumber:LengthThe rainfall in the previous hour
solar-powerNumberSolar power from the sensor station
signal-strengthNumberReceived signal strength
low-batterySwitchLow battery warning

Rainfall

There are three channels associated with rainfall. The raw counter from the tipping bucket is provided, the rainfall in the last 60 minutes is updated on each received rainfall and provides the past 60 minutes of rainfall. The rainfall in the previous hour is the rainfall for each hour of the day and is updated on the hour.

Full Example

This example uploads weather data to for your personal weather station at Weather Underground every two minutes.

Steps:

  1. Install the MeteoStick binding for use with your Davis Vantage Vue Integrated Sensor Suite (ISS).
  2. Register your personal weather station with Weather Underground and make note of the station ID and password issued.
  3. Add the following files to your openHAB configuration:

things/meteostick.things

Things can be defined in the .things file as follows:

meteostick:meteostick_bridge:receiver [ port="/dev/tty.usbserial-AI02XA60", mode=1 ]
meteostick:meteostick_davis_iss:iss (meteostick:meteostick_bridge:receiver) [ channel=1, spoon=0.2 ]

Note the configuration options for port, mode, channel and spoon above and adjust as needed for your specific hardware.

items/meteostick.items

Number:Pressure MeteoStickPressure "Meteostick Pressure [%.1f hPa]"{ channel="meteostick:meteostick_bridge:receiver:pressure" }
Number:Temperature DavisVantageVueOutdoorTemperature "ISS Outdoor Temp [%.1f °C]" { channel="meteostick:meteostick_davis_iss:iss:outdoor-temperature" }
Number DavisVantageVueHumidity "ISS Humidity [%.0f %%]" { channel="meteostick:meteostick_davis_iss:iss:humidity" }
Number:Angle DavisVantageVueWindDirection "ISS Wind Direction [%.0f °]" { channel="meteostick:meteostick_davis_iss:iss:wind-direction" }
Number:Angle DavisVantageVueWindDirectionAverage "ISS Average Wind Direction [%.0f °]" { channel="meteostick:meteostick_davis_iss:iss:wind-direction-last2min-average" }
Number:Speed DavisVantageVueWindSpeed "ISS Wind Speed [%.1f m/s]" { channel="meteostick:meteostick_davis_iss:iss:wind-speed" }
Number:Speed DavisVantageVueWindSpeedAverage "ISS Average Wind Speed [%.1f m/s]" { channel="meteostick:meteostick_davis_iss:iss:wind-speed-last2min-average" }
Number:Speed DavisVantageVueWindSpeedMaximum "ISS Maximum Wind Speed [%.1f m/s]" { channel="meteostick:meteostick_davis_iss:iss:wind-speed-last2min-maximum" }
Number:Length DavisVantageVueRainCurrentHour "ISS Rain Current Hour [%.1f mm]" { channel="meteostick:meteostick_davis_iss:iss:rain-currenthour" }

rules/meteostick.rules

Replace YOUR_ID and your_password below with the values from the the Weather Underground registration process.

import java.net.URLEncoder
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Map
import java.util.TimeZone

/* Uploads weather station data using this format:

   http://wiki.wunderground.com/index.php/PWS_-_Upload_Protocol
 */

rule PWS
when
	Item DavisVantageVueWindDirectionAverage received update
then
	val id = 'YOUR_ID'
	val pw = 'your_password'
	val sdf = new SimpleDateFormat('yyyy-MM-dd HH:mm:ss')
	sdf.setTimeZone(TimeZone.getTimeZone('UTC'))
	val Map<String, Object> params = newLinkedHashMap(
		'action' ->           'updateraw',
		'ID' ->               id,
		'PASSWORD' ->         pw,
		'dateutc' ->          sdf.format(new Date()),
		'winddir' ->          DavisVantageVueWindDirection.getStateAs(QuantityType).toUnit('°').intValue,
		'windspeedmph' ->     DavisVantageVueWindSpeed.getStateAs(QuantityType).toUnit('mph').doubleValue,
		'windgustmph' ->      DavisVantageVueWindSpeedMaximum.getStateAs(QuantityType).toUnit('mph').doubleValue,
		'windgustdir' ->      DavisVantageVueWindDirectionAverage.getStateAs(QuantityType).toUnit('°').intValue,
		'windspdmph_avg2m' -> DavisVantageVueWindSpeedAverage.getStateAs(QuantityType).toUnit('mph').doubleValue,
		'winddir_avg2m' ->    DavisVantageVueWindDirectionAverage.getStateAs(QuantityType).toUnit('°').intValue,
		'humidity' ->         DavisVantageVueHumidity.state,
		'tempf' ->            DavisVantageVueOutdoorTemperature.getStateAs(QuantityType).toUnit('°F').doubleValue,
		'rainin' ->           DavisVantageVueRainCurrentHour.getStateAs(QuantityType).toUnit('in').doubleValue,
		'baromin' ->          MeteoStickPressure.getStateAs(QuantityType).toUnit('inHg').doubleValue,
		'softwaretype' ->     'openHAB 2.3')

	var url = 'https://weatherstation.wunderground.com/weatherstation/updateweatherstation.php?'
	var first = true
	for (key : params.keySet()) {
		if (!first) {
			url += '&'
		}
		url += key + '=' + URLEncoder::encode(params.get(key).toString, 'UTF-8')
		first = false
	}

	logDebug('PWS', 'url is {}', url)
	sendHttpGetRequest(url)
end

openHAB will now report your weather station data to Weather Underground every two minutes.