A Home Assistant custom component that enhances your Frigate NVR experience with Google's Gemini 2.0 AI model. This integration analyzes video clips from Frigate events and provides natural language descriptions of what's happening in the scene.
- 🎥 Automatic video clip analysis from Frigate events
- 🤖 Powered by Google's Gemini 2.0 AI model
- 📝 Customizable analysis prompts per camera
- 🔔 Real-time event processing via MQTT
- 🎯 Single camera focus for accurate analysis
- Make sure you have HACS installed
- Add this repository as a custom repository in HACS:
- Click on HACS in the sidebar
- Click on Integrations
- Click the three dots in the top right corner
- Select "Custom repositories"
- Add
https://github.com/kucau0901/frigem
as a custom repository - Select "Integration" as the category
- Click Install
- Restart Home Assistant
- Copy the
custom_components/frigate_gemini
directory to your Home Assistant'scustom_components
directory - Restart Home Assistant
- A working Frigate NVR installation. Minimum version 0.9.1
- A Google API key with access to Gemini 2.0
- MQTT broker configured in Home Assistant
- Go to Settings → Devices & Services
- Click "Add Integration"
- Search for "Frigate Gemini"
- Fill in the required information:
- Gemini API Key
- Frigate URL (e.g., http://frigate:5000)
- MQTT Topic (default: frigate/events)
- Select a camera to monitor
- Configure the analysis prompt
Each camera can have its own custom prompt for video analysis. The prompt supports the {label}
placeholder, which will be replaced with the detected object type (e.g., person, car, dog).
Example prompts:
"What is the {label} doing in the video? Describe their actions and behavior."
"Focus on the {label}'s movement patterns and any interactions with the environment."
"Analyze the {label}'s appearance, actions, and any notable events in the scene."
You can update the prompt at any time through the integration's options in the Home Assistant UI.
Once configured, the integration will:
- Listen for Frigate event notifications on the configured MQTT topic
- Download the event video clip
- Send the clip to Gemini 2.0 for analysis with your custom prompt
- Create a sensor with the analysis result
The sensor entity will be named sensor.frigem_[camera_name]
and will contain:
- State: Latest analysis result
- Attributes:
- Camera name
- Event timestamp
- Detected label
- Custom prompt used
Head over to our WIKI for more.
This project is licensed under the MIT License - see the LICENSE file for details.
- Report issues on GitHub
- Join discussions in the Home Assistant Community
- Join Home Assistant Malaysia