The On Air service receives reports from multiple devices about the state of their cameras/microphones. If any of those devices have a camera/microphone that is in the on state, then On Air will talk to Home Assistant and turn on the On Air light.
Separate scripts run on various machines to report the state of their respective cameras.
All API endpoints return JSON data and use the same high-level structure for their responses:
{ "ok": true, "value": ... }
{ "ok": false, "error": { "message": "...", ... } }Returns the current state of the system
{ "ok": true, "value": { "state": boolean, "updatedAt": number } }state:trueif any machine currently has a camera or a microphone in the on stateupdatedAt: UTC timestamp in ms since the epoch of the time POST/DELETE was last invoked
Update the state of a microphone or camera for a machine
{ "machine": string, "device": "camera|microphone", "state": boolean }Response format is the same as GET /onair
This deletes all device state, effectively setting all machines to having their devices off.
Response format is the same as GET /onair
A GitHub actions build script generates the mdouglass/onair image.
The onair service (this repository) runs on statler (Synology NAS). Deployments are handled manually through the Synology control panel.
DB_PATH: Path to the SQLite database file. If you don't care about persistent state you can set this to:memory:to use an in-memory database that will be lost (effectively performing aDELETE /onairon restart). Otherwise, this should be set to the path of a file in a Docker volume mountHA_URL: http(s) URL for your Home AssistantHA_TOKEN: Home Assistant tokenSWITCH_ENTITY: The switch to toggle when device state changes