mkeymolen / DavisVantage.WeatherReader

Davis Vantage WeatherReader is a crossplatform .netcore library that reads weather data from a Davis Vantage weatherstation. It follows the official Davis Vantage Pro serial communication protocol
MIT License
4 stars 2 forks source link

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

What do you need?

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

Current supported dataloggers:

How to use

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

.netcore autofac sample