Very basic HomeKit bridge for Awair Element Indoor Air Monitor.
Uses an ESP32 based microcontroller to listen to the sensor data sent from a Awair Element and relays them out as HomeKit HAP Notifications. No internet connection required and everything stays local.
-
Open the Arduino sketch
HomeSpanAwairSensor.ino
in the Arduino IDE -
Install both the HomeSpan and Arduino_JSON libraries
Sketch > Include Libraries > Manage Libraries
-
Follow the directions here to install the various ESP32 boards or install whatever is relevant to your specific board and select the board you are using from
Tools > Board > ESP32 Arduino > Your Board
-
Upload the sketch to the board with Sketch > Upload or click the little arrow pointing right in the top left corner of the window
- Turn on the sensor Local API Feature
- Change the following parameters in sketch with yours:
const char* ssid = "My Wi-Fi SSID"; // Wi-Fi SSID
const char* password = "My Wi-Fi Password"; // Wi-Fi Password
const char* pairingCode = "12341234"; // Pairing Code. Not Allowed: 00000000, 11111111, 22222222, 33333333, 44444444, 55555555, 66666666, 77777777, 88888888, 99999999, 12345678, 87654321
String serialNumber = "70886B......"; // Sensor Serial Number
You can find the serial number in on the back of your device:
Add the device like you would any other accessory by typing your pairing code from parameters above. By default pairing code is 1234-1234
If you're connected to HomeKit, you should be able to see the sensors.
Uses the wonderful HomeSpan library for HomeKit functionality and Arduino_JSON for parsing the sensor data.