Ubiquiti UniFi Video and Protect NVR Integration

Have you been able to add a live view option. So I can see my streams on my active tile dashboard

+1 I have not setup my tiles yet but this would be great when walking out the door.

I haven’t looked into adding it yet, but in the meantime you can take advantage of the generic video streaming device and enabling the RTSP stream in the NVR.

So I did this, and it works in ST, but ActionTitles does not see it. I attempted to add the RTSP to their media section, and that did not work display a broken link

So I’ve got the latest code loaded, installed the smartapp, entered my IP and login info and I"m getting nothing. This is all I have in my live logs, sanitized of course.

63a95b0a-92d2-43c7-8a95-b0ed2f699f4a 11:21:10 PM: info nvr_initialize: NVR API is located at 192.168.1.86:7080
63a95b0a-92d2-43c7-8a95-b0ed2f699f4a 11:21:10 PM: info UniFi NVR: updated with settings: [nvrAddress:192.168.1.86, nvrPort:7080, username:USER, password:PASSWORD]

Looks like the login is not coming back with a result. What version of the NVR are you using?

So I’m newer to all of this… I see in the notes that it says compatibility back to 3.4. I dont see where a 3.4 NVR download is listed… I’m runing 3.7.1 on Ubuntu 16.04 and the cameras are reporting motion every 10 minutes on the dot. The motion isnt listed in the NVR Dashboard… Only showing in smart things… Logs listed below… I’m assuming its compatibility based and not a bug…

322fe0e8-d218-4962-9247-bcf7431d7e5e 1:20:09 PM: debug Sending push
322fe0e8-d218-4962-9247-bcf7431d7e5e 1:20:09 PM: debug motion:active, pushAndPhone:Yes, '{{ triggerEvent.descriptionText }}'
322fe0e8-d218-4962-9247-bcf7431d7e5e 1:20:09 PM: debug Notify got evt physicalgraph.app.EventWrapper@7f7ccf45
322fe0e8-d218-4962-9247-bcf7431d7e5e 1:20:04 PM: debug Sending push
322fe0e8-d218-4962-9247-bcf7431d7e5e 1:20:04 PM: debug motion:active, pushAndPhone:Yes, '{{ triggerEvent.descriptionText }}'
322fe0e8-d218-4962-9247-bcf7431d7e5e 1:20:04 PM: debug Notify got evt physicalgraph.app.EventWrapper@3a3f5925
322fe0e8-d218-4962-9247-bcf7431d7e5e 1:20:04 PM: debug Sending push
322fe0e8-d218-4962-9247-bcf7431d7e5e 1:20:04 PM: debug motion:active, pushAndPhone:Yes, '{{ triggerEvent.descriptionText }}'
322fe0e8-d218-4962-9247-bcf7431d7e5e 1:20:04 PM: debug Notify got evt physicalgraph.app.EventWrapper@2313d031

I haven’t tested with anything newer than 3.5 (“if it 'aint broke, don’t fix it” applies to my situation) so its possible the NVR behavior is different. I’ll load up 3.7.x and see whats happening.

I just checked 3.7.1 and the API hasn’t changed at all. Just to confirm: there are no actual recordings stored in the UniFi Video software but the cameras are reporting motion? What are your recording settings?

This is amazing, I can’t believe I just found this… Great job!

I have it set to record all the time. I’m guessing with you saying that; the motion is detected off when the cameras are recording?

I got it working. It was a network issue on my end. I’m using 3.7.1.

Thanks! Enjoy.

Ah thats why. In order for the motion detection to work properly you have to set it to record on motion. The device handler doesn’t do any detection of its own and relies on the UniFi Video software to do it.

Cool. What was your network issue? I’m also interested in being able to detect error cases.

It was a routing problem. For some reason my 192.168.2.X VLAN (where my hub is) wasn’t able to route to 192.168.1.X (where my unifi video server is) when it should have been able to.

Wait… you have the ST hub on a separate vlan from your unifi controller server, and it works?

That is what I have but I can’t get it to work.

Yes, I do and it does work with a bit of trickery though.

It actually has nothing to do with it being on a separate vlan or not, it’s all about the IP only. I figured that out after testing a few things. For some reason, and I’m not sure why the hub’s IP has to match the first the octets, it won’t work even if they are in the same VLAN and the IP is different. For example I created 1 VLAN that was 192.168.0.0/16 and with the hub on 192.168.2.* and unifi server on 192.168.1.* it still wouldn’t work even though they were both in the same VLAN and same subnet. It really had nothing to do with routing at all because in my setup any machine on 192.168.2.X can speak to 192.168.1.X, or any other 192.168.X, without issue.

Thinking I had a routing issue I completely trashed my 192.168 setup and went with a 10. setup (which I had been wanting to do for a while now anyways) and still ran into the issue with the hub at 10.100.200.1 and server at 10.100.100.6 even though the VLAN was 10.100.0.0/16 (same vlan, same subnet).

What I wound up doing is giving the server a second IP in 10.100.200 and it now works.

Technically the requirement of your server being “in the same subnet” as your hub is incorrect. It should be “same IP space as”.

Nice explanation. If I forward a port from my vlan to my server do you think it work?

Hub: 192.168.30.10
Server: 192.168.10.3
Port forwarding from 192.168.30.1:xxxx to 192.168.10.3:xxxx

Then in the up of my router instead of the server?

You could setup a proxy, as long as 192.168.30.X can talk to 192.168.10.X. Port forwarding won’t work because port forwarding only takes place when your router receives a request from outside of your network, from the Internet, not internally.