Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 2.74 KB

README.md

File metadata and controls

46 lines (33 loc) · 2.74 KB

DavisVantage.WeatherReader Build status NuGet license

Davis Vantage WeatherReader is a crossplatform .netstandard 1.6 and .NETFramework 4.5.1 library that reads weather data from a Davis Vantage weatherstation. It follows the official Vantage Pro, Pro2, and Vue Communications Reference which can be downloaded at http://www.davisnet.com/support/vantage-pro-pro2-and-vue-communications-reference/

Features

  • Connecting and reading live weatherdata from a Davis Vantage pro(2 plus) console
  • Dynamic logging mechanism by using liblog

What do you need?

  1. Davis Vantage Weatherstation with console
  2. Davis Vantage Datalogger

Current supported dataloggers:

How to use

  • Import the latest DavisVantage.WeatherReader package from nuget.
  • Register the the implementations with your preferred IOC container.

Example with autofac:

builder.Register(c => weatherlinkIpSettings).As<IDataLoggerSettings>();	
builder.RegisterType<WeatherLinkIpByteReader>().As<IByteReader>();	
builder.RegisterType<WeatherLinkIpDataLogger>().As<IDataLogger<WeatherLinkIpSettings>>();	

Connect to the console:

using (var dataLogger = scope.Resolve<IDataLogger<WeatherLinkIpSettings>>())
{
	if (dataLogger.Connect())
	{
		var currentWeather = dataLogger.ReadCurrentWeather(true);
		var weatherExtremes = dataLogger.ReadWeatherExtremes(true);
	}
}

Samples

The included samples are working with a Weatherlink IP Data logger and a Davis Vantage Pro2 Plus weatherstation.

.netcore sample

  • Using NLog for logging.

.netcore autofac sample

  • Using NLog for logging and autofac as IOC container.
  • Settings are read from appsettings.json