Ever since the incredibly awful fires/smoke that we encountered in Portland in September of 2020, I've been thinking a lot about the environment on a very local level. I fully admit that I was caught off-guard by my first climate related emergency, and I learned quite a bit about air quality terms like AQI. I also discovered some of the various monitoring networks with publicly available data, and sort of developed an itch to participate in some of them. One aspect in particular that surprised me was how awful the air quality inside my home became. I also realized that while the air quality networks could tell me what the outside AQI was, nobody could tell me what it was inside. So, I eventually purchased an Awair Element to put in my office to help me keep an eye on it. Of course, being a tinkerer, I couldn't help notice that Awair provides an open API for connecting to and monitoring their devices. And so, what would eventually become AirAware was born!
So, after a couple weeks, I had what I felt was a pretty decent reusable framework for iOS to connect to and fetch data from Awair devices. But by then I had an itch. I felt like I had just scratched the surface of what could be done. So after a bit more Googling, I found a number of other devices and networks that allow connecting to their APIs, and I decided to pull them into AirAware as well. In the end, I decided to add support for an initial 5 devices/networks:
- Awair indoor monitoring devices
- AirNow, the EPA's public outdoor AQI monitoring network
- PurpleAir's outdoor monitoring network
- WeatherFlow's family of Tempest weather monitoring devices
- OpenWeather's weather monitoring network
There are potentially other devices and networks that I would love to add support for in the future, but for an initial release, I felt like this was sufficient.
Now, I will stop here and say that I love making frameworks and libraries for other developers. I feel good when I make something and can put it out into the universe to potentially help other people. That being said, will anyone find this useful? Will it help anyone? I have no idea, but that's ok! The point is that AirAware now exists and is available if anyone ever wants to add air monitoring functionality to their app, or if they just want to see a reference implementation for any of the supported devices/networks.
Technical Notes:
- AirAware is available directly via Github (https://github.com/cheesemaker/airaware) as well as through the Swift Package Index (https://swiftpackageindex.com/cheesemaker/airaware) and fully supports Xcode's Swift Package Manager.
- AirAware supports Swift 4.0 and greater
- AirAware requires iOS 13 or macOS 10.15
- AirAware is released under the MIT license