npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@timjwilkinson/homebridge-purpleair

v1.0.13

Published

Homebridge plugin for showing PurpleAir air quality, temperature and humidity data (fork of original plugin, with various improvements)

Downloads

11

Readme

Homebridge-purpleair

NPM Version

Homebridge plugin that is showing information about air quality from PurpleAir API.

Project is based on homebridge-weather, homebridge-arinow and the original homebridge-purpleair.

Installation

  1. Install Homebridge using: (sudo) npm install -g --unsafe-perm homebridge.
  2. Install this plugin:
    1. find the directory that homebridge was installed in (e.g. /usr/local/lib/node-modules)
    2. create homebridge-purpleair in that directory
    3. copy index.js and package.js into this directory
    4. make sure the file/directory ownership and RWX permissions are the same as other modules in that directory
  3. Update your homebridge configuration file like the example below.

This plugin supports Air Quality, PM2.5, Temperature and Humidity.

Configuration

Example config.json

"accessories": [
    {
          "accessory": "PurpleAir",
          "purpleID": "PURPLE_AIR_STATION_ID",
          "updateFreq": 90,
          "name": "PurpleAir Air Quality",
          "statsKey": "v",
          "adjust": "NONE",
          "includePM10": true
    }
]

Config file

Fields:

  • accessory must be "PurpleAir" (required).
  • purpleID PurpleAir Station ID (a number).
  • updateFreq minimum number of seconds between reads from PurpleAir API (a number - default is 90 seconds)
  • name Is the name of accessory (required).
  • statsKey Selects the key from the sensor to report. The sensor reports various time based averages which can be selected. These are: v (real time), v1 (10 minute average), v2 (30 minute average), v3 (1 hour average), v4 (6 hour average), v5 (24 hour average), v6 (1 week average).
  • adjust Adjust the raw PM2.5 value based on various algorithms. These are: NONE (raw values), EPA, LRAPA and AQANDU.
  • includePM10 Include PM10 measurements in the AQI calculation. The highest AQI calculated from PM2.5 and PM10 will be used to calculate the air quality. The AQI calculations from PM2.5 and PM10 are not the same. Value should be a literal true or false, not string quoted.

To find your specific "PURPLE_AIR_STATION_ID" (a string):

  1. Use the PurpleAir Map to locate a station (https://www.purpleair.com/map)
  2. Open this URL in a new Window or Tab: (https://www.purpleair.com/json)
  3. Search for the NAME of the station you found in step A (using JSONview in Google Chrome makes this a bit easier)
  4. The Station ID is the first element in the results[:] map - you will enter this ID (1-5 digits) into the preferences for the Air Quality Station
    1. If you have an outdoor sensor, there should be 2 entries in the big JSON file, one for each sensor. Please use only the FIRST entry - the code will find the second and average the values, as done for the PurpleAir map.