Doc update for new endpoint in unifi protect (#35629)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Lutz 2024-11-28 08:49:01 +01:00 committed by GitHub
parent d2c7b06881
commit 36fd5a0651
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -260,19 +260,23 @@ The {% term integrations %} provides two proxy views to proxy media content from
These URLs work great when trying to send notifications. Home Assistant will automatically sign the URLs and make them safe for external consumption if used in an {% term automation %} or [notify action](/integrations/notify/). These URLs work great when trying to send notifications. Home Assistant will automatically sign the URLs and make them safe for external consumption if used in an {% term automation %} or [notify action](/integrations/notify/).
Two URLs for proxy API endpoints: Three URLs for proxy API endpoints:
`/api/unifiprotect/thumbnail/{nvr_id}/{event_id}:` `/api/unifiprotect/thumbnail/{nvr_id}/{event_id}`
- Proxies a JPEG event thumbnail from UniFi Protect. - Proxies a JPEG event thumbnail from UniFi Protect.
`/api/unifiprotect/video/{nvr_id}/{camera_id}/{start}/{end}`: `/api/unifiprotect/video/{nvr_id}/{camera_id}/{start}/{end}`
- Proxies a MP4 video clip from UniFi Protect for a specific camera. Start and end must be in [ISO 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html). - Proxies a MP4 video clip from UniFi Protect for a specific camera. Start and end must be in [ISO 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html).
`/api/unifiprotect/video/{nvr_id}/{event_id}`
- Proxies a MP4 video clip from UniFi Protect for a specific event. To get the video, the event needs to be finished. If it's still ongoing, use the camera endpoint defined above.
`nvr_id` can either be the UniFi Protect ID of your NVR or the config entry ID for your UniFi Protect {% term integrations %}. `camera_id` can either be the UniFi Protect ID of your camera or an entity ID of any {% term entity %} provided by the UniFi Protect {% term integrations %} that can be reversed to a UniFi Protect camera (i.e., an entity ID of a detected object sensor). `nvr_id` can either be the UniFi Protect ID of your NVR or the config entry ID for your UniFi Protect {% term integrations %}. `camera_id` can either be the UniFi Protect ID of your camera or an entity ID of any {% term entity %} provided by the UniFi Protect {% term integrations %} that can be reversed to a UniFi Protect camera (i.e., an entity ID of a detected object sensor).
The easiest way to find the `nvr_id`, `camera_id`, `start`, and `end` times is by viewing one of the videos from UniFi Protect in the Media browser. If you open the video in a new browser tab, you will see all these values in the URL. The `start` time is the last_changed timestamp of the event when the sensor started detecting motion. The `end` time is the last_changed timestamp of the event when the sensor stopped detecting motion. Similarly, to see the `event_id` of the image, go to {% my developer_states title="**Developer Tools** > **States**" %} and find the event when the sensor started detecting motion. The easiest way to find the `nvr_id`, `camera_id`, `start`, and `end` times is by viewing one of the videos from UniFi Protect in the Media browser. If you open the video in a new browser tab, you will see all these values in the URL. The `start` time is close to the last_changed timestamp of the event when the sensor started detecting motion. The `end` time is close to the last_changed timestamp of the event when the sensor stopped detecting motion. Similarly, to see the `event_id` of the image, go to {% my developer_states title="**Developer Tools** > **States**" %} and find the event when the sensor started detecting motion.
### Example Notification Automation with Video ### Example Notification Automation with Video