Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "trace": {
- "last_step": "action/3/choose/0/sequence/0",
- "run_id": "9970b418fd2d860534b34844a3ca585c",
- "state": "stopped",
- "script_execution": "error",
- "timestamp": {
- "start": "2025-01-17T07:02:48.274637+00:00",
- "finish": "2025-01-17T07:02:57.786860+00:00"
- },
- "domain": "automation",
- "item_id": "1737051285466",
- "error": "Failed to fetch frigate clip 1737097362.006253-nyg2dk",
- "trigger": "mqtt topic frigate/events",
- "trace": {
- "trigger/0": [
- {
- "path": "trigger/0",
- "timestamp": "2025-01-17T07:02:48.275779+00:00",
- "changed_variables": {
- "this": {
- "entity_id": "automation.ai_event_summary_llm_vision_v1_3_5_2",
- "state": "on",
- "attributes": {
- "id": "1737051285466",
- "last_triggered": "2025-01-17T06:46:12.441505+00:00",
- "mode": "single",
- "current": 0,
- "friendly_name": "AI Event Summary (LLM Vision v1.3.5)"
- },
- "last_changed": "2025-01-17T07:02:04.123664+00:00",
- "last_reported": "2025-01-17T07:02:04.123664+00:00",
- "last_updated": "2025-01-17T07:02:04.123664+00:00",
- "context": {
- "id": "01JHSH39JVFA5XXZ4A56CDQGQ1",
- "parent_id": null,
- "user_id": null
- }
- },
- "trigger": {
- "id": "frigate_trigger",
- "idx": "0",
- "alias": null,
- "platform": "mqtt",
- "topic": "frigate/events",
- "payload": "{\"before\": {\"id\": \"1737097362.006253-nyg2dk\", \"camera\": \"carport\", \"frame_time\": 1737097362.006253, \"snapshot\": {\"frame_time\": 1737097363.179588, \"box\": [391, 35, 584, 121], \"area\": 16598, \"region\": [358, 15, 894, 551], \"score\": 0.76953125, \"attributes\": []}, \"label\": \"car\", \"sub_label\": null, \"top_score\": 0.72265625, \"false_positive\": false, \"start_time\": 1737097362.006253, \"end_time\": null, \"score\": 0.76953125, \"box\": [391, 35, 584, 121], \"area\": 16598, \"ratio\": 2.244186046511628, \"region\": [358, 15, 894, 551], \"stationary\": false, \"motionless_count\": 0, \"position_changes\": 0, \"current_zones\": [\"straat\"], \"entered_zones\": [\"straat\"], \"has_clip\": false, \"has_snapshot\": false, \"attributes\": {}, \"current_attributes\": []}, \"after\": {\"id\": \"1737097362.006253-nyg2dk\", \"camera\": \"carport\", \"frame_time\": 1737097362.006253, \"snapshot\": {\"frame_time\": 1737097363.179588, \"box\": [391, 35, 584, 121], \"area\": 16598, \"region\": [358, 15, 894, 551], \"score\": 0.76953125, \"attributes\": []}, \"label\": \"car\", \"sub_label\": null, \"top_score\": 0.72265625, \"false_positive\": false, \"start_time\": 1737097362.006253, \"end_time\": 1737097366.191982, \"score\": 0.76953125, \"box\": [391, 35, 584, 121], \"area\": 16598, \"ratio\": 2.244186046511628, \"region\": [358, 15, 894, 551], \"stationary\": false, \"motionless_count\": 0, \"position_changes\": 0, \"current_zones\": [\"straat\"], \"entered_zones\": [\"straat\"], \"has_clip\": false, \"has_snapshot\": false, \"attributes\": {}, \"current_attributes\": []}, \"type\": \"end\"}",
- "qos": 0,
- "description": "mqtt topic frigate/events",
- "payload_json": {
- "before": {
- "id": "1737097362.006253-nyg2dk",
- "camera": "carport",
- "frame_time": 1737097362.006253,
- "snapshot": {
- "frame_time": 1737097363.179588,
- "box": [
- 391,
- 35,
- 584,
- 121
- ],
- "area": 16598,
- "region": [
- 358,
- 15,
- 894,
- 551
- ],
- "score": 0.76953125,
- "attributes": []
- },
- "label": "car",
- "sub_label": null,
- "top_score": 0.72265625,
- "false_positive": false,
- "start_time": 1737097362.006253,
- "end_time": null,
- "score": 0.76953125,
- "box": [
- 391,
- 35,
- 584,
- 121
- ],
- "area": 16598,
- "ratio": 2.244186046511628,
- "region": [
- 358,
- 15,
- 894,
- 551
- ],
- "stationary": false,
- "motionless_count": 0,
- "position_changes": 0,
- "current_zones": [
- "straat"
- ],
- "entered_zones": [
- "straat"
- ],
- "has_clip": false,
- "has_snapshot": false,
- "attributes": {},
- "current_attributes": []
- },
- "after": {
- "id": "1737097362.006253-nyg2dk",
- "camera": "carport",
- "frame_time": 1737097362.006253,
- "snapshot": {
- "frame_time": 1737097363.179588,
- "box": [
- 391,
- 35,
- 584,
- 121
- ],
- "area": 16598,
- "region": [
- 358,
- 15,
- 894,
- 551
- ],
- "score": 0.76953125,
- "attributes": []
- },
- "label": "car",
- "sub_label": null,
- "top_score": 0.72265625,
- "false_positive": false,
- "start_time": 1737097362.006253,
- "end_time": 1737097366.191982,
- "score": 0.76953125,
- "box": [
- 391,
- 35,
- 584,
- 121
- ],
- "area": 16598,
- "ratio": 2.244186046511628,
- "region": [
- 358,
- 15,
- 894,
- 551
- ],
- "stationary": false,
- "motionless_count": 0,
- "position_changes": 0,
- "current_zones": [
- "straat"
- ],
- "entered_zones": [
- "straat"
- ],
- "has_clip": false,
- "has_snapshot": false,
- "attributes": {},
- "current_attributes": []
- },
- "type": "end"
- }
- },
- "important": false,
- "cooldown": 3,
- "mode": "Frigate",
- "preview_mode": "Live Preview",
- "notify_devices": [
- "fc09b85210964bc72cea4945f98cbdd9"
- ],
- "device_name_map": [
- "mobile_app_iphone_14_pro_max"
- ],
- "camera_entities_list": [
- "camera.carport",
- "camera.192_168_0_194"
- ],
- "object_types_list": [],
- "motion_sensors_list": [],
- "camera_entity": "carport",
- "tag": "carport1737097368",
- "group": "carport",
- "label": "Car seen",
- "camera": "Carport",
- "video": "/api/frigate/notifications/1737097362.006253-nyg2dk/clip.mp4",
- "image": "''",
- "importance_prompt": "Your job is to classify security events based on cctv footage. Your options: \"passive\" if an event seems unimportant, \"time-sensitive\" if important and \"critical\" for suspicious events. Use \"critical\" only for possible burglaries and similar events. \"time-sensitive\" could be a courier at the front door or an event of similar importance. Reply with these replies exactly.\n"
- }
- }
- ],
- "condition/0": [
- {
- "path": "condition/0",
- "timestamp": "2025-01-17T07:02:48.275822+00:00",
- "result": {
- "result": true,
- "entities": []
- }
- }
- ],
- "action/0": [
- {
- "path": "action/0",
- "timestamp": "2025-01-17T07:02:48.276490+00:00",
- "changed_variables": {
- "context": {
- "id": "01JHSH4MPJ3R0RJM6RXVMJM62H",
- "parent_id": null,
- "user_id": null
- }
- }
- }
- ],
- "action/0/choose/0": [
- {
- "path": "action/0/choose/0",
- "timestamp": "2025-01-17T07:02:48.276677+00:00",
- "result": {
- "result": false
- }
- }
- ],
- "action/0/choose/0/conditions/0": [
- {
- "path": "action/0/choose/0/conditions/0",
- "timestamp": "2025-01-17T07:02:48.276724+00:00",
- "result": {
- "result": false,
- "entities": []
- }
- }
- ],
- "action/1": [
- {
- "path": "action/1",
- "timestamp": "2025-01-17T07:02:48.276951+00:00"
- }
- ],
- "action/1/choose/0": [
- {
- "path": "action/1/choose/0",
- "timestamp": "2025-01-17T07:02:48.277081+00:00",
- "result": {
- "result": false
- }
- }
- ],
- "action/1/choose/0/conditions/0": [
- {
- "path": "action/1/choose/0/conditions/0",
- "timestamp": "2025-01-17T07:02:48.277117+00:00",
- "result": {
- "result": false,
- "entities": []
- }
- }
- ],
- "action/2": [
- {
- "path": "action/2",
- "timestamp": "2025-01-17T07:02:48.277304+00:00",
- "result": {
- "choice": 0
- }
- }
- ],
- "action/2/choose/0": [
- {
- "path": "action/2/choose/0",
- "timestamp": "2025-01-17T07:02:48.277433+00:00",
- "result": {
- "result": true
- }
- }
- ],
- "action/2/choose/0/conditions/0": [
- {
- "path": "action/2/choose/0/conditions/0",
- "timestamp": "2025-01-17T07:02:48.277472+00:00",
- "result": {
- "result": true,
- "entities": []
- }
- }
- ],
- "action/2/choose/0/sequence/0": [
- {
- "path": "action/2/choose/0/sequence/0",
- "timestamp": "2025-01-17T07:02:48.277811+00:00"
- }
- ],
- "action/2/choose/0/sequence/0/repeat/sequence/0": [
- {
- "path": "action/2/choose/0/sequence/0/repeat/sequence/0",
- "timestamp": "2025-01-17T07:02:48.278163+00:00",
- "changed_variables": {
- "repeat": {
- "first": true,
- "index": 1,
- "last": true,
- "item": "mobile_app_iphone_14_pro_max"
- }
- },
- "result": {
- "params": {
- "domain": "notify",
- "service": "mobile_app_iphone_14_pro_max",
- "service_data": {
- "title": "Car seen",
- "message": "Carport",
- "data": {
- "video": "/api/frigate/notifications/1737097362.006253-nyg2dk/clip.mp4",
- "image": "''",
- "entity_id": "",
- "url": "/lovelace/0",
- "clickAction": "/lovelace/0",
- "tag": "carport1737097368",
- "group": "carport",
- "interruption-level": "active"
- }
- },
- "target": {}
- },
- "running_script": false
- }
- }
- ],
- "action/3": [
- {
- "path": "action/3",
- "timestamp": "2025-01-17T07:02:50.629274+00:00",
- "error": "Failed to fetch frigate clip 1737097362.006253-nyg2dk",
- "result": {
- "choice": 0
- }
- }
- ],
- "action/3/choose/0": [
- {
- "path": "action/3/choose/0",
- "timestamp": "2025-01-17T07:02:50.629488+00:00",
- "result": {
- "result": true
- }
- }
- ],
- "action/3/choose/0/conditions/0": [
- {
- "path": "action/3/choose/0/conditions/0",
- "timestamp": "2025-01-17T07:02:50.629517+00:00",
- "result": {
- "result": true,
- "entities": []
- }
- }
- ],
- "action/3/choose/0/sequence/0": [
- {
- "path": "action/3/choose/0/sequence/0",
- "timestamp": "2025-01-17T07:02:50.629918+00:00",
- "error": "Failed to fetch frigate clip 1737097362.006253-nyg2dk",
- "result": {
- "params": {
- "domain": "llmvision",
- "service": "video_analyzer",
- "service_data": {
- "event_id": "1737097362.006253-nyg2dk",
- "provider": "01JHNHYNWWACM1AADZ8C26BT62",
- "model": "gpt-4o-mini",
- "message": "Summarize what's happening in the camera feed (one sentence max). Don't describe the scene! If there is a person, describe what they're doing and what they look like. If they look like a courier mention that! If nothing is happening, say so.",
- "remember": false,
- "generate_title": false,
- "include_filename": true,
- "max_frames": 3,
- "target_width": 1280,
- "detail": "low",
- "max_tokens": 20,
- "temperature": 0.1
- },
- "target": {}
- },
- "running_script": false
- }
- }
- ]
- },
- "config": {
- "variables": {
- "important": false,
- "cooldown": 3,
- "mode": "Frigate",
- "preview_mode": "Live Preview",
- "notify_devices": [
- "fc09b85210964bc72cea4945f98cbdd9"
- ],
- "device_name_map": "{% set ns = namespace(device_names=[]) %} {% for device_id in notify_devices %}\n {% set device_name = device_attr(device_id, \"name\") %}\n {% set sanitized_name = \"mobile_app_\" + device_name | slugify %}\n {% set ns.device_names = ns.device_names + [sanitized_name] %}\n{% endfor %} {{ ns.device_names }}\n",
- "camera_entities_list": [
- "camera.carport",
- "camera.192_168_0_194"
- ],
- "object_types_list": [],
- "motion_sensors_list": [],
- "camera_entity": "{% if mode == 'Camera' %}\n {% if motion_sensors_list and not \"camera\" in trigger.entity_id %}\n {% set index = motion_sensors_list.index(trigger.entity_id) %}\n {{ camera_entities_list[index] }}\n {% else %}\n {{ trigger.entity_id }}\n {% endif %}\n{% else %}\n {{ trigger.payload_json['after']['camera'] }}\n{% endif %}\n",
- "tag": "{% if mode == 'Frigate' %}\n {{ trigger.payload_json['after']['camera'] + int(as_timestamp(now()))|string }}\n{% else %}\n {{ camera_entity + int(as_timestamp(now()))|string }}\n{% endif %}\n",
- "group": "{% if mode == 'Frigate' %}\n {{ trigger.payload_json['after']['camera'] }}\n{% else %}\n {{ camera_entity }}\n{% endif %}\n",
- "label": "{% if mode == 'Frigate' %}\n {{ trigger.payload_json['after']['label']|capitalize }} seen\n{% else %}\n Motion detected\n{% endif %}\n",
- "camera": "{% if mode == 'Frigate' %}\n {{ trigger.payload_json['after']['camera'].replace('_', ' ')|capitalize }}\n{% else %}\n {{ camera_entity.replace(\"camera.\", \"\").replace(\"_\", \" \")|capitalize }}\n{% endif %}\n",
- "video": "{% if mode == 'Frigate' %}\n /api/frigate/notifications/{{ trigger.payload_json['after']['id'] }}/clip.mp4\n{% else %} {% endif %}\n",
- "image": "{% if mode == 'Frigate' %}\n ''\n{% else %}\n {% if preview_mode == 'Live Preview' %}\n {{ '/api/camera_proxy/' + camera_entity }}\n {% else %}\n /local/llmvision/{{camera_entity.replace(\"camera.\", \"\")}}_0.jpg\n {% endif %}\n{% endif %}\n",
- "importance_prompt": "Your job is to classify security events based on cctv footage. Your options: \"passive\" if an event seems unimportant, \"time-sensitive\" if important and \"critical\" for suspicious events. Use \"critical\" only for possible burglaries and similar events. \"time-sensitive\" could be a courier at the front door or an event of similar importance. Reply with these replies exactly.\n"
- },
- "max_exceeded": "silent",
- "mode": "single",
- "triggers": [
- {
- "platform": "mqtt",
- "topic": "frigate/events",
- "id": "frigate_trigger"
- },
- {
- "platform": "state",
- "entity_id": [
- "camera.carport",
- "camera.192_168_0_194"
- ],
- "to": "recording",
- "id": "camera_trigger"
- },
- {
- "platform": "state",
- "entity_id": [],
- "to": "on",
- "id": "motion_sensor_trigger"
- }
- ],
- "conditions": [
- {
- "condition": "template",
- "value_template": "{% if mode == 'Frigate' %}\n {{ trigger.payload_json[\"type\"] == \"end\"\n and ('camera.' + trigger.payload_json['after']['camera']|lower) in camera_entities_list\n and ((object_types_list|length) == 0 or ((trigger.payload_json['after']['label']|lower) in object_types_list))\n }}\n{%else%}\n true\n{% endif %}\n"
- }
- ],
- "actions": [
- {
- "choose": [
- {
- "conditions": [
- {
- "condition": "template",
- "value_template": "{{ important }}"
- }
- ],
- "sequence": [
- {
- "alias": "Decide Important",
- "choose": [
- {
- "conditions": [
- {
- "condition": "template",
- "value_template": "{{ mode == 'Frigate'}}"
- }
- ],
- "sequence": [
- {
- "action": "llmvision.image_analyzer",
- "data": {
- "image_entity": "{{ ['camera.' + trigger.payload_json['after']['camera']|lower] }}",
- "provider": "01JHNHYNWWACM1AADZ8C26BT62",
- "model": "gpt-4o-mini",
- "message": "{{importance_prompt}}",
- "include_filename": true,
- "target_width": 1280,
- "detail": "low",
- "max_tokens": 3,
- "temperature": 0.1
- },
- "response_variable": "importance"
- }
- ]
- },
- {
- "conditions": [
- {
- "condition": "template",
- "value_template": "{{ mode == 'Camera' }}"
- }
- ],
- "sequence": [
- {
- "action": "llmvision.image_analyzer",
- "data": {
- "image_entity": "{{[camera_entity]}}",
- "provider": "01JHNHYNWWACM1AADZ8C26BT62",
- "model": "gpt-4o-mini",
- "message": "{{importance_prompt}}",
- "include_filename": true,
- "target_width": 1280,
- "detail": "low",
- "max_tokens": 3,
- "temperature": 0.1
- },
- "response_variable": "importance"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "choose": [
- {
- "conditions": [
- {
- "condition": "template",
- "value_template": "{{ importance is defined and importance.response_text|lower == 'passive' }}"
- }
- ],
- "sequence": [
- {
- "stop": "Event is not important"
- }
- ]
- }
- ]
- },
- {
- "choose": [
- {
- "conditions": [
- {
- "condition": "template",
- "value_template": "{{ image != '' or video != '' }}"
- }
- ],
- "sequence": [
- {
- "alias": "Send instant notification to notify devices",
- "repeat": {
- "for_each": "{{device_name_map}}",
- "sequence": [
- {
- "action": "notify.{{ repeat.item }}",
- "data": {
- "title": "{{ label }}",
- "message": "{{camera}}",
- "data": {
- "video": "{{video if video != '' else None}}",
- "image": "{{image if image != '' else None}}",
- "entity_id": "{{camera_entity if mode=='Camera' and preview_mode=='Live Preview'}}",
- "url": "/lovelace/0",
- "clickAction": "/lovelace/0",
- "tag": "{{tag}}",
- "group": "{{group}}",
- "interruption-level": "{{importance.response_text|lower if importance is defined else 'active'}}"
- }
- }
- }
- ]
- }
- }
- ]
- }
- ]
- },
- {
- "alias": "Analyze event",
- "choose": [
- {
- "conditions": [
- {
- "condition": "template",
- "value_template": "{{ mode == 'Frigate' }}"
- }
- ],
- "sequence": [
- {
- "action": "llmvision.video_analyzer",
- "data": {
- "event_id": "{{ trigger.payload_json['after']['id'] }}",
- "provider": "01JHNHYNWWACM1AADZ8C26BT62",
- "model": "gpt-4o-mini",
- "message": "Summarize what's happening in the camera feed (one sentence max). Don't describe the scene! If there is a person, describe what they're doing and what they look like. If they look like a courier mention that! If nothing is happening, say so.",
- "remember": false,
- "generate_title": false,
- "include_filename": true,
- "max_frames": 3,
- "target_width": 1280,
- "detail": "low",
- "max_tokens": 20,
- "temperature": 0.1
- },
- "response_variable": "response"
- }
- ]
- },
- {
- "conditions": [
- {
- "condition": "template",
- "value_template": "{{ mode == 'Camera' }}"
- }
- ],
- "sequence": [
- {
- "action": "llmvision.stream_analyzer",
- "data": {
- "image_entity": "{{[camera_entity]}}",
- "duration": 5,
- "provider": "01JHNHYNWWACM1AADZ8C26BT62",
- "model": "gpt-4o-mini",
- "message": "Summarize what's happening in the camera feed (one sentence max). Don't describe the scene! If there is a person, describe what they're doing and what they look like. If they look like a courier mention that! If nothing is happening, say so.",
- "remember": false,
- "generate_title": false,
- "include_filename": true,
- "max_frames": 3,
- "target_width": 1280,
- "detail": "low",
- "max_tokens": 20,
- "temperature": 0.1,
- "expose_images": "{{true if preview_mode == 'Snapshot'}}"
- },
- "response_variable": "response"
- }
- ]
- }
- ]
- },
- {
- "choose": [
- {
- "conditions": [
- {
- "condition": "template",
- "value_template": "{{ image != '' or video != '' }}"
- }
- ],
- "sequence": [
- {
- "alias": "Send instant notification to notify devices",
- "repeat": {
- "for_each": "{{device_name_map}}",
- "sequence": [
- {
- "action": "notify.{{ repeat.item }}",
- "data": {
- "title": "{{ label }}",
- "message": "{{response.response_text}}",
- "data": {
- "video": "{{video if video != '' else None}}",
- "image": "{{image if image != '' else None}}",
- "entity_id": "{{camera_entity if mode=='Camera' and preview_mode=='Live Preview'}}",
- "url": "/lovelace/0",
- "clickAction": "/lovelace/0",
- "tag": "{{tag}}",
- "group": "{{group}}",
- "interruption-level": "passive"
- }
- }
- }
- ]
- }
- }
- ]
- }
- ]
- },
- {
- "delay": "00:{{cooldown|int}}:00"
- }
- ],
- "id": "1737051285466",
- "alias": "AI Event Summary (LLM Vision v1.3.5)",
- "description": ""
- },
- "blueprint_inputs": {
- "id": "1737051285466",
- "alias": "AI Event Summary (LLM Vision v1.3.5)",
- "description": "",
- "use_blueprint": {
- "path": "valentinfrlch/event_summary.yaml",
- "input": {
- "mode": "Frigate",
- "notify_device": [
- "fc09b85210964bc72cea4945f98cbdd9"
- ],
- "camera_entities": [
- "camera.carport",
- "camera.192_168_0_194"
- ],
- "object_type": [],
- "cooldown": 3,
- "provider": "01JHNHYNWWACM1AADZ8C26BT62",
- "preview_mode": "Live Preview"
- }
- }
- },
- "context": {
- "id": "01JHSH4MPJ3R0RJM6RXVMJM62H",
- "parent_id": null,
- "user_id": null
- }
- },
- "logbookEntries": [
- {
- "name": "AI Event Summary (LLM Vision v1.3.5)",
- "message": "triggered by mqtt topic frigate/events",
- "source": "mqtt topic frigate/events",
- "entity_id": "automation.ai_event_summary_llm_vision_v1_3_5_2",
- "context_id": "01JHSH4MPJ3R0RJM6RXVMJM62H",
- "domain": "automation",
- "when": 1737097368.2760007
- }
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment