As a homeowner, I’ve always been passionate about leveraging technology to enhance my home’s security and automation. Recently, I embarked on a project to integrate Blue Iris with Home Assistant and Node-RED to create a more intelligent security system. The goal was to reduce false alarms caused by pets or environmental factors while ensuring timely alerts when someone is detected outside the house. This journey was both challenging and rewarding, and I’d like to share my experience and insights with the community.
The Challenge: Reducing False Alarms
Blue Iris is an excellent security camera system, offering features like motion detection and live streaming. However, its default motion alerts often triggered unnecessarily, especially when the kids were playing outside or when the wind moved branches in front of the cameras. While Blue Iris does offer some filtering options, I wanted a more robust solution—specifically, the ability to detect people rather than just motion. This led me to explore integrating Home Assistant and Node-RED into my setup.
The Solution: Combining Blue Iris, Home Assistant, and Node-RED
To tackle this, I decided to use TensorFlow for object detection within Home Assistant. TensorFlow’s ability to identify specific objects (in this case, people) made it the perfect fit for my needs. Here’s how I structured the solution:
-
Blue Iris Integration: I first ensured that Blue Iris was correctly integrated into Home Assistant. This involved setting up the cameras in Home Assistant to pull feeds directly from Blue Iris. Each camera was configured with its own YAML file, specifying the MJPEG URL, username, password, and authentication method.
-
TensorFlow Configuration: Next, I configured TensorFlow within Home Assistant to process the camera feeds. I used the
faster_rcnn_inception_v2_cocomodel, which is optimized for detecting common objects, including people. The TensorFlow component was set to scan each camera feed periodically, though I adjusted the scan interval to a weekly basis to minimize resource usage. -
Node-RED Automation: To tie everything together, I built a Node-RED flow that monitored motion events from Blue Iris. When motion was detected, the flow checked if both my wife and I were home (using a presence detection template). If we were both home, the system waited until after dusk to send an alert. If either of us was away, an alert was triggered immediately. The flow then called the TensorFlow service to analyze the current camera feed. If people were detected, a notification was sent to my phone via the Home Assistant iOS app, complete with a snapshot of the detected area.
Implementation Details
- Camera Configuration: Each camera was configured in Home Assistant with its own YAML file, ensuring easy scalability if I add more cameras in the future.
- Presence Detection: I used the Life360 custom component for presence detection, though any method that updates a template state (e.g.,
homeoraway) would work. - Node-RED Flow: The flow included several key nodes:
- A
server-state-changednode to trigger on motion events. - Conditional checks for presence and time of day.
- A
functionnode to map the motion sensor entity to the corresponding camera and TensorFlow component. - Calls to the TensorFlow service and subsequent state checks.
- A
templatenode to format the notification payload, including the camera’s friendly name. - A
service callnode to send the notification via the Home Assistant iOS app.
- A
Results and Satisfaction
This setup has significantly reduced false alarms while ensuring that genuine alerts are prioritized. The integration of TensorFlow for person detection has been particularly effective, providing a layer of intelligence that traditional motion sensors lack. The Node-RED flow has proven to be both flexible and scalable, allowing me to easily add new cameras or adjust the alert conditions as needed.
One of the most satisfying aspects of this project has been the ability to receive real-time notifications directly on my phone, complete with a snapshot of the detected person. This has greatly enhanced my peace of mind, knowing that my home’s security system is both intelligent and reliable.
Conclusion and Recommendations
For anyone looking to enhance their home security system with intelligent alerts, I highly recommend exploring the combination of Blue Iris, Home Assistant, and Node-RED. The learning curve for TensorFlow and Node-RED can be steep, but the resources available in the Home Assistant and Node-RED communities make it manageable. Additionally, using Docker to run Home Assistant simplifies the installation and management of components like TensorFlow.
This project has not only improved my home’s security but also deepened my understanding of home automation and the power of integrating different technologies. I’m excited to continue exploring new ways to enhance my smart home setup and look forward to sharing more experiences with the community.