Turn anything your screen, camera or mic can pick up into an event.
No API, no integration, no model training. Write one sentence; ifseen acts the moment it's true.
$ifseen "a pan is cooking on a lit hob and nobody is in the kitchen"--camera 0 --ntfy my-phone
No Homebrew? curl -fsSL https://krishj.com/ifseen/install.sh | sh verifies the checksum, installs to ~/.local/bin (no sudo) and clears Gatekeeper's quarantine flag. Apple silicon and Intel; one binary, no Python.
PowerShell. Installs to %LOCALAPPDATA%\Programs\ifseen and adds it to your PATH; open a new terminal after. Or with Scoop: scoop bucket add krishjoshi https://github.com/KrishJoshi/scoop-bucket; scoop install ifseen. Or download the .exe: it's unsigned, so SmartScreen may need More info → Run anyway.
Upgrade re-run the command (or scoop update ifseen) · Uninstall delete that folder (or scoop uninstall ifseen)
curl -fsSL https://krishj.com/ifseen/install.sh | sh
x86_64 and arm64 (glibc). Verifies the checksum, installs to ~/.local/bin, no sudo. Pin with IFSEEN_VERSION=0.1.0, move with IFSEEN_INSTALL_DIR. The mic needs sudo apt install libportaudio2. Homebrew works too.
Upgrade re-run the command · Uninstallrm ~/.local/bin/ifseen
Put your key and camera snapshot URL in .env (RTSP: edit rules/doorbell.yaml), then docker compose up -d && docker compose logs -f. Every rules/*.yaml is a watcher. No screen or mic inside a container. Docker guide →
Upgradedocker compose pull && docker compose up -d · Uninstalldocker compose down
Then install the ifseen add-on: a prebuilt image for amd64 and aarch64, so it takes seconds. Or add https://github.com/KrishJoshi/ifseen under Settings → Add-ons → Add-on store → ⋮ → Repositories. Setup steps below →
Upgrade the update shows up in Settings like any add-on · Uninstall from the add-on's page
pipx install "ifseen[all]"
Any OS, Python 3.10+. Or uv tool install "ifseen[all]". Add [local] for the free, offline SigLIP provider (pulls in torch, so the standalone binaries leave it out). Lean extras: [screen][camera][mic][mqtt].
Edit ifseen.yaml: point source at your camera, screen or snapshot URL and reword the rules.
ifseen watch ifseen.yaml
Live dashboard; actions run when a rule fires.
01. How it works
Real frames. Real numbers.
Clips run through ifseen watch, plus everyday home and office pairs: one frame where the rule is true, a near-identical one where it isn't. Every probability is a real ifseen output, one call per frame. Nothing tuned or retouched.
AI-generated scenesreal ifseen outputsScenes: Gemini 2.5 Flash Image + Veo 3.1 Lite · prompts, rules & raw numbers
ifseen watch · every: 500ms · realtime: false · then: [log]Bars ease between decisions for smoothness; every number and FIRED moment is from the real run
Clips
00 · ifseen watch on each 6s clip · every 500ms · fire times from the real run (Gemini; Jev where shown)
Kitchen · hob.mp4
hob-unattended “A pan is cooking on a lit hob, with flame or steam, and nobody is in the kitchen.” threshold 80%
0.0sperson-in-kitchen fires · 93.8%
3.0shob-unattended 73% (cook in the doorway)
4.0s🔔 hob-unattended fires · 89.4%
4.5sJev fires too · 95%
Loading bay · hivis.mp4
no-hivis “A person in the loading bay is wearing ordinary clothes with no high-visibility vest.” threshold 80%
0.0sbay-empty fires · 89.1% (worker still outside)
0.5s🔔 no-hivis fires · 91.6% · Jev 96%
5.5sstill 93% / Jev 97% as he reaches the pallet
Pet cam · dog.mp4
dog-on-sofa “A dog is lying or sitting on the sofa.” threshold 80%
0.0sdog-on-floor fires · 93.0%
3.5sdog-on-sofa 28%
4.0sdog-on-sofa 61%
4.5s🔔 dog-on-sofa fires · 92.8%
Doorbell · parcel.mp4
parcel-left “A parcel or package has been left on the doorstep and nobody is with it.” threshold 85%
1.5sperson-at-door fires · 83.6%
4.0sparcel-left 77% (courier still there)
4.5s🔔 parcel-left fires · 94.5%
Hot desk · desk.mp4
laptop-unlocked-unattended “A laptop at an empty desk is unlocked and showing apps or documents, with nobody sitting there.” threshold 80%
0.0sperson-at-desk fires · 90.0%
2.0sperson-at-desk 47.5%
3.0s🔔 laptop-unlocked-unattended fires · 82.0%
Home
01 · rule true (left) vs false (right) · click for the full annotated frame
visitor-waiting “A visitor is waiting at the reception desk.” threshold 80%
Opposite rule reception-empty: 4.4% → 95.0%
↳ Under the hood
One frame. One call. Every rule.
Decision models don't write text. They read an image or audio clip and return a calibrated probability for each yes/no question, with zero output tokens. ifseen is the glue around them.
01 / CAPTURE
Grab a frame
Screen, webcam, RTSP, snapshot URL, file, and/or the last few seconds of mic audio.
02 / SKIP
Unchanged? Skip
Static frames and silence never hit the API. A quiet scene costs almost nothing.
03 / ONE CALL
Ask all rules
3 rules or 300, it's one request per frame. The image is billed once.
04 / DEBOUNCE
Stay calm
Thresholds, for: N consecutive hits, cooldowns and hysteresis. One alert per event.
05 / ACTION
Do the thing
Notify, speak, run a shell command, hit a webhook, push a photo to your phone, save the frame, exit.
LIVE SIMULATION · doorbell.yaml · gemini-decision-1 · resolution: low
frame #0000capturing
below thresholdhit (counting)firedthreshold
EVENT LOG
Spent so far$0.000000
Simulation. Per-call cost uses the measured ≈520 input tokens per low-res Gemini Decision 1 frame at $0.10 / 1M tokens.
02. Use cases
No API? No training? Doesn't matter.
If a person can see it or hear it, ifseen can turn it into an event. Old appliances, existing CCTV, legacy software with no integration story. Every number below is a real ifseen test output from both decision models.
Screen-scraping or RPA bots that break on every UI change
OPC / vendor connectors, if they exist
Or someone watching the screen all night
alarm-active “The control screen shows an active alarm, such as a red alarm banner or a tripped pump.”
Red alarm banner
Gemini 97.0% · Jev 99%
Normal operation
Gemini 1.4% · Jev 3%
Opposite rules for contrast (true image → false image): person-cooking 94.3% / 95% → 6.6% / 32% · cycle-running 93.5% / 96% · hivis-worn 92.3% / 97% · normal-operation 95.5% / 98%. Two were weak: hob-off scored only 52.5% / 8% on the hob-off frame (food is still in the pan) and shelf-full 56.1% / 25% on the stocked shelf; neither fired. HMI screens are drawn with PIL, not generated.
++ Why it's nice
No training. No bounding boxes. Just English.
Plain-English rules
Ask what you'd ask a person.
"The washing machine shows End." "Someone in the loading bay has no hi-vis vest." Use false_means to say what "no" looks like.
ifseen.yaml
source: {camera: 0}
every: 30srules:
- name: cycle-finishedwhen: The washing machine's display shows the cycle has finished.false_means: The display shows time remaining.for: 2then:
- ntfy: laundry-topic
- say: the washing is done
Debounced & calm
One alert per event. Not one every two seconds.
A rule must clear its threshold for: N frames in a row, then waits out its cooldown and re-arms only when the probability drops.
ifseen watch doorbell --plainlive
14:02:06skip frame unchanged
14:02:08parcel-left 61%below 85%
14:02:10parcel-left 93%hit 1/3
14:02:12parcel-left 95%hit 2/3
14:02:14🔔 FIRED parcel-left 97%
14:02:14→ ntfy · snapshot saved
14:02:16cooldown 30m
Cheap by default
Pay for change, not for time.
Unchanged frames and silent audio are skipped automatically, so a static scene costs almost nothing. The dashboard shows real spend as you go.
1,350 tok / frame520 tok · resolution: low$0.000135 / frame~$0.24/h busy scene~$0.09/h low-res
cost metergemini-decision-1
$0.0026spent
■ called (frame changed)■ fired□ skipped50 calls × ≈520 tokens
Does real things
Push the photo to your phone.
ntfy sends the triggering frame along with the alert. Or chain anything else: shell commands get $IFSEEN_* env vars, never string-templated.
ntfy · ifseen-doorbellnow
📦 Parcel delivered
parcel-left · 97% · priority high
notifysayshellwebhookntfysnapshotexit
03. Integrate
Choose your setup.
The CLI is one way in. The same rules file also becomes Home Assistant entities, an always-on container, Python callbacks, a typed JS client or a local HTTP + SSE API.
Needs Home Assistant OS or Supervised. Elsewhere, any MQTT broker + an mqtt: section works.
source:
url:
url: http://supervisor/core/api/camera_proxy/camera.front_doorheaders: {Authorization: "Bearer ${SUPERVISOR_TOKEN}"}
every: 3srules:
- name: person-at-doorwhen: A person is standing at the front door.for: 2ha_device_class: occupancy
automation
triggers:
- trigger: stateentity_id: binary_sensor.front_door_person_at_doorto: "on"actions:
- action: notify.mobile_app_my_phonedata: {message: "Someone's at the door"}
Needs Docker with Compose, on amd64 or arm64 (a Raspberry Pi 4/5 is fine), and a camera with an RTSP or snapshot URL.
mkdir ifseen && cd ifseen && curl -fsSLO https://raw.githubusercontent.com/KrishJoshi/ifseen/main/docker/compose.yaml
Set DOORBELL_SNAPSHOT_URL in .env (or edit the file for RTSP). Every rules/*.yaml becomes a watcher.
docker compose up -d && docker compose logs -f
You get One always-on container running ifseen serve over all your rules files. Upgrade with docker compose pull && docker compose up -d. No screen or mic inside a container.
from ifseen import Watcher, check
probs = check("dock.jpg", ["A person has no hi-vis vest."])
w = Watcher(source={"camera": 0}, provider="gemini", every="2s")
@w.when("A person in the loading bay has no hi-vis vest.",
threshold=0.8, for_=2, name="no-hivis")
async def alert(event):
print(event.name, event.probability)
w.run()
Needs Node 18+, Bun or Deno. Zero dependencies. Live watchers also need the CLI installed.
npm install ifseen
One-shot: check() calls a decision API directly. Server-side only: a key in a browser is public.
ifseen serve doorbell
Then IfseenClient drives watchers, snapshots and the live event stream.
You get Typed results and a fetch-based SSE stream, with an optional bearer token.
Deploy Microsoft-Decision-1.1 in Azure Foundry: endpoint, key and deployment name.
no keyLocal & dry run
--provider local (SigLIP) and --dry-run need nothing. OpenAI-compatible and Ollama are optional.
How to pass a provider API key on each surface
Surface
How the key gets in
CLI / YAML
Auto-detected env vars: GEMINI_API_KEY (or GOOGLE_API_KEY), TYPESAFE_API_KEY, AZURE_DECISION_ENDPOINT + AZURE_DECISION_KEY (+ AZURE_DECISION_DEPLOYMENT), OPENAI_API_KEY. Use another variable with provider: {api_key_env: MY_VAR}. ${VAR} expansion is for other secrets (ntfy topics, tokens). ifseen doctor shows which keys are set.
Python
Env vars by default, or explicitly: check(img, [...], provider="gemini", api_key=...), check_detailed(..., api_key=...), Watcher(..., provider="jev", api_key=...), Watcher.from_yaml(path, api_key=...). Needs an explicit provider; kept in memory only, never in state().
JS / TS
check(img, rules, { provider: "gemini", apiKey }), or the same env vars in Node, Bun and Deno. Don't call providers from a browser: the key is visible to anyone. Use ifseen serve or your backend.
ifseen serve
Keys live only in the server's environment. HTTP clients never send provider keys, and custom endpoints are blocked by default so a client can't redirect your key elsewhere.
HA add-on
Password fields in the add-on options: gemini_api_key, typesafe_api_key, openai_api_key, azure_decision_key (+ endpoint and deployment).
Docker
Put it in the compose .env file, or docker run --rm -e GEMINI_API_KEY ghcr.io/krishjoshi/ifseen watch kitchen passes it through from your shell.
04. Recipes
Eleven ready-made rule files.
Run one directly, or ifseen init <name> to write an editable ifseen.yaml. Secrets come from env vars like ${NTFY_TOPIC}, so rule files are safe to share.
Example rules, as written
Rule text from the bundled recipes · ■ = consecutive hits required (for)
05. Providers
Bring any decision model.
With no provider set, ifseen picks the first one it finds a key for. --dry-run uses the mock provider, so you can try everything with no key at all.
Supported providers, their environment variables and whether they can see and hear
Any self-hosted Jev-compatible /v1/systemone server.
openai
OPENAI_API_KEY (+ OPENAI_BASE_URL)
✓
Any OpenAI-compatible vision chat model. Not calibrated, slower.
ollama
model
✓
Fully local, e.g. --provider ollama --model gemma3. offline
mock
none
✓
✓
What --dry-run uses: random probabilities, actions printed not run.
local
pip install "ifseen[local]"
✓
Free & offline: SigLIP on your machine, ~20ms, $0. Great for “is X there?” and as a prefilter. free
PrivacyFrames and audio go to the provider you choose and nowhere else. Use Ollama or a self-hosted server and nothing leaves your machine.
Not yet benchmarkedMicrosoft-Decision is supported but hasn't been live-tested here yet, so there are no numbers for it on this page.
Proxies & custom keysbase_url and api_key_env work for proxies, gateways and self-hosted servers.
06. Benchmarks
Measured, not estimated.
Real numbers from real runs. Small samples, so treat them as directional.
Bird benchmark · 8 images × 3 repeats
Is there a bird? If so, which one? Includes a hard negative (a nest of blue eggs). The decision model asks yes/no + short-list choice in one call; the LLM gets "What bird is this?".
Species correct8/8
Both Gemini Decision 1 (one call) and gpt-5.4-mini.
Median time / image0.69s
Decision API vs 1.14s for gpt-5.4-mini.
Cost / 1,000 images$0.19
Decision API vs $0.44 for gpt-5.4-mini.
Median latency / image · lower is better
Gemini Decision 1 (one call)0.69s
gpt-5.4-mini (free text)1.14s
Cost / 1,000 images · lower is better
Gemini Decision 1 (one call)$0.19
gpt-5.4-mini (free text)$0.44
Tokens & cost per frame · Gemini Decision 1
1280×800 frame, default1,350
resolution: low520
Worst case: scene changes every 2s
default resolution$0.24/h
resolution: low$0.09/h
Unchanged frames and silence are skipped, so a mostly static scene costs a fraction of this.
Hard rules · 90 captures · accuracy at threshold 0.5
Screen text (CI pages, error dialogs), spatial ("dog on the sofa"), scene state (door open, pot boiling) and audio. Hand-labelled; 2–6 positives per rule, so directional.
Screen text
Gemini Decision 1100%
TypeSafe Jev100%
gpt-5.4-mini98%
SigLIP · local, free75%
Spatial
Gemini Decision 1100%
TypeSafe Jev100%
gpt-5.4-mini96%
SigLIP · local, free100%
Scene state
Gemini Decision 1100%
TypeSafe Jev100%
gpt-5.4-mini91%
SigLIP · local, free78%
Audio
Gemini Decision 1100%
TypeSafe Jevn/a
gpt-5.4-minin/a
SigLIP · local, freen/a
Median latency: Jev ~0.18s · Gemini Decision ~0.6–0.8s · gpt-5.4-mini 1.2–2.3s · SigLIP ~20ms. Cost per 1,000 images: Jev $0.10–0.13 · Gemini Decision $0.13 · gpt-5.4-mini $0.80–1.01 · SigLIP $0. Jev is image-only, so audio needs Gemini. Takeaway: local is great for “is X there?”; reading text, judging scene states and listening need a decision model — or use local as a free prefilter in front of one.
Live tests
94–96%
"A pan is cooking on a lit hob … and nobody is in the kitchen", on the unattended-hob frame (Gemini 94.4%, Jev 96%; 3.2% / 2% with someone cooking)camera · kitchen · threshold 80%
94%
"Someone said my name", from a microphone clip (Gemini; Jev can't hear)mic · meeting-radar · threshold 75%