homebridge-purpleair-sensor
Version:
Monitor air quality using PurpleAir.
59 lines (39 loc) • 2.32 kB
Markdown
[](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
This is a Homebridge accessory plugin for monitoring air quality in Apple HomeKit. It creates virtual HomeKit
air quality sensors based on real PurpleAir sensors. Once setup, you can also configure home automation
based on air quality changes. It supports both using PurpleAir API (for sensors you do not own),
and also connecting to your own sensors directly on your home network.
This project was inspired by [SANdood's homebridge-purpleair](https://github.com/SANdood/homebridge-purpleair),
but with a few changes:
1. Support [homebridge-config-ui-x](https://www.npmjs.com/package/homebridge-config-ui-x)
so the entire project can be configured in its UI.
2. Support private sensors.
3. Support VOC sensor reading.
4. Support different averages, from realtime data, all the way to 1 hour average.
5. Sensor data refresh interval is configurable (default 5 minutes).
6. Allow reporting AQI value instead of PM2.5 density in HomeKit. The author is more used to reading AQI value,
but HomeKit has only a field for PM2.5 density value. The plugin allows you to configure displaying AQI value
in the density field.
7. Work with multiple sensors.
8. Rewritten in TypeScript, with some unit tests.
9. Optionally reports humidity and temperature in addition to air quality.
10. Optionally supports local sensors on home network (no need for API read key).
# Installation
The easiest way to install is through [homebridge-config-ui-x](https://www.npmjs.com/package/homebridge-config-ui-x) UI.
Search for `homebridge-purpleair-sensor` and just click install. Once done, configure it using the UI, and restart homebridge.
If you want to install manually via the command line, run the following:
```
sudo npm install -g --unsafe-perm homebridge-purpleair-sensor
sudo service homebridge restart # replace this with the command you need to restart homebridge
```
# Configuration
You can configure this plugin using [homebridge-config-ui-x](https://www.npmjs.com/package/homebridge-config-ui-x) UI.
# Development Notes
A few useful commands:
```
sudo npm run watch
# publish new version
npm login
sudo npm publish
```