Linux daemon that detects camera usage and notifies Home Assistant via webhooks.
Project description
onair-monitor
A tiny Linux daemon that detects camera usage and notifies Home Assistant via webhooks. Optionally shows a system-tray icon that turns red when a camera is active.
Install
uv tool install onair-monitor
Tray icon support
To enable the system-tray icon, install the tray extra and the required
system libraries:
1. System libraries (needed to build PyGObject):
Debian / Ubuntu:
sudo apt install libgirepository-2.0-dev libcairo2-dev
Fedora:
sudo dnf install gobject-introspection-devel cairo-devel
Arch Linux:
sudo pacman -S gobject-introspection cairo
2. Install with the tray extra:
uv tool install onair-monitor --with tray
GNOME users: the tray icon requires the AppIndicator extension.
Configure
On first run, a default config is created at
~/.config/onair-monitor/config.json. Edit it to point at your
Home Assistant instance:
{
"ha_url": "http://homeassistant.local:8123",
"webhook_on": "camera_on",
"webhook_off": "camera_off",
"poll_interval": 2
}
The monitor POSTs to {ha_url}/api/webhook/{webhook_on|off}.
Setting up webhooks in Home Assistant
- Go to Settings > Automations & Scenes > Create Automation.
- Add a Webhook trigger and note the webhook ID.
- Create one automation for
camera_onand one forcamera_off. - Use the webhook IDs in your config file.
Run
# run directly (tray icon if available, otherwise headless)
onair-monitor
# force headless mode
onair-monitor --headless
Autostart (desktop session)
onair-monitor --install-autostart
Systemd user service
onair-monitor --install-service
systemctl --user start onair-monitor.service
Uninstall
onair-monitor --uninstall
uv tool uninstall onair-monitor
The config file at ~/.config/onair-monitor/config.json is kept — remove
it manually if you no longer need it.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file onair_monitor-0.1.1.tar.gz.
File metadata
- Download URL: onair_monitor-0.1.1.tar.gz
- Upload date:
- Size: 54.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bd1440cc576b29c47fd046d6d757b30ffa7f62359e7cab0dcf47a294bb22066
|
|
| MD5 |
ae8f995e6b2adb7795ebc90aeecb6abd
|
|
| BLAKE2b-256 |
ff16cc780c363d99671eb223f0f577a7c57ffbf2e87b1865c535dde5b16dee33
|
Provenance
The following attestation bundles were made for onair_monitor-0.1.1.tar.gz:
Publisher:
publish.yaml on mariushelf/onair_monitor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
onair_monitor-0.1.1.tar.gz -
Subject digest:
8bd1440cc576b29c47fd046d6d757b30ffa7f62359e7cab0dcf47a294bb22066 - Sigstore transparency entry: 975129683
- Sigstore integration time:
-
Permalink:
mariushelf/onair_monitor@4345ab36655ed321c68ee2ca6d11df94e54608d4 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/mariushelf
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@4345ab36655ed321c68ee2ca6d11df94e54608d4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file onair_monitor-0.1.1-py3-none-any.whl.
File metadata
- Download URL: onair_monitor-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc4c164beb685fb1cdfb128076d64b0074854431123acb337a11f417300c84c7
|
|
| MD5 |
a51921f4f31ee2f10e77700792653ed0
|
|
| BLAKE2b-256 |
a431a99c7397872102c27a7117da2cbe07448312e365fcbc946d015fa64fdadb
|
Provenance
The following attestation bundles were made for onair_monitor-0.1.1-py3-none-any.whl:
Publisher:
publish.yaml on mariushelf/onair_monitor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
onair_monitor-0.1.1-py3-none-any.whl -
Subject digest:
cc4c164beb685fb1cdfb128076d64b0074854431123acb337a11f417300c84c7 - Sigstore transparency entry: 975129685
- Sigstore integration time:
-
Permalink:
mariushelf/onair_monitor@4345ab36655ed321c68ee2ca6d11df94e54608d4 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/mariushelf
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@4345ab36655ed321c68ee2ca6d11df94e54608d4 -
Trigger Event:
release
-
Statement type: