fwestenberg / reolink_dev

Home Assistant Reolink addon
MIT License
553 stars 101 forks source link

How do you get last video snapshot URL for notifications? #554

Open skynet01 opened 1 year ago

skynet01 commented 1 year ago

I noticed my reolink cameras entities have the last video URL. I wanted to set up a push notification with a thumbnail (the thumbnail works fine with entity_picture url) but the video's last snapshot doesn't.

For some reason when I try to use the video_url I get 401 Unauthorized error.

Here is an example of a video URL that my reolink camera entity has.

video_url: /api/reolink_dev/vod/31531113ea98adae763ada6d2d6cb8ce/Mp4Record%2F2022-08-23%2FRecS02_20220823_165312_000000_2B14908_0.mp4

Thanks for the help!

skynet01 commented 1 year ago

I also noticed that there is a service call called "reolink_dev.query_vods" maybe someone can post an example using that? As I have not been able to get anything of it as it's not documented.

calisro commented 1 year ago

Did you get this working?

skynet01 commented 1 year ago

I didn't, I just gave up and switched to Frigate. Which also comes with its own set of problems.

The main issue I have is that I dont get reliable notifications from this integration. I compared the log from Reolink portal to my HA sensor and only about 30% of notifications are logged, for many the sensor becomes unavailable around the time notification happens.

I am sure this is due to the camera being busy recording the event and analyzing the frames. .. .. I think another solution could be to have the camera record to a local ftp server, then mount that drive into HA and create a sensor for when a folder updates. Then you have notification for motion (if you set it to take snapshots) and you have access to the latest clip as well.

calisro commented 1 year ago

think another solution could be to have the camera record to a local ftp server, then mount that drive into HA and create a sensor for when a folder updates.

thanks for the reply. That's actually what I am already doing now. works okay.

skynet01 commented 1 year ago

Just ok? Or good enough? I might switch back from Frigate and go with this method 😉

calisro commented 1 year ago

Well. It works okay as I said but I'm trying to figure the best approach to have a lovelace card reflect that latest jpg very quickly. I tried creating a local_file camera entity that works with a picture-glance but doesn't refresh quick enough. There really isnt a great method for an immediate update in lovelace when the local file updates.

But I do get the ftp records fairly quickly and the sensor I have updating pretty quickly and ontop of that I use a gallery-card.

skynet01 commented 1 year ago

You could try to use a Frigate Lovelace Card, it works without frigate and you can set it to auto update a snapshot every second or so, and it has Lovelace ui to make first time setup easy, it also allows you to auto switch to the camera with motion based on any sensor you give it. I am using it with a few none frigate cameras and it works great.

calisro commented 1 year ago

YEah I just started looking at that. Frankly I didn't think the card was usable without frigate integration itself but its really an awesome card without frigate as well. Its working perfectly now. Thanks!