Go to tillkruss/homebridge-purpleair instead.
Homebridge plugin that is showing information about air quality from PurpleAir API.
Project is based on homebridge-weather and homebridge-arinow.
- Install Homebridge using:
(sudo) npm install -g --unsafe-perm homebridge. - Install this plugin:
- find the directory that
homebridgewas installed in (e.g./usr/local/lib/node-modules) - create
homebridge-purpleairin that directory - copy
index.jsandpackage.jsinto this directory - make sure the file/directory ownership and RWX permissions are the same as other modules in that directory
- find the directory that
- Update your
homebridgeconfiguration file like the example below.
This plugin is returning only: AQI (Air Quality Index) and PM2.5
Example config.json
"accessories": [
{
"accessory": "PurpleAir",
"purpleID": "PURPLE_AIR_STATION_ID",
"updateFreq": MIN_SECS_BETWEEN_API_READ,
"name": "PurpleAir Air Quality"
}
]Fields:
accessorymust be "PurpleAir" (required).purpleIDPurpleAir Station ID (a number).updateFreqminimum number of seconds between reads from PurpleAir API (a number - default is 90 seconds)nameIs the name of accessory (required).
To find your specific "PURPLE_AIR_STATION_ID" (a string):
- Use the PurpleAir Map to locate a station (https://www.purpleair.com/map)
- Open this URL in a new Window or Tab: (https://www.purpleair.com/json)
- Search for the NAME of the station you found in step A (using JSONview in Google Chrome makes this a bit easier)
- 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
- 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.