5.11.0 • Published 4 months ago

homebridge-awair2 v5.11.0

Weekly downloads
275
License
ISC
Repository
github
Last release
4 months ago

homebridge-awair2

verified-by-homebridge npm-version npm-downloads

This is a second generation Homebridge Dynamic Platform plugin for the Awair family of air quality monitors implemented in TypeScript for Nfarina's Homebridge project. The Awair2 plugin is based on the homebridge-awair plugin developed by Dean L. Young.


NOTES:

v5.11.x Incorporates updated Awair Score methodology for Awair Element (Firmware v1.4.0) and Awair Omni (Firmware v1.8.0) introduced by Awair in Dec 2023. See Reference.

The IAQ Score System integrates readings from five sensors: Temperature, Humidity, Volatile Organic Compounds (VOC), Carbon Dioxide (CO2), and Particulate Matter (PM2.5). In the previous system, each factor contributed equally (approximately 20%) to the total score. The new air quality scoring system begins with normalizing sensor data to a scale where 0 represents good quality and 1 indicates the worst, assigning values that correspond to a range of scores. The final Indoor Air Quality (IAQ) score is a composite of the highest normalized values from CO2, VOC, and PM2.5 readings.

The new Awair Score level is displayed in Homebridge on the Accessory tile for Awair Element and Awair Omni in addition to the Homekit level. Awair r2 only displays the Homekit level. Unfortunately, HomeKit levels are defined by the HomeKit API and cannot be customized.

Scorenew Awair levelHomeKit level
1GOODEXCELLENT
2ACCEPTABLEGOOD
3MODERATEFAIR
4POORINFERIOR
5HAZADAROUSPOOR

iOS Awair app version 4.7.3 is required to view the updated scores.

v5.10.x removes support for Awair v1 (including Awair Baby), Awair Glow, and Awair Glow-C. These devices have been "sunsetted" by Awair as of 30 November 2022. These devices are no longer supported by the Awair iOS app or the Awair Cloud which the plugin relies on. Additional details can be found here.

v5.9.x introduced binary limit switches for VOC and PM2.5. The switches are implemented as dummy occupancy sensors and can be used to trigger HomeKit automations.

v5.7.x introduced control of the Awair device display for Awair Omni, Awair r2, and Awair Element. Reference Wiki for details and examples of HomeKit automations for this feature.


The Awair2 plugin will query your Awair account using a Developer Token to determine registered Awair devices which were setup through the Awair iOS app. While running, the plugin will fetch current sensor conditions for each Awair device (e.g. Awair Mint, Awair Omni, Awair 2nd Edition, or Awair Element) and provide sensor status and value (e.g. temperature, humidity, carbon dioxide, TVOC, PM2.5, Omni lux, and Omni battery) to HomeKit. You can look at the current Awair information via HomeKit enabled Apps on your iOS device or even ask Siri for them.

The plugin will fetch new data based on selected endpoint and User Account tier. For 'Hobbyist' tier, 15-min-avg endpoint samples every 15 minutes, 5-min-avg every 5 minutes, latest every 5 minutes and raw every 3.3 minutes (200 seconds). The main difference between the latest and raw endpoints is that you can define a limit (i.e. number of consecutive data points) for the raw endpoint, in order to create your own averaging (e.g. .../raw?limit=12 for a 2 minute average.

With iOS16, the layout, icons and status were refined in the iOS/iPadOS/macOS Home apps. Temperature and humidity are grouped under a single "climate" status icon at the top of the HomeKit screen. If you select this icon a screen opens with all of the Climate devices in your HomeKit.

iOS16 Climate

For those with multiple Awair devices, you can optionally list the macAddress of the device (found on the back or bottom of the device) which you want to exclude from HomeKit.

For Awair Omni, battery charge level, charging status, low battery, light level and occupancy detection based on ambient sound level experimental are also provided using the Local Sensors capability which is configured in the Awair App.

iOS16 Local API

Battery Status does not appear as a separate tile in the HomeKit interface. Battery charge level and status will be found in the Status menu for each of the sensors. A low battery indication will be identified as an alert in the HomeKit status section.


NOTE:


Acknowledgment to @Sunoo for the homebridge-philips-air plugin which was used as a reference for implementation of the Awair Dynamic Platform TypeScript plugin.

Installation

  1. Install homebridge, reference Homebridge Wiki
  2. The easiest way to install the Awair2 plugin is through the homebridge interface. Select Plugins at the top menu bar, search for Awair2 and then select install. Alternately, the plugin may be installed from the command line using: [sudo] npm install -g homebridge-awair2.
  3. Update your configuration file. See the sample below.

The Awair2 plugin queries your Awair account to determine devices that you have registered. This is the same informaton that you have entered via the Awair app on your iOS device.

You will need to request access to the Awair Developer Console to obtain your Developer Token (token). You can also request your Developer Token directly through the Awair App on your iPhone. From the App, select 'Awair+' in the lower right hand corner, then select 'Awair APIs', select 'Cloud API' and finally 'Get API Token'.

iOS16 Developer Token

The Awair Developer API Documentation explains the inner workings of the Awair Developer API, but for the most part is not necessary to use this plugin.

Changelog

Changelog is available here.

Plugin Configuration

Configuration sample: config-sample.json

Descriptions

Reference Wiki Chapter 3 for additional details.

(*) Introduced with v5.9.0.

ParameterOptional?Description
platformThe Homebridge Accessory (REQUIRED, must be exactly: Awair2)
tokenDeveloper Token (REQUIRED, see Installation) above.
userTypeYThe type of user account (Default = users/self, options: users/self or orgs/###, where ### is the Awair Organization orgId)
airQualityMethodYAir quality calculation method used to define the Air Quality Chracteristic (Default = awair-score, options: awair-aqi, awair-pm, awair-score or nowcast-aqi)
endpointYThe /air-data/ endpoint to use (Default = 15-min-avg, options: 15-min-avg, 5-min-avg, raw or latest)
limitYNumber of consecutive data points returned per request, used for custom averaging of sensor values (Default = 1 i.e. one 15-min-avg). Defaults to 1 for latest.
carbonDioxideThresholdYThe level at which HomeKit will trigger an alert for the CO2 in ppm. (Default = 1000)
carbonDioxideThresholdOffYThe level at which HomeKit will turn off the trigger alert for the CO2 in ppm, to ensure that it doesn't trigger on/off too frequently. Choose a number less than carbonDioxideThreshold. (Default = 800)
enableTvocPm25YWhether to enable Total VOC and PM2.5 threshold binary sensors.
tvocThreshold(*)YTotal VOC level at which HomeKit will trigger an alert in µg/m³. (Default = 1000)
tvocThresholdOff(*)YTotal VOC level at which HomeKit will turn off the trigger alert in µg/m³ to ensure that it doesn't trigger on/off too frequently. Choose a number less than tvocThreshold. (Default = 800)
pm25Threshold(*)YThe level at which HomeKit will trigger an alert for PM2.5 in µg/m³. (Default = 35)
pm25ThresholdOff(*)YThe level at which HomeKit will turn off the trigger alert for pm2.5 in µg/m³ to ensure that it doesn't trigger on/off too frequently. Choose a number less than pm25Threshold. (Default = 20)
vocMwYThe Molecular Weight (g/mol) of a reference gas or mixture that you use to convert from ppb to µg/m³. (Default = 72.66578273019740)
occupancyDetectionYOmni Only - Enables Omni occupancy detection based on minimum environmental sound level detected. (Default = false)
occupancyOffsetYOmni Only - Used when occupancy detection enabled. Offset value in dBA above background sound level to set not occupied level, occupied is 0.5dBA higher. (Default = 2)
occupancyRestartYOmni only - Reinitialize Occupancy detection measurement to determine unoccupied sound level on Homebridge reboot. (Default = false, use historical data)
enableModesYApplies to Omni, Awair-r2 & Element - Enables creation of Display Mode and LED Mode accessories. (Default = false)
loggingYWhether to output logs to the Homebridge logs. (Default = false)
verboseYWhether to log results from API data calls. Requires logging to be true. (Default = false)
developmentYEnables Development mode to allow use of test Awair devices lacking end user/Awair OUI formatted Serial numbers. (Default = false)
ignoredDevicesYArray of Awair device macAddresses (12 characters in length) to be excluded from HomeKit (OPTIONAL). End user devices with begin with Awair OUI '70886B', test devices are concatnation of right 12 characters of '00000000000' + deviceId.

Reference Wiki for detailed description of Configurion Options.

Resources

Reference Wiki for complete list of Resources.

5.11.0

4 months ago

5.10.9

6 months ago

5.10.8

6 months ago

5.10.7

9 months ago

5.10.6

10 months ago

5.10.5

1 year ago

5.10.4

1 year ago

5.10.3

1 year ago

5.10.2

1 year ago

5.10.1

1 year ago

5.10.0

1 year ago

5.9.10

2 years ago

5.9.9

2 years ago

5.9.8

2 years ago

5.9.7

2 years ago

5.9.6

2 years ago

5.8.13

2 years ago

5.8.14

2 years ago

5.9.5

2 years ago

5.9.4

2 years ago

5.9.3

2 years ago

5.9.2

2 years ago

5.9.1

2 years ago

5.9.0

2 years ago

5.8.12

2 years ago

5.8.11

3 years ago

5.8.10

3 years ago

5.8.9

3 years ago

5.8.8

3 years ago

5.8.7

3 years ago

5.8.6

3 years ago

5.8.5

3 years ago

5.8.4

3 years ago

5.8.3

3 years ago

5.8.2

3 years ago

5.8.1

3 years ago

5.8.0

3 years ago

5.7.3

3 years ago

5.7.2

3 years ago

5.7.1

3 years ago

5.7.1-beta.2

3 years ago

5.7.1-beta.1

3 years ago

5.7.1-beta.0

3 years ago

5.6.4

3 years ago

5.6.3

3 years ago

5.6.2

3 years ago

5.6.0

3 years ago

5.6.1

3 years ago

5.5.10

3 years ago

5.5.9

3 years ago

5.5.8

3 years ago

5.5.7

3 years ago

5.5.6

3 years ago

5.5.5

3 years ago

5.5.4

3 years ago

5.5.3

3 years ago

5.5.2

3 years ago

5.5.1

3 years ago

5.5.0

3 years ago

5.5.0-beta.1

3 years ago

5.5.0-beta.0

3 years ago

5.4.3

4 years ago

5.4.2

4 years ago

5.4.1

4 years ago

5.4.0

4 years ago

5.3.0

4 years ago

5.2.7

4 years ago

5.2.6

4 years ago

5.2.5

4 years ago

5.2.4

4 years ago

5.2.3

4 years ago

5.2.2

4 years ago

5.2.1

4 years ago

5.2.0

4 years ago

5.2.0-beta.1

4 years ago

5.1.2

4 years ago

5.1.1

4 years ago

5.1.0

4 years ago

5.0.0

4 years ago