My goal is to have picture card (that I can click to go to my camera stream). Picture card should have a thumbnail, a somewhat recent snapshot of my camera (either last event snapshot, OR current ish snapshot).
Camera view (faces 429)
This method below works BUT I often encounter 429s
Failed to start WebRTC stream: Nest API error: Too Many Requests response from API (429): RESOURCE_EXHAUSTED (429): Rate limited for the ExecuteDeviceCommand API for the user.
I can confirm this is true via the gcp console:
I’ve not found a way to extend that limit.
square: true
type: grid
columns: 2
cards:
- type: picture-entity
entity: camera.driveway_camera
show_state: true
show_name: true
camera_view: live # <<<<<< this works
camera_image: camera.driveway_camera # <<<<< this works
- type: picture-entity
entity: camera.backyard_entrance_camera
show_state: true
show_name: true
- type: picture-entity
entity: camera.deck_camera
show_state: true
show_name: true
- type: picture-entity
entity: camera.front_doorbell
show_state: true
show_name: true
- type: picture-entity
entity: camera.garage_nest_camera
show_state: true
show_name: true
Obtain Thumbnail URL
according to the documentation, this is how you can get the thumbnail, the plan is to use this thumbnail with either picture-glance
card or picture-entity
cards.
/api/nest/event_media/{{ nest_camera_id }}/{{ api_event_id }}/thumbnail
Obtain nest_camera_id
Currently the way I find camera id:
- Create a New Automation: In Home Assistant, create a new automation using your Nest device.
- Switch to YAML View: After creating the automation, switch to the YAML view.
- Locate the Device ID: The device ID will be displayed within the YAML code.
- Example: In the YAML code, the device ID will be similar to this: device_id: zzzzzzzzzzzzzzz.
Obtain api_event_id
The API event id seems to be part of the event.<camera_name>_motion
, I can use templates to print it.
{% set camera_entity_id = 'camera.front_doorbell' %}
{% set event_entity_id = 'event.front_doorbell_motion' %}
# --- START DEBUGGING OUTPUT for {{ camera_entity_id }} ---
# 1. The Full State Object (can be long):
Camera State Object:
{{ states[camera_entity_id] }}
# 2. The State Value:
Camera State Value: {{ states[camera_entity_id].state }}
# 3. All Attributes (LOOK HERE FOR THE NEST DEVICE ID ATTRIBUTE NAME):
Camera Attributes:
{{ states[camera_entity_id].attributes }}
# 4.
{{states[event_entity_id]}}
# 5.
{{states[event_entity_id].attributes}}
# --- END DEBUGGING OUTPUT ---
Form Thumbnail URL
Now with both api event id and the camera id, I can construct what seems to be a sucessful thumbnail url (I also add token and tried to use this later, in case it was needed)
# --- START forming thumbnail url ---
{% set nest_camera_id = 'zzzzzzzzzzzz' %}
{% set nest_event_id_attr = state_attr(event_entity_id, 'nest_event_id') %}
{% set nest_camera_access_token = state_attr(camera_entity_id, 'access_token') %}
# --- Get API event id --- (in one example, the output of
{% set api_event_id = none %}
{% if nest_event_id_attr is list and nest_event_id_attr | length > 0 %}
{% set api_event_id = nest_event_id_attr[0] %}
{% elif nest_event_id_attr is string %}
{% set api_event_id = nest_event_id_attr %}
{% endif %}
# --- Construct URL ---
{% if nest_camera_id and api_event_id and nest_camera_access_token %}
/api/nest/event_media/{{ nest_camera_id }}/{{ api_event_id }}/thumbnail
?token={{nest_camera_access_token}}
{% else %}
{{ state_attr(camera_entity_id, 'entity_picture') }} {# Fallback to default entity picture #}
{% endif %}
# --- END forming thumbnail url ---
Confirm Thumbnail URL
Using Google Nest - Home Assistant
I create this automation.
alias: "Camera Snapshot: Front Doorbell Download"
description: ""
triggers:
- device_id: zzzzzzzzzzzz
domain: nest
type: camera_motion
trigger: device
conditions: []
actions:
- parallel:
- action: notify.mobile_app_pixel_9_pro
data:
data:
image: "{{ trigger.event.data.attachment.image }}"
title: Motion is detected
message: Motion From Cameras
mode: single
we can also verify this works using traces, and the notification on the phone itself. This demonstrate that it is possible to get the picture.
and the traces show:
Executed: April 7, 2025 at 7:56:55 AM
Result:
params:
domain: notify
service: mobile_app_pixel_9_pro
service_data:
data:
image: >-
/api/nest/event_media/zzzzzzzzzzzz/actual_event_id_here/thumbnail
title: Motion is detected
message: Motion From Cameras
target: {}
running_script: false
Also proving that the thumbnails are well formed and correct.
Creating the cards
type: vertical-stack
cards:
- show_state: true
show_name: true
camera_view: auto
type: picture-entity
entity: camera.front_doorbell
image: >-
/api/nest/event_media/zzzzzzzzzzzz/actual_even_id_here/thumbnail
- camera_view: auto
type: picture-glance
title: Front Doorbell Camera
image: >-
/api/nest/event_media/zzzzzzzzzzzz/actual_even_id_here/thumbnail
entities:
- sensor.sun_next_dawn # this is irrelevant just space holder
- sensor.sun_next_dusk # this is irrelevant just space holder
entity: camera.front_doorbell
I’ve tried numerous event_id and still the cards show blank:
Questions
1- Is there an integration that could allow me to take
/api/nest/event_media/zzzzzzzzzzzz/actual_even_id_here/thumbnail
and save it to /config/www/zzzzzzzzzzzz/latest.png? maybe so I can use that for the thumbnails?
2- Is there a better way of getting these camera ids other than creating an automation and manually getting the id.
3- please if you’ve successfully done this, would you explain to me what I’m doing wrong?