From 7b81ed32bc9f5484047748743e124444c0ee0c83 Mon Sep 17 00:00:00 2001 From: valentinfrlch Date: Sun, 26 Jan 2025 09:23:48 +0100 Subject: [PATCH] Upgrade blueprint to v1.3.7 --- blueprints/event_summary.yaml | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/blueprints/event_summary.yaml b/blueprints/event_summary.yaml index d7420cb..ad51825 100644 --- a/blueprints/event_summary.yaml +++ b/blueprints/event_summary.yaml @@ -1,5 +1,5 @@ blueprint: - name: AI Event Summary (LLM Vision v1.3.5) + name: AI Event Summary (LLM Vision v1.3.7) author: valentinfrlch description: > AI-powered security event summaries for frigate or camera entities. @@ -52,6 +52,16 @@ blueprint: multiple: true filter: domain: camera + required_zones: + name: Required Zone(s) + description: >- + (Frigate mode only) + Only run if the Frigate event occurs within the specified zones (e.g., Driveway, Entry, etc.) + default: [] + selector: + text: + multiline: false + multiple: true object_type: name: Included Object Type(s) description: >- @@ -63,6 +73,15 @@ blueprint: text: multiline: false multiple: true + ignore_stationary: + name: Ignore Stationary Objects + description: >- + (Frigate mode only) + + Does not alert if objects are detected as stationary by Frigate. + default: true + selector: + boolean: trigger_state: name: Trigger State description: >- @@ -208,11 +227,13 @@ variables: {% endfor %} {{ ns.device_names }} camera_entities_list: !input camera_entities + required_zones_list: !input required_zones object_types_list: !input object_type + ignore_stationary: !input ignore_stationary motion_sensors_list: !input motion_sensors camera_entity: > {% if mode == 'Camera' %} - {% if motion_sensors_list and not "camera" in trigger.entity_id %} + {% if motion_sensors_list and not trigger.entity_id.startswith("camera") %} {% set index = motion_sensors_list.index(trigger.entity_id) %} {{ camera_entities_list[index] }} {% else %} @@ -265,13 +286,13 @@ variables: Reply with these replies exactly. max_exceeded: silent - mode: single trigger: - platform: mqtt topic: "frigate/events" id: frigate_trigger + enabled: "{{mode == 'Frigate'}}" - platform: 'state' entity_id: !input camera_entities to: !input trigger_state @@ -288,8 +309,10 @@ condition: {{ trigger.payload_json["type"] == "end" and ('camera.' + trigger.payload_json['after']['camera']|lower) in camera_entities_list and ((object_types_list|length) == 0 or ((trigger.payload_json['after']['label']|lower) in object_types_list)) + and (not required_zones_list or ((set(trigger.payload_json['after']['current_zones']).intersection(required_zones_list)))) + and not (ignore_stationary and trigger.payload_json['after']['stationary']) }} - {%else%} + {% else %} true {% endif %}