App and Driver to connect Hubitat to Awair air quality sensors
In order to use this connector you need to register for a Developer Console access token at https://developer.getawair.com/:
- Using your Awair credentials (used for the mobile application), request access to the Developer Console
- When approved (can take a couple days), log into the Developer Console and retrieve the access token. You will use this to setup access through Hubitat
To use:
- Create app by copying and pasting app code into Hubitat
- Create driver by copying and pasting driver code into Hubitat
- Add User App "Awair (Connect)"
- When requested, enter your access token
- Your Awair devices should then be retrieved and you can select which ones to install in Hubitat
- Before completing, you can indicate whether you want to retrieve Temperature information in Fahrenheit (default is Celsius)
- You can also indicate whether you want to store data with 0, 1 or 2 decimal places. I use this in order to display correctly in Dashboard tiles
Additional settings:
- in App code, row 26, you can set debug level: 1 is trace level (everything), 5 is error only
- in App code, row 240, you can set polling refresh frequency. I usually comment this out, as I refresh based on a rule in RM
That's it. Enjoy and feel free to let me know of any issues.