[AI Router] Integrating Frigate with Home Assistant

This guide will walk you through integrating Frigate with Home Assistant and show how to use AI object detection to trigger automation events. By following these steps, you’ll unlock the full power of Frigate and enhance your smart home experience.

 

Prerequisites

   Before you begin, make sure you have completed the following:

  1. Home Assistant is installed and set up, and is working properly. See the Home Assistant Installation & Getting Started Guide.
  2. Frigate is installed and set up, and is working properly. See Installing Frigate and Setting Up Frigate Cameras.
  3. An MQTT Broker (such as Mosquitto) is installed and working in Home Assistant. See Installing MQTT Broker in Home Assistant.
  4. HACS is installed and working in Home Assistant. See HACS Installation Guide.

 

1. Install the Frigate Integration via HACS

  • Go to the Home Assistant HACS page, search for [Frigate], and click install.

  • Read the installation instructions carefully, then click [DOWNLOAD] to install.

  • After installation, restart Home Assistant to load the new integration.

 

 

2. Set Up the Frigate Integration

  • After restarting, go to [Settings] > [Devices & Services].

  • Click [Add Integration] in the lower right, then search for [Frigate] and select it.

  • In the pop-up window, enter the Frigate URL, uncheck [Validate SSL], and enter your Frigate username and password.

 

  • You’ll see the cameras already set up in Frigate.

  • After clicking finish, you’ll see the Frigate integration has been added successfully.

  • After adding to the dashboard, you’ll see the video and object detection status. If object status is [Unavailable], you need to modify the Frigate configuration file to send object detection info to Home Assistant.

 

 

3. Modify the Frigate Configuration File to Add MQTT Info

  • Go to the Frigate management interface and click the Configuration editor in the left menu.
  • Edit the configuration file as shown below. Replace the camera name and RTSP URL in the cameras section with your camera’s name and RTSP stream URL. RTSP URL formats vary by brand; check your camera’s documentation for the correct format. <username> and <password> are your dedicated RTSP account credentials, and <IPCam IP> is your camera’s IP address.
  • In the mqtt section, replace host, user, and password with your MQTT Broker IP and credentials.
  • After editing, click Save & Restart in the upper right to save and restart Frigate.

mqtt: 
     enabled: false 
     host: <YOUR AI Board IP>   # Your MQTT Broker server IP (or container network name) 
     port: 1883 
     topic_prefix: frigate 
     user: <Mosquitto USERNAME>                # Your MQTT Broker username 
     password: <Mosquitto PASSWORD> # Your MQTT Broker password 
     client_id: frigate 
detectors: 
    routernpu: 
        type: npu

 

model: 
      path: /cpu_model.tflite 
      width: 320 
      height: 320

 

objects: 
    track: 
      - person 
    filters: 
      person: 
          min_score: 0.40     # Boxes below this score are discarded/not tracked 
          threshold: 0.40     # Event/notification threshold (raise to reduce false alarms)

 

cameras: 
    AMCREST_Example: # <- Name the camera 
          enabled: true 
          ffmpeg:

             hwaccel_args: -c:v h264_v4l2m2m    # enable hardware acceleration

             input_args: preset-rtsp-generic    # enable hardware acceleration

             inputs: 
                - path: rtsp://<username>:<password>@<IPCam IP>:554/cam/realmonitor?channel=1&subtype=0 # <- RTSP URL 
                   roles: 
                      - detect 
          detect: 
              enabled: true # <---- disable detection until you have a working camera feed 
              width: 640 
              height: 360

 

Tapo_Example: # <- Name the camera 
   enabled: true 
   ffmpeg: 
      hwaccel_args: -c:v h264_v4l2m2m    # enable hardware acceleration

      input_args: preset-rtsp-generic    # enable hardware acceleration

      inputs: 
        - path: rtsp://<username>:<password>@<IPCam IP>:554/stream1 # <- RTSP URL 
          roles: 
             - detect 
   detect: 
       enabled: true # <---- disable detection until you have a working camera feed 
       width: 640 
       height: 360

 

version: 0.15-1

 

 

4. Set Up Automations in Home Assistant

  • Go back to the Home Assistant dashboard, and you’ll see the number of objects detected by Frigate.

  • Next, go to [Settings] > [Automations & Scenes], and click [Add Automation] in the lower right. For example, [Turn on the light when a person is detected].

  • In the [When] section, click [Add Trigger].

  • Select [Entities], choose the Frigate camera you just added, and select the [Person count] event. Set the value to greater than 0, which means the automation will trigger when a person is detected.

  • In the [Then] section, click [Add Action], select [Device], choose the light device you want to control, and set it to turn on the light.

 

 

Now your automation to turn on the light when a person is detected is complete. You can set up more automations as needed to make your smart home even smarter.

 

 

 

 

 

How to get the (Utility / Firmware)?

You can download the latest drivers, software, firmware and user manuals in the ASUS Download Center.

If you need more information about the ASUS Download Center, please refer this link.