Integrate a PTZ Security Camera with ONVIF and Full Pan/Tilt/Zoom Control in Home Assistant
Let’s be honest. Most security cameras are glorified doorstops that stream a sad, fixed rectangle of your driveway. You see a blur move at the edge of the frame and that’s it. Game over. What if you could actually *control* the thing? Pan left to follow the package thief. Tilt down to check if the gate is latched. Zoom in to read a license plate from across the yard. That’s the magic of a PTZ camera with ONVIF inside Home Assistant. It’s not just watching. It’s investigating.
ONVIF Isn't Just Tech Jargon – It's Your Universal Plug
Here’s the thing. Camera manufacturers love their walled gardens. Their own apps, their own protocols. It’s a nightmare. ONVIF is the great peace treaty. It’s a standard language that most modern IP cameras speak. If your camera supports ONVIF Profile S (for streaming) and hopefully Profile G (for PTZ), you’re golden. This isn’t some hacky workaround. It’s the official, clean handshake between your camera and Home Assistant. No more begging for a custom integration.
The 5-Minute Handshake: Adding Your Camera to Home Assistant
This is the easy part. I swear. Go to Settings > Devices & Services in Home Assistant. Hit ‘Add Integration’. Search for ONVIF. You’ll need your camera’s IP address, username, and password. The integration is smart. It will probe the camera, discover its ONVIF capabilities, and pull in everything it finds. The video stream? Check. Motion detection events? Probably. The real prize: those PTZ controls. If they’re there, Home Assistant will find them. Click through the prompts. It’s less work than ordering a pizza.
Unleashing the PTZ Beast: Your New Control Panel
Once integrated, the fun begins. The camera entity gets new services. Services are just fancy words for “things you can tell it to do.” You’ll see `camera.ptz` with parameters for pan, tilt, and zoom. This is your raw power. But you don’t want to type coordinates. So you build a control panel. Create a new dashboard card with picture-elements. Overlay some directional arrows on the live feed. Link each arrow to a `camera.ptz` service call with a tiny pan/tilt value. Boom. You now have a joystick. Zoom buttons work the same way. It feels like cheating.
From Manual Control to Robotic Sentry: Automation 101
Manually driving your camera is cool for about a day. Then you get lazy. This is where it gets smart. Remember those PTZ presets? Most cameras let you save positions—like “Front Door Close-Up” or “Driveway Wide.” Now, create an automation. “When motion is detected at the side gate, move the living room PTZ camera to Preset 3.” Your camera becomes a robotic sentry, automatically slewing to check out the action. Combine it with person detection? You’ve got a system that actively tracks an intruder across your property, recording every step. That’s not just security. That’s a statement.
One Last Pro Tip: Presets Are Your Best Friend
Setting up PTZ patrols or complicated scans is overkill for a home. Use presets. Seriously. Spend 20 minutes on a Saturday. Drive the camera to every critical choke point—the mailbox, the back fence, the barbecue you don’t want the neighbors borrowing. Save each as a preset. Now, your automations or dashboard buttons can call them instantly. It turns a powerful tool into a practical one. The goal isn’t to show off the tech. It’s to get the shot you need, when you need it.