Skip to content

Instantly share code, notes, and snippets.

@peyanski
Created August 20, 2025 06:50
Show Gist options
  • Save peyanski/6faa32027e4b48c805228b7a7eaba708 to your computer and use it in GitHub Desktop.
Save peyanski/6faa32027e4b48c805228b7a7eaba708 to your computer and use it in GitHub Desktop.
template:
- trigger:
- trigger: homeassistant
event: start
- trigger: time_pattern
minutes: "/5" # update every 5 minutes
actions:
- action: ai_task.generate_data
data:
task_name: "People count"
instructions: >-
Analyze the attached image. How many people are visible in the image?
structure:
people:
selector:
number:
attachments:
media_content_id: media-source://media_source/local/7me.jpg
media_content_type: image/jpeg
response_variable: result
sensor:
- name: "People Count"
state: "{{ result.data.people }}"
state_class: total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment