Who’s Home Camera

A camera by the door that knows who just walked in, says hello by name, and tells Home Assistant who’s home. It sends no pictures anywhere, only a name and a time. Built from a Raspberry Pi 5, the Raspberry Pi AI Camera and an old mini PC.

The idea

Most smart cameras stream video to a cloud service and let someone else’s computer work out what is in it. The Raspberry Pi AI Camera is different. Its Sony IMX500 sensor has a small neural-network chip built in, so it can spot a person on the sensor itself, before any image reaches the Pi. That made it a good fit for a presence sensor that keeps everything at home: the camera finds a person, the Pi works out whose face it is, and the only thing that leaves the Pi is a name.

How it works

  1. The camera finds a person. The IMX500 runs an SSD MobileNetV2 person detector on the sensor, about six times a second. While nobody is in view, the Pi has almost nothing to do.
  2. The Pi checks the face. When someone is in frame, the Pi crops that area and runs InsightFace on it in memory. The small buffalo_s model turns the face into a fingerprint, and the Pi compares it with the people it knows. A match above 0.40 counts, and it needs two matches in a row before it believes it.
  3. It says hello. The first time it sees someone after half an hour away, the Pi greets them through a small USB speaker. The voice comes from Piper, a text-to-speech engine that runs on the Pi with no internet. Each person can have their own list of greetings, and it works through them in turn, so it isn’t the same “Hello Dusan” every day.
  4. Home Assistant finds out. The Pi sends the name to an MQTT broker (Mosquitto) on the mini PC. Home Assistant picks it up as two sensors, “who’s home” and “last person seen”, which can turn on lights or send a notification.

How I set it up

  1. The hub. A Dell OptiPlex 7060 Micro running CachyOS already sits on the shelf, so it became the Home Assistant box. Home Assistant and Mosquitto run there in Docker. Mosquitto requires a username and password, and the firewall only opens its ports to the home network, never to the internet.
  2. The camera. On the Pi, the imx500-all package adds the sensor firmware and the ready-made detection models. I also had to update picamera2, because the version that came with the OS couldn’t read the camera’s detections.
  3. Face recognition. InsightFace and ONNX Runtime go in a Python virtual environment. On a Pi with Python 3.13, InsightFace has no ready-made package, so it compiles from source, which takes a while.
  4. Enrolling people. One command, enroll Dusan, pauses the camera service, takes 15 samples while you look at the camera and turn your head a little, and starts the service again. It takes under a minute. My own samples matched at 0.67 to 0.83 afterwards. enroll Ana --images folder does the same from a folder of photos instead, without pausing the camera.
  5. Running it. Everything runs as a systemd service that starts with the Pi. All the settings, from how strict the matching is to how long you count as home, live in one commented config file.

What tripped me up

  • A version mismatch. The camera firmware sent a slightly bigger block of detection data than the picamera2 on the Pi expected, so at first it read nothing. Updating picamera2 to match fixed it.
  • Boxes that barely showed. The camera delivers about 30 frames a second, but the AI chip attaches results to only about 6 of them. The live view kept picking frames without results. Now it keeps the latest detection for up to a second.
  • Docker and the firewall. Docker’s usual port publishing slips past the firewall. Running the containers on the host network keeps the firewall in charge.
  • Sound from a background service. The Pi 5 has no headphone jack, and a system service can’t reach the desktop’s audio by default. A USB audio adapter, plus pointing the service at the user’s audio session, sorted it out.

Keeping it private

Face fingerprints are stored only on the Pi, and only for people who agreed to be enrolled. Anyone else is just “unknown”, with nothing saved about them. Frames are processed in memory and thrown away. For aiming the camera there is a live view with boxes drawn around detected people, but it needs a password and only opens from the home network. It can be switched off in the config file.

What I’d do next

More samples in different light, because a side angle at night once scored 0.37, just under the cutoff. Next on the list are automations in Home Assistant, like lights on when I get home after dark, and maybe a small ESP32 light by the door that shows green for someone it knows.

  • Raspberry Pi 5, 8 GB
  • Raspberry Pi AI Camera (Sony IMX500)
  • USB audio adapter and a small speaker
  • Dell OptiPlex 7060 Micro as the Home Assistant hub
  • Raspberry Pi OS (Debian 13), picamera2
  • IMX500 person detector (SSD MobileNetV2)
  • InsightFace buffalo_s on ONNX Runtime
  • Piper text-to-speech
  • Mosquitto MQTT and Home Assistant in Docker

Only enroll people who agree to it. In many places, GDPR among them, face recognition of visitors or passers-by needs their consent, so the camera treats everyone else as unknown and stores nothing about them.

Built October 2026, set up with Claude Code.