Hi everyone,
I am encountering an issue with the Google Generative AI integration in Home Assistant. When executing scripts, I receive the following error:
text
Error generating content: 429 Quota exceeded for quota metric 'Generate Content API requests per minute' and limit 'GenerateContent request limit per minute for a region' of service 'generativelanguage.googleapis.com'.
Here’s what I’ve tried so far:
Verified my billing details and confirmed that I haven’t exceeded my quota.
Checked the Google Cloud Console for quota usage.
Attempted to manually rate-limit requests, but the issue persists.
Has anyone faced a similar problem or found a solution? Any guidance would be appreciated!
Here is my script
alias: Video Doorbell Snapshot, Generative AI & Notification
sequence:
- condition: template
value_template: >-
{{ ( as_timestamp(now()) -
as_timestamp(state_attr('automation.video_doorbell_motion_ai_snapshot_notification',
'last_triggered')) | int(0) > 59 )}}
- alias: 1st Snapshot
metadata: {}
data:
filename: ./www/snapshots/video_doorbell_snapshot1.jpg
enabled: true
action: camera.snapshot
target:
entity_id: camera.video_doorbell_fluent
- alias: 1st Delay
delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 500
enabled: true
- alias: 2nd Snapshot
metadata: {}
data:
filename: ./www/snapshots/video_doorbell_snapshot2.jpg
enabled: true
target:
entity_id:
- camera.video_doorbell_fluent
action: camera.snapshot
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 500
alias: 2nd Delay
enabled: true
- alias: 3rd Snapshot
metadata: {}
data:
filename: ./www/snapshots/video_doorbell_snapshot3.jpg
enabled: true
target:
entity_id:
- camera.video_doorbell_fluent
action: camera.snapshot
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 500
alias: 3rd Delay
enabled: true
- metadata: {}
data:
prompt: >-
Motion has been detected, compare and very briefly describe what you see
in the following sequence of images from my video doorbell. What do you
think caused the motion alarm? If a person or car is present, describe
them in detail. Do not describe stationary objects or buildings. If you
see no obvious causes of motion, reply with "Camera has detected motion
however no obvious motion observed comparing snapshots". Your message
needs to be short enough to fit in a phone notification
image_filename:
- ./www/snapshots/video_doorbell_snapshot1.jpg
- ./www/snapshots/video_doorbell_snapshot2.jpg
- ./www/snapshots/video_doorbell_snapshot3.jpg
response_variable: generated_content
action: google_generative_ai_conversation.generate_content
- if:
- condition: template
value_template: |-
{{ generated_content['text'] == ' Camera has detected motion however
no obvious motion observed comparing snapshots.' }}
then:
- stop: ""
else:
- metadata: {}
data:
title: Video Doorbell
message: "\"{{ generated_content['text'] }}\""
data:
image: /local/snapshots/video_doorbell_snapshot2.jpg
action: notify.mobile_app_brads_phone
- delay: 60
mode: single
fields: {}
icon: mdi:cctv
description: ""
max_exceeded: silent
1 post - 1 participant