PiCam Bot
Wake your Pi camera when you need it. Photos, clips, and motion alerts in Telegram. One switch in Apple Home.
Off Until You Need It
A small Go service for Raspberry Pi 4 that controls the Motion camera daemon. Wake the camera, take a snapshot, record a timed clip, or enable motion alerts from Telegram.
In sleep mode, Motion is stopped and the camera device is released. When detection is enabled, completed photos and clips go to your Telegram chat. Audio hooks can capture a USB webcam microphone and pair the audio with motion clips.
Telegram access is restricted to configured sender IDs. The destination chat is saved across restarts, so you do not need to message the bot again before receiving alerts.
A Few Messages Away
Telegram Commands
| Command | What it does |
|---|---|
/run | Wake the camera, ready for commands. |
/snapshot | Capture a still image and send it to Telegram. |
/record <N> | Record 1–300 seconds of video while monitoring. |
/detect | Enable motion detection and alerts. |
/stopdetect | Pause detection while leaving the camera awake. |
/stop | Stop the camera and cancel an active recording. |
/status | Show the current state and uptime. |
/help | List the available commands. |
One Switch in Apple Home
The optional Camera monitoring switch pairs directly with Apple Home using native HomeKit. No Homebridge is required.
On starts the camera and enables detection, just like /run followed by /detect. Off stops the camera, including any timed recording.
The switch shows On only while detection is active and stays synchronized with Telegram commands. After /stopdetect, it shows Off even though the camera is awake; sending Off still stops it. Enabling detection during a timed recording returns an error.
This is a control switch. Photos and clips are delivered to Telegram; it does not expose a camera feed or HomeKit Secure Video in Apple Home.
Enable HomeKit with HOMEKIT_ENABLED=true and your own eight-digit HOMEKIT_PIN. Pair on the local network and preserve the pairing directory across deployments. Read the pairing instructions →
Run It on Your Pi
Use a Raspberry Pi 4 with a supported camera, Motion, and a Telegram bot token. The repository includes sample Motion configuration, systemd units, audio hook scripts, and deployment targets.
Configure TELEGRAM_TOKEN and ALLOWED_USER_IDS, set up Motion and its service permissions, then deploy. FFmpeg is used for audio muxing. Motion access can use Tailscale; optional HomeKit discovery uses the local network.