As part of our home automation setup video cameras provide eyes on the ground on what is actually happening in your home.
I particularly love using Ubiquities line of IP cameras called Unifi as they provide local stored content without paying for any ongoing fee or subscription. The also have a competitive price, the model I used for this post is the Unifi UVC Flex check current prices from Amazon US or UK.
What you will need to do this project
I recently migrated from a Unifi Video setup installed on an Ubuntu server on a docker to a new cloud key generation 2 with Unifi Protect and have been using this for a month and find no issues at all with the setup. Unifi Protect is the future direction that Ubiquiti are investing and Unifi video is going to be phased out.
You will also need an installation of Home Assistant.
I’d recommend having your IP cameras setup with a static IP address so that you don’t need to change the home assistant configuration every couple of days when the DNS lease expires.
- Go to your Unifi Protect UI and get the IP address and take note of it.
- Within your Unifi Protect UI get the IP address of the camera and take note of it, you will need it in the next step
Configuration into Home Assistant
Go to your configuration.yaml and add the following code:
- platform: generic
name: UVC FLEX
Replace the still image url with the url of your IP Camera
For the stream source instead get the IP address from your stream source.
No instead of the “
Cn4RE45aBiJcArEn” you will need to generate your own code.
You can do this by going to the Unifi Protect interface and select the camera that you want to integrate into Home Assistant, then toggle the RTSP with the highest possible resolution you can. Now copy and paste that URL into configuration.yaml. If you need visual support feel free to watch my youtube video!
Adding to Dashboard
- Add a new card into the dashboard
- Pick the picture entity card
- Find the entity ID and add it into the Entity and Camera Entity (you need both)
- Toggle Camera view to live
That is it! You should be able to have a visual live stream of your Unifi camera in home assistant.
As always, keep it digital!