Hey everyone, I’ve been diving into the world of smart cameras lately, and I thought I’d share my experiences and some tips I’ve picked up along the way. I recently set up a Uniview IP camera, which has a handy feature called ‘Alarm Server.’ This feature allows the camera to send POST requests to a specified URL whenever it detects motion or other events. It’s essentially a webhook feature, which is super useful for automating actions in Home Assistant.
However, I ran into a bit of a snag. The camera only allows me to specify the IP address and port, without the option to add a custom path. This was a bit of a hurdle because I wanted to route these POST requests through a specific endpoint in Home Assistant. After some research, I discovered that running a simple Python Flask server on my Raspberry Pi could act as an intermediary. This server listens on a specific port and forwards the incoming POST requests to Home Assistant.
I was thrilled when it worked! The Flask server received the POST requests from the camera, and I could process them within Home Assistant. I even set up some automations to notify me via push notifications when motion is detected, and to trigger lights in specific areas of my home.
But I wanted to take it a step further. I decided to create a custom add-on within Home Assistant to host the Flask server. This way, I wouldn’t need an external PC running the server, and everything would be contained within my Home Assistant setup. I followed the tutorial on creating a simple HTTP server as an add-on, but I ran into a few issues. The logs kept saying the script couldn’t be found, which was frustrating. After some tweaking and ensuring the script was correctly placed within the add-on’s container, it finally worked!
This journey taught me a lot about webhooks, custom integrations, and the importance of persistence when troubleshooting. I’m now able to fully leverage my Uniview camera’s features within Home Assistant, and it’s been a fantastic learning experience. If anyone has questions or needs help setting something similar up, feel free to reach out!
Happy automating! ![]()