I have automation to display UniFi Protect camera on Google Hub. It stopped working about a week ago, after working fine for the last few years. Now whe there is a trigger, Google Hub goes into a buffering state [i.e. black screen of playing media] and never exists. I checked the logs and there are no errors, I tried the different camera and different Google hub, same result. I can see cameras on the dashboard without an issue.
Does anyone else have this issue? Any recommendations on how to fix it?
I’ve seen issues with UniFi camera feeds on the dashboard not appearing and requiring a refresh, but you need to consider how Chromecast works.
The server passes a URL to the cast device. The cast will only work if the URL is accessible (network naming, DNS, IPv6 can all be issues), and the server allows it (access control).
I’ve never worked out the YAML to get a cast to work (would be interested in how!), but a test using the Media browser to manually case the Unifi camera source just worked fine to a Hub Max and a docked Pixel tablet.
The issue is that Unifi Protect use a format that Google doesn’t detect. They use secure RTSP feeds and do not use a pure RTSP feed. The Protect integration either exposes this RTSPS or the proprietary feed, I am not sure which one.
The work around would be to create a GENERIC camera using the Unifi RTSP feed and then expose your generic camera to Google Assistant.
Now, getting an RTSP feed out of Unifi protect as of today is a little tricky. Not sure if that will change with Protect version 5 when ONVIF support is added.
Basically, when go to your Protect dashboard and look at the Settings for a camera, there is an advanced section that exposes an RTSPS feed. You need to turn that on, but then need to convert the URL given to a RTSP one. This is the bit I found undocumented, but worked when I imported cameras to Synology.
Copy the RTSPS link Protect gives you in the Advanced section of the Camera settings.
Change the rtsps:// at the start to rtsp://
After the IP address of the camera you have :7441, which is the port. Change this t o 7447
At the very end of the URL you will see ?enableSrtp delete this bit, but do not delete anything before the ? mark.
So the url will look like rtsp://ip.add.of.cam:7447/randomchartoken
This should give you a clean RTSP feed for your generic camera
When setting up the Generic Camera Integration, there is no username and password so leave this blank. The RTSP feed type should work with tcp, udp or http, but you may need to experiment in your own setup.
Match the Frame Rate to the FPS of your camera
The Protect app will give you a choice of 3 RTSPS feeds to choose from, so choose the quality you need for the camera setup you want to use
This may stop working if Unifi change things, but it worked for me for now.