Integrating Loxone Intercom Video into UniFi Protect via go2rtc

Integrating Loxone Intercom Video into UniFi Protect via go2rtc

Goal

This guide explains how to make the video stream from a Loxone Intercom (Gen. 1 or newer models supporting MJPEG) visible within the Ubiquiti UniFi Protect NVR system (running on a UDM Pro, UNVR, etc.) by using go2rtc as an intermediary bridge. go2rtc will convert the Intercom's authenticated MJPEG stream into an RTSP stream that UniFi Protect can adopt.

This method requires running go2rtc on a separate machine, commonly as a Home Assistant Add-on or a Docker container on a server/NAS.

Prerequisites

  1. Loxone Intercom: Installed, configured on the network, and accessible via its IP address. You need the username and password for accessing the Intercom's web interface or video stream.

  2. UniFi Protect System: A UniFi Dream Machine Pro (UDM Pro), UNVR, or Cloud Key Gen2+ running UniFi Protect.

  3. Host for go2rtc:

    • Either a running Home Assistant installation (capable of running Add-ons).

    • Or a machine capable of running Docker containers (e.g., a server, NAS).

  4. Network Access: The machine running go2rtc must be on the same network as the Loxone Intercom and the UDM Pro, or have appropriate network routes and firewall rules configured.

  5. Credentials: Know the IP address and login credentials (username/password) for your Loxone Intercom.

  6. Basic Knowledge: Familiarity with your network setup, UniFi interface, and either Home Assistant or Docker basics.

Diagram (Conceptual)

Loxone Intercom --------> [HTTP MJPEG + Basic Auth] --------> go2rtc Host (HA/Docker) --------> [RTSP Auth] --------> UDM Pro / UniFi Protect (e.g., 10.0.2.88) (e.g., 10.0.2.123) (UniFi NVR)

Step-by-Step Instructions

Step 1: Install go2rtc

You need to install go2rtc on a host machine. Choose one of the following methods:

A) Using Home Assistant Add-on:

  1. Navigate to your Home Assistant interface.

  2. Go to Settings > Add-ons.

  3. Click the Add-on Store button (usually in the bottom right).

  4. Click the three dots icon (⋮) in the top right corner and select Repositories.

  5. In the "Manage add-on repositories" dialog, paste the following URL into the input field:

    https://github.com/AlexxIT/hassio-addons
  6. Click Add.

  7. Close the repositories dialog. The Add-on Store will refresh (this might take a few moments). If the new add-on doesn't appear immediately, try refreshing your browser page.

  8. Once refreshed, search for go2rtc within the Add-on Store.

  9. You should now see the go2rtc add-on from the repository you just added. Click on it.

  10. Click Install and wait for the installation to complete.

  11. After installation, configure the Add-on (see Step 3 below).

  12. Enable "Start on boot" and "Watchdog" if desired on the Add-on's page.

  13. Start the Add-on.

  14. You can access the go2rtc web UI via the sidebar link or by clicking "Open Web UI" on the Add-on page to verify it's running (usually accessible via http://<home-assistant-ip>:1984).

B) Using Docker:

  1. Ensure you have Docker installed and running on your chosen host machine.

  2. Open a terminal or SSH session to your Docker host.

  3. Run the following command to pull and start the go2rtc container:

    docker run -d --name go2rtc --restart=unless-stopped -p 1984:1984 -p 8554:8554 -v $(pwd)/go2rtc.yaml:/config/go2rtc.yaml alexxit/go2rtc
    • -d: Run in detached mode.

    • --name go2rtc: Assigns a name to the container.

    • --restart=unless-stopped: Ensures the container restarts automatically.

    • -p 1984:1984: Maps the host port 1984 to the container's API/Web UI port.

    • -p 8554:8554: Maps the host port 8554 to the container's default RTSP port.

    • -v $(pwd)/go2rtc.yaml:/config/go2rtc.yaml: Important: This mounts a configuration file named go2rtc.yaml from your current directory ($(pwd)) into the container. Create an empty go2rtc.yaml file in your current directory before running this command. You will edit this file in Step 3. Adjust the path $(pwd)/go2rtc.yaml if you store your configuration elsewhere.

  4. Verify the container is running (docker ps).

  5. You can access the go2rtc web UI via http://<docker-host-ip>:1984.

Step 2: Generate Basic Authentication Header

The Loxone Intercom protects its MJPEG video stream with Basic HTTP Authentication. go2rtc needs this authentication information provided in a specific format (Base64 encoded).

  1. Go to a Basic Auth Header generator website, for example: Generate HTTP Basic Auth Header

  2. Enter the Username and Password that you use to access your Loxone Intercom's web interface or video stream.

  3. Click the "Generate header" button (or similar).

  4. The tool will output a string that looks like Authorization: Basic yourbase64string= (the characters after Basic will be different based on your credentials).

  5. Copy the entire generated string, including Authorization: Basic. You will need this exact string in the next step.

Step 3: Configure go2rtc Stream

Now, configure go2rtc to pull the MJPEG stream from the Loxone Intercom and serve it as an RTSP stream.

  1. Edit the go2rtc configuration:

    • Home Assistant Add-on: Go to Settings > Add-ons > go2rtc. Click the Configuration tab. Change the editor mode to YAML (usually via the three dots menu).

    • Docker: Edit the go2rtc.yaml file you created and mounted in Step 1B.

  2. Paste the following configuration into the editor, replacing the existing content or adding it under the relevant sections:

    YAML
    streams: http_mjpeg: "http://10.0.2.88/mjpg/video.mjpg#header=Authorization: Basic yourbase64string" rtsp: listen: ":8554" # RTSP Server TCP port, default - 8554 username: "admin" # optional, default - disabled password: "pass" # optional, default - disabled default_query: "video&audio" # rtsp: # Enable the RTSP server functionality listen: ":8554" # Port go2rtc listens on for RTSP connections (default: 8554) # Define credentials UniFi Protect will use to connect to *this* go2rtc RTSP stream # You can change these, but remember them for Step 5. username: "admin" password: "pass" # Optional: Specify default codecs if needed, often not required. # default_query: "video&audio" # Loxone MJPEG likely only provides video. Remove or keep commented if unsure. # Optional: Configure the Web UI/API if needed (often defaults are fine) # api: # listen: ":1984"
  3. Make the crucial replacements:

    • In the loxone_intercom: stream definition:

      • Change http://10.0.2.88/mjpg/video.mjpg to use your Loxone Intercom's actual IP address.

      • Replace the entire example header Authorization: Basic yourbase64string with the full header string you generated in Step 2. Make sure it's enclosed in double quotes and follows the #header= part exactly.

    • In the rtsp: section:

      • You can keep or change the username and password. These are the credentials UniFi Protect will use to connect to go2rtc, not the Loxone Intercom credentials. Remember what you set here.

  4. Save the configuration:

    • Home Assistant Add-on: Click Save. You may need to restart the go2rtc Add-on for changes to take effect (check the Log tab for confirmation).

    • Docker: Save the go2rtc.yaml file. Restart the container: docker restart go2rtc.

  5. Verify the stream in go2rtc: Open the go2rtc Web UI (http://<go2rtc-host-ip>:1984). You should see your loxone_intercom stream listed. Click on it to see if the video is playing correctly. This confirms go2rtc can access the Intercom stream.

Step 4: Enable 3rd-Party Camera Discovery in UniFi Protect

Before UniFi Protect can find the go2rtc stream, you need to enable the feature.

  1. Log in to your UDM Pro (or other UniFi Console).

  2. Open the UniFi Protect application.

  3. Navigate to Settings (usually the cog icon).

  4. Go to the System section.

  5. Scroll down to find the Advanced settings area.

  6. Toggle ON the setting named "Enable 3rd-Party Cameras" or similar (the exact wording might vary slightly).

Step 5: Add the go2rtc Stream as a Camera in UniFi Protect

Now, adopt the go2rtc RTSP stream.

  1. While still in the UniFi OS interface (not Protect specifically), navigate to UniFi Devices (usually the icon showing a switch or UDM).

  2. In the top-right corner of the UniFi Devices page, click the Question Mark (?) icon.

  3. From the dropdown menu, select "Try advanced adoption" (or similar wording like "Add device manually" / "Advanced Add").

  4. A window or form will appear asking for camera details. Enter the following:

    • IP Address: The IP address of the machine running go2rtc (your Home Assistant IP or Docker host IP).

    • Port: 1984 (This is the port you specified in the prompt. It typically refers to the go2rtc API/WebUI port. UniFi might use this for initial discovery or proxying. If this fails later, you might need to troubleshoot using the RTSP port 8554).

    • Username: admin (or the username you configured in go2rtc.yaml under rtsp: in Step 3).

    • Password: pass (or the password you configured in go2rtc.yaml under rtsp: in Step 3).

  5. Click "Adopt" or "Add".

UniFi Protect should now attempt to connect to go2rtc using the details provided, discover the RTSP stream (rtsp://admin:pass@<go2rtc-host-ip>:8554/loxone_intercom), and add it as a camera. It might take a minute or two to show up as "Online" and display the video feed within UniFi Protect.

Troubleshooting

  • No Video in UniFi Protect:

    • Verify the stream works correctly in the go2rtc Web UI first (Step 3.5). If not, check go2rtc logs (Add-on > Log tab; Docker > docker logs go2rtc) for errors connecting to the Loxone Intercom (e.g., wrong IP, incorrect auth header).

    • Double-check the IP address, Port (try 8554 instead of 1984 if 1984 doesn't work in Step 5), Username, and Password entered in UniFi Protect's advanced adoption (Step 5). They must match the go2rtc host IP and the rtsp: credentials in go2rtc.yaml.

    • Check firewalls: Ensure the UDM Pro can reach the go2rtc host on TCP port 1984 and/or 8554. Ensure the go2rtc host can reach the Loxone Intercom on its HTTP port (usually 80).

    • Test the RTSP stream directly using a tool like VLC: Open rtsp://admin:pass@<go2rtc-host-ip>:8554/loxone_intercom (use the correct credentials and stream name from your go2rtc.yaml).

  • Incorrect Base64 Header: Ensure you copied the entire Authorization: Basic ... string in Step 2 and correctly placed it after #header= in Step 3.

  • go2rtc Errors: Check the logs for specific error messages.

Related content