How to Watch Unifi Video with Alexa Video Show

Yes, you CAN integrate the Amazon Alexa Video Show 5 with your Ubiquiti Unifi Protect Video System! “Alexa, show me the nursery!” will display the RTSP stream from your Ubiquiti Instant that’s aimed at the baby on your Alexa Video Show! There are a couple of pieces that need to be configured, but they are all free! The problem is that Unifi Protect cameras use RTSPS (real-time streaming protocol, secure) on port 7441. Alexa only looks for cameras on HTTPS port 443. Sounds like we need a bridge! Well, there IS one AND there’s a Raspberry PI version available AND it’s free.

So, let’s walk through the process of making your Unifi Protect cameras discoverable by Alexa.

monoclecam.com Setup

First, you’ll need to set up a FREE account on monocle.com’s website. It’s a beta program, but it’s free and easy to use. Browse over to Monocle and hit the Register Now! button and fill out the little form.

You’ll get an email with a confirmation link to click. Follow the steps from there to create your own monocle account. That’s enough for now.

Monocle Gateway for Raspberry

Next, we’re going to create the gateway that the online account will access to find your cameras. This can be run on a docker VM, a PC, your Synology, or a Raspberry! I chose the Raspberry route, of course. Setup a Raspberry Pi 3 or 4 with the latest OS, change the passwords, run apt update, and do anything else you normally do with a new Raspberry on your network.

To install the Gateway, browse over to the monocle website again and follow these directions for how to Install Monocle Gateway on Linux (RaspberryPi). They’re well written, step-wise, and easy to follow. I won’t try to reproduce them here. One feature I will mention is the log viewer. ssh into the gateway raspberry and give the command “monocle-gateway –tail” and you can see the traffic on the gateway. You’ll see Alexa looking for cameras and the gateway itself reaching out to the website to learn how the cameras are configured.

When you first start monocle-gateway with –tail, your should see:

root@nagios:~# monocle-gateway --tail

 ******************************************************************
 *             __  __  ___  _  _  ___   ___ _    ___              *
 *            |  \/  |/ _ \| \| |/ _ \ / __| |  | __|             *
 *            | |\/| | (_) | .` | (_) | (__| |__| _|              *
 *            |_|  |_|\___/|_|\_|\___/ \___|____|___|             *
 *                                                                *
 ******************************************************************

<<TAIL>> LOG FOR THE [MONOCLE-GATEWAY] SERVICE
-- Logs begin at Thu 2019-02-14 05:11:59 EST. --
Mar 10 09:55:00 nagios systemd[1]: Started Monocle Gateway Service.
Mar 10 09:55:02 nagios monocle-gateway[613]:  ******************************************************************
Mar 10 09:55:02 nagios monocle-gateway[613]:  *             __  __  ___  _  _  ___   ___ _    ___              *
Mar 10 09:55:02 nagios monocle-gateway[613]:  *            |  \/  |/ _ \| \| |/ _ \ / __| |  | __|             *
Mar 10 09:55:02 nagios monocle-gateway[613]:  *            | |\/| | (_) | .` | (_) | (__| |__| _|              *
Mar 10 09:55:02 nagios monocle-gateway[613]:  *            |_|  |_|\___/|_|\_|\___/ \___|____|___|             *
Mar 10 09:55:02 nagios monocle-gateway[613]:  *                                                                *
Mar 10 09:55:02 nagios monocle-gateway[613]:  ******************************************************************
Mar 10 09:55:03 nagios monocle-gateway[613]: -------------------------------------------------
Mar 10 09:55:03 nagios monocle-gateway[613]: MONOCLE RUNTIME ENVIRONMENT
Mar 10 09:55:03 nagios monocle-gateway[613]: -------------------------------------------------
Mar 10 09:55:03 nagios monocle-gateway[613]: VERSION   = 0.0.4
Mar 10 09:55:03 nagios monocle-gateway[613]: OS/ARCH   = linux/arm
Mar 10 09:55:03 nagios monocle-gateway[613]: PROCESS   = monocle-gateway (PID=613)
Mar 10 09:55:03 nagios monocle-gateway[613]: TIMESTAMP = 2022-03-10T14:55:03.703Z
Mar 10 09:55:03 nagios monocle-gateway[613]: -------------------------------------------------
Mar 10 09:55:03 nagios monocle-gateway[613]: MONOCLE GATEWAY SERVICE         (Version: 0.0.4)
Mar 10 09:55:03 nagios monocle-gateway[613]: -------------------------------------------------
Mar 10 09:55:03 nagios monocle-gateway[613]: [Monocle Starting]
Mar 10 09:55:03 nagios monocle-gateway[613]: [Monocle Connecting]
Mar 10 09:55:03 nagios monocle-gateway[613]: [Monocle Started]
Mar 10 09:55:03 nagios monocle-gateway[613]: [RTSP Server Starting]
Mar 10 09:55:03 nagios monocle-gateway[613]: [RTSP Server Listening] 0.0.0.0:8555 (RTSP)
Mar 10 09:55:03 nagios monocle-gateway[613]: [RTSP Server Listening] 0.0.0.0:443 (RTSP-TLS)
Mar 10 09:55:03 nagios monocle-gateway[613]: [RTSP Proxy Started] (PID=706)
Mar 10 09:55:03 nagios monocle-gateway[613]: [RTSP Server Listening] 0.0.0.0:8554 (PROXY)
Mar 10 09:55:03 nagios monocle-gateway[613]: [RTSP Server Started]
Mar 10 09:55:03 nagios monocle-gateway[613]: [Monocle Connected]
Mar 10 09:55:03 nagios monocle-gateway[613]: [RTSP Server Registered]
Mar 10 09:55:03 nagios monocle-gateway[613]: -------------------------------------------------
Mar 10 09:55:03 nagios monocle-gateway[613]: MONOCLE RTSP SERVICE - INITIALIZED
Mar 10 09:55:03 nagios monocle-gateway[613]: -------------------------------------------------
Mar 10 09:55:03 nagios monocle-gateway[613]: FQDN = 4b85e3a4-d403-4ce6-88f6-36498f106551.mproxy.io
Mar 10 09:55:03 nagios monocle-gateway[613]: HOST = 192.168.1.54
Mar 10 09:55:03 nagios monocle-gateway[613]: PORT = 443
Mar 10 09:55:03 nagios monocle-gateway[613]: -------------------------------------------------

At the very bottom of this is the juicy tidbit. Create a CNAME on your DNS server that points the listed FQDN at the HOST. If you’re running pi-hole for your DNS server, click on Local DNS records > DNS and put in the FQDN for the left box and the HOST IP address on the right. Hit the Add button, and then Save.

Use rtsp instead of rtsps with Ubiquiti Protect

Now, let’s start adding cameras! Browse to Protect on your unifi.ui.com once you’re logged in. Click on a camera and then the gear in the upper right to change the settings. Scroll down to Advanced and turn on the Real-Time Streaming Protocol by clicking on the slider in the medium category. Click the Copy Link icon to grab the stream URL.

You need to copy this stream URL into your new account on monoclecam.com after you hit “+ Add Camera Feed”. Fill in the particulars from the Protect settings page. Give a name that’s distinct and easy to say and remember, because that’s what Alexa will know it as. The Description is up to you. Enter the Brand and Model. You can paste the URL for the camera stream that you copied a minute ago. Be sure to set the video resolution to the resolution shown in Protect for your model camera set at “medium”. Finally, be sure to add the “optional” Tag “@tunnel”. That’s the magic that lets the web set up know that it’s getting routed through your Raspberry Gateway. Leave the other fields at the defaults and click SAVE.

What’s this? rtsps is not a recognized protocol?!??! We can fix that! Edit your copied link in the following ways:

rtsps://192.168.1.10:7441/uiV4KR4ZlDKzMZaW?enableSrtp
rtsp://192.168.1.10:7447/uiV4KR4ZlDKzMZaW

Remove the ? and everything after. Change the port from “7441” to “7447”. Change the protocol from “rtsps” to “rtsp” Hit SAVE again. Success!

Alexa Skills

Next piece of the puzzle. Log into your amazon.com skills page and add a new skill to your device. Search for “Monocle RTSP/RTP IP Cameras”, enable it, and follow the steps to link your account.

Finally, tell Alexa, “Alexa, discover devices.” That will cause Alexa to search your network for smart devices. It will find your Monocle gateway and learn all the devices that you’ve established on the monoclecam.com website.

“Alexa, show Unifi Camera!”

That’s it! Ask Alexa, “Alexa, show Driveway!” and after a second or two, you will see the requested camera!

The beautiful thing about this whole setup is that it does not require an exception in your firewall OR a port redirection. This is good news since I’m already redirecting incoming 443 traffic to this website! I made NO changes to my Ubiquiti USG-3P firewall to get all of this working! KUDOS, Monocle! To get this all working on a Verizon G3100, make sure you turn OFF DNS rebinding for this server!

Monocle-Gateway as a Service

You’re going to need this software running at all times that you want Alexa to find your cameras. To install the unit files so this all starts at bootup and stays running, just install the .service file:

monocle-gateway --install

10 thoughts on “How to Watch Unifi Video with Alexa Video Show

  1. Great post, this has swayed me back to paying extra for some UniFi cameras…

    I have a question though…. Can you do two way talking with those cameras that have speakers?
    Thanks very much

    Simon

  2. I had it working, just that way, now suddenly it stopped working and neither my Show 8, nor the Fire TV is able to show the stream anymore. It just comes the message that the camera is not responding.
    I have no idea what happened. I hope it is still working at your side.

      1. … but how? I’ve run into the same problem. My Cam was working but from one day to another (about ~3 month ago) it suddendlich stoped working with the same message like Loeffel had written. :-/

      2. I finally got everything installed on the Unifi side but can’t seem to get this Alexa integration working… the monocle gateway logs stuff when i ask Alexa to show a camera feed… but then says Hmmm, the camera isnt responding. The rtsp feed is definitely good as checked in VLC… seems like it might be a delay issue, so i tried a lesser resolution… still no joy.
        Any pointers welcome 🙂

  3. Had this setup working for almost 2 years. Sometimes the Monocle gateway on the Pi needed a restart. But now not working anymore. Thought of another Unifi related mess after the Protect 2.0.0 update, but the rtsp streams are working fine. The Echoes just don’t connect. Re-installed the monocle service and the skill – no success.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.