Coder Social home page Coder Social logo

arx237 / weewx-airlink Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chaunceygardiner/weewx-airlink

0.0 0.0 0.0 856 KB

WeeWX extension to support Davis AirLink air quality sensor.

License: GNU General Public License v3.0

Python 100.00%

weewx-airlink's Introduction

weewx-airlink

*Open source plugin for WeeWX software.

Description

A WeeWX plugin that gets its AirLink sensor readings either directly from the AirLink sensor or from a airlink-proxy service.

Copyright (C)2020 by John A Kline ([email protected])

This plugin requires Python 3.7, WeeWX 4 and the wview_extended schema

weewx-airlink requires the wview_extended in WeeWX 4 that contains pm1_0, pm2_5 and pm10_0 columns. With the weewx-airlink extension, Loop records will be populated with pm1_0, pm2_5 and pm10_0 fields that correspond to AirLink's pm_1_last, pm_2p5_last and pm_10_last fields.

In addition to pm1_0, pm2_5 and pm10_0, AQI variables are also available (even though they are not in the database) via WeeWX 4's XTypes. pm2_5_aqi is automatically computed from pm2_5 and can be used in reports ($current.pm2_5_aqi, $day.pm2_5_aqi) and in graphs ([[[[pm2_5_aqi]]]). Also available is is the RGBint value $current.pm2_5_aqi_color (useful for displaying AQI in the appropriate color (e.g., green for AQIs <= 50).

PM2.5 concentrations are corrected with the US EPA correction for PurpleAir sensors. This is a presumptious decision. The AirLink sensor tracks remarkably well to a like positioned PurpleAir sensor's PM 2.5 atm readings (sample size == 1), but, the EPA correction is based on PM 2.5 cf_1 readings. The AirLink really needs its own EPA correction, but that is not likely to happen any time soon. In practice, at higher concentrations of PM 2.5 particles, the AirLink reports lower levels than the PurpleAir.

The following is an real world example of how well the PM2.5 concentrations track between PuprleAir's PM 2.5 cf_1 readings and AirLink's PM 2.5 readings. The sensors are located beside each other. AirLink PurpleAir Comparison

As of v1.1, the EPA correction is the 2021 version. See: https://www.epa.gov/sites/default/files/2021-05/documents/toolsresourceswebinar_purpleairsmoke_210519b.pdf

The pm1_0, pm2_5, pm10_0, 'pm2_5_aqi' and 'pm2_5_aqi_color' fields are available for reporting and graphs, the following additional fields are inserted into loop records (useful for real time updating): pm1_0_1m: PM1 1 minute average pm2_5_1m: PM2.5 1 minute average pm10_0_1m: PM10 1 minute average pm2_5_1m_aqi: PM2.5 1m AQI pm2_5_1m_aqi_color: PM2.5 1m AQI color pm2_5_nowcast: : PM2.5 NowCast pm2_5_nowcast_aqi: PM2.5 NowCast AQI pm2_5_nowcast_aqi_color: PM2.5 NowCast AQI color pm10_0_nowcast: PM10 NowCast

A skin is provided to show a sample report: AirLinkReport

Installation Instructions

If you don't meet the following requirements, do not install this extension.

  • WeeWX 4
  • Using WeeWX 4's new wview_extended schema.
  • Python 3.7 or greater
  1. Download the lastest release, weewx-airlink-1.1.zip, from the GitHub Repository.

  2. Run the following command.

    sudo /home/weewx/bin/wee_extension --install weewx-airlink-1.1.zip

    Note: this command assumes weewx is installed in /home/weewx. If it's installed elsewhere, adjust the path of wee_extension accordingly.

  3. Edit the AirLink section of weewx.conf (which was created by the install above). In particular, change the hostname in the section labeled Sensor1 to be a name resolvable to the IP address of an AirLink sensor or the IP address of an AirLink sensor. More sensors can be specified. For example, to add a second AirLink sensor, enable the Sensor2 section and specify the hostname. There is no limit to how many sensors can be configured; but the numbering must be consecutive. The order in which sensors are interrogated is low numbers to high. Once a sensor replies, no further sensors are interrogated for the current polling round.

    Note: The port can be specified because this extension also works with the airlink-proxy service. That service typcially uses port 8000.

    [AirLink]
        [[Sensor1]]
            enable = true
            hostname = airlink
            port = 80
            timeout = 2
        [[Sensor2]]
            enable = false
            hostname = airlink2
            port = 80
            timeout = 2
    
  4. Restart WeeWX

  5. To check for a successful install, wait for a reporting cycle, then navigate in a browser to the WeeWX site and add /airlink to the end of the URL (e.g., http://weewx-machine/weewx/airlink). The PM2.5 and AQI graphs will fill in over time.

How to access weewx-airlink fields in reports.

Note: Although the examples below show the use of $current, aggregates are also supported (e.g., the high PM2.5 for the week can be presented with $week.pm2_5.max.

To show the PM2.5 reading, use the following:

$current.pm2_5

To show the Air Quality Index:

$current.pm2_5_aqi

To get the RGBINT color of the current Air Quality Index:

#set $color = int($current.pm2_5_aqi_color.raw)
#set $blue  =  $color & 255
#set $green = ($color >> 8) & 255
#set $red   = ($color >> 16) & 255

To show the PM1.0 reading, use the following:

$current.pm1_0

To show the PM10.0 reading, use the following:

$current.pm10_0

Licensing

weewx-airlink is licensed under the GNU Public License v3.

weewx-airlink's People

Contributors

arendpws avatar chaunceygardiner avatar instantlinux avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.