2026-02-01 14:49:27 +05:30
2026-02-01 15:46:25 +05:30
2026-02-01 14:14:57 +05:30
2026-02-01 14:14:57 +05:30

Desk Presence Detection (Snapshot-Based, Home Assistant)

This project provides a low-CPU desk presence detection system using a webcam and snapshot-based computer vision. It is designed to work reliably on weak hardware without running continuous video inference.

Presence is detected using:

  • Face detection (Haar cascade)
  • Frame-to-frame motion detection
  • A confidence score with decay
  • A cooldown to prevent feedback loops caused by lights turning on or off
  • The detected presence is published to Home Assistant as a binary_sensor.

Installation

1. Clone

2. Build the image

docker build -t desk-presence .

3. Home Assistant Setup

A. Create Long Lived Access Token

B. Run the container

docker run -d \
  --name desk-presence \
  --restart unless-stopped \
  --device /dev/video0:/dev/video0 \
  -e HA_URL="http://192.168.0.202:8123" \
  -e HA_ENTITY_ID="binary_sensor.desk_presence_vision" \
  -e HA_TOKEN="YOUR_LONG_LIVED_TOKEN" \
  -e CAMERA="/dev/video0"
  desk-presence

Description
desk presence detection system
Readme 202 KiB
Languages
Python 95.6%
Dockerfile 4.4%