Awair Local for Omarchy
An Omarchy Quattro bar widget that discovers Awair devices on the local network, polls their Local API, and displays live air-quality readings.
The bar shows the highest CO2 reading from all discovered devices. It is grey below 800 ppm, orange from 800 through 1200 ppm, and red above 1200 ppm. Click the widget for all sensor readings; middle-click or use Rescan to force LAN discovery.
Requirements
- Omarchy with the Quattro shell plugin system
bash,curl,jq,ip, andavahi-browse- Awair 2nd Edition, Element, Omni, or another device with Local API support
- Local API enabled in the Awair Home app
No Awair account, cloud API, access token, package installation, or elevated privileges are used.
Install
omarchy plugin add https://github.com/michielryvers/omarchy-awair.git --enable
The widget defaults to the right side of the bar. If needed, place it there explicitly:
omarchy bar move michielryvers.awair-local --section right
Remove
omarchy plugin remove michielryvers.awair-local
Removal leaves local preferences and history in place so reinstalling does not lose them. To erase those too:
rm -rf ~/.local/state/omarchy/awair-local
Discovery
The helper first polls cached devices. When discovery is needed it combines
Avahi results, the kernel neighbour table, and each active interface's local
/24. Failed automatic scans are throttled for five minutes; Rescan always
runs immediately. Sensor data is fetched directly from /air-data/latest every
10 seconds and never leaves the LAN.
Samples are retained locally for 24 hours in
~/.local/state/omarchy/awair-local/history.json. The popup charts show a
downsampled six-hour window so long-running history does not make the shell
payload unnecessarily large.
The Local API documents temperature and dew point as Celsius and does not return unit metadata. The widget converts those values locally: Auto uses the system timezone's country and falls back to the same narrow locale rule as Omarchy Weather, while each detected device can be pinned to °C or °F from the gear menu. The same menu supports nicknames, visible-sensor selection, rescanning, and removing a device and its local history.
Privacy and security
The runtime helper only makes unauthenticated HTTP requests to candidate hosts
on the local network. It does not contact Awair's cloud service or send sensor
readings off the LAN. Discovery scans active local /24 networks and may briefly
connect to port 80 on other local devices. Preferences and up to 24 hours of
history are stored in user-owned files with mode 0600.
Omarchy plugins run unsandboxed as the current user. Review the repository before installing or updating it.
Development
omarchy plugin validate .
qmllint -I "$OMARCHY_PATH/shell" BarWidget.qml
./awair-local scan
License
MIT