mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 18:40:14 -04:00
initial push
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
alias: Frigate Notification Testing
|
||||
id: automation_frigate_notification_testing
|
||||
mode: single
|
||||
max_exceeded: silent
|
||||
|
||||
trigger:
|
||||
platform: mqtt
|
||||
topic: frigate/events
|
||||
|
||||
condition:
|
||||
- condition: or
|
||||
conditions:
|
||||
- "{{ 'driveway' in trigger.payload_json['after']['entered_zones'] }}"
|
||||
- "{{ 'from_street' in trigger.payload_json['after']['entered_zones'] }}"
|
||||
- "{{ trigger.payload_json['after']['label'] == 'person' }}"
|
||||
|
||||
action:
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- "{{ 'driveway' in trigger.payload_json['after']['entered_zones'] }}"
|
||||
- "{{ 'from_street' in trigger.payload_json['after']['entered_zones'] }}"
|
||||
- "{{ trigger.payload_json['after']['top_score'] > 0.80 }}"
|
||||
- "{{ not 'garage' in trigger.payload_json['before']['current_zones'] }}"
|
||||
sequence:
|
||||
- service: notify.mobile_app_pixel_7
|
||||
data_template:
|
||||
message: 'A {{trigger.payload_json["after"]["label"]}} entered the driveway.'
|
||||
data:
|
||||
image: 'https://automation.clintweaver.com/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}/thumbnail.jpg?format=android'
|
||||
tag: '{{trigger.payload_json["after"]["id"]}}'
|
||||
when: '{{trigger.payload_json["after"]["start_time"]|int}}'
|
||||
|
||||
- delay: '00:00:05'
|
||||
@@ -0,0 +1,151 @@
|
||||
id: automation_frigate_person_back_yard
|
||||
alias: Frigate Person Back Yard
|
||||
description: "Fire a notification if a person is detected by Frigate in the back yard"
|
||||
mode: single
|
||||
max_exceeded: silent
|
||||
trigger:
|
||||
platform: mqtt
|
||||
topic: frigate/events
|
||||
payload: frigate_cam14
|
||||
value_template: "{{ value_json['after']['camera'] }}"
|
||||
variables:
|
||||
id: "{{ trigger.payload_json['after']['id'] }}"
|
||||
camera: "{{ trigger.payload_json['after']['camera'] }}"
|
||||
camera_name: "{{ camera | replace('_', ' ') | title }}"
|
||||
object: "{{ trigger.payload_json['after']['label'] }}"
|
||||
label: "{{ object | title }}"
|
||||
entered_zones: "{{ trigger.payload_json['after']['entered_zones'] }}"
|
||||
type: "{{ trigger.payload_json['type'] }}"
|
||||
base_url: https://automation.clintweaver.com
|
||||
group_target: ""
|
||||
zone_only: false
|
||||
input_zones:
|
||||
- front_porch
|
||||
- driveway
|
||||
zones: "{{ input_zones | list }}"
|
||||
input_labels:
|
||||
- person
|
||||
labels: "{{ input_labels | list }}"
|
||||
presence_entity: person.clint
|
||||
condition:
|
||||
- "{{ type != 'end' }}"
|
||||
- "{{ not zone_only or entered_zones|length > 0 }}"
|
||||
- "{{ not zones|length or zones|select('in', entered_zones)|list|length > 0 }}"
|
||||
- "{{ not labels|length or object in labels }}"
|
||||
#- "{{ not presence_entity or not is_state(presence_entity, 'home') }}"
|
||||
- '{{ is_state("binary_sensor.garage_door","off") }}'
|
||||
- '{{ is_state("binary_sensor.outer_garage_door","off") }}'
|
||||
- '{{ is_state("binary_sensor.front_door_contact","off") }}'
|
||||
- '{{ is_state("binary_sensor.patio_door_contact","off") }}'
|
||||
action:
|
||||
- choose:
|
||||
- conditions: "{{ not group_target }}"
|
||||
sequence:
|
||||
- device_id: 70c62eb366d6ed914b0ccc6bf41c32fd
|
||||
domain: mobile_app
|
||||
type: notify
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: "{{ id }}"
|
||||
group: frigate-notification-{{ camera }}
|
||||
image: /api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
|
||||
- service: persistent_notification.create
|
||||
data:
|
||||
title: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
message: 'A {{ label }} was detected on the {{ camera_name }} camera. '
|
||||
notification_id: "{{ id }}"
|
||||
default:
|
||||
- service: notify.{{ group_target }}
|
||||
data:
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: "{{ id }}"
|
||||
group: frigate-notification-{{ camera }}
|
||||
image: /api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
- repeat:
|
||||
sequence:
|
||||
- wait_for_trigger:
|
||||
- platform: mqtt
|
||||
topic: frigate/events
|
||||
payload: "{{ id }}"
|
||||
value_template: "{{ value_json['after']['id'] }}"
|
||||
timeout:
|
||||
minutes: 2
|
||||
continue_on_timeout: false
|
||||
- condition: template
|
||||
value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}"
|
||||
- choose:
|
||||
- conditions: "{{ not group_target }}"
|
||||
sequence:
|
||||
- device_id: 70c62eb366d6ed914b0ccc6bf41c32fd
|
||||
domain: mobile_app
|
||||
type: notify
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: "{{ id }}"
|
||||
group: frigate-notification-{{ camera }}
|
||||
url: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
clickAction: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
image: >-
|
||||
/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
sound: none
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
actions:
|
||||
- action: URI
|
||||
title: View Clip
|
||||
uri: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
- action: URI
|
||||
title: View Snapshot
|
||||
uri: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg
|
||||
- action: silence-{{ camera }}
|
||||
title: Silence Notifications
|
||||
destructive: true
|
||||
default:
|
||||
- service: notify.{{ group_target }}
|
||||
data:
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: "{{ id }}"
|
||||
group: frigate-notification-{{ camera }}
|
||||
url: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
clickAction: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
image: >-
|
||||
/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
sound: none
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
actions:
|
||||
- action: URI
|
||||
title: View Clip
|
||||
uri: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
- action: URI
|
||||
title: View Snapshot
|
||||
uri: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg
|
||||
- action: silence-{{ camera }}
|
||||
title: Silence Notifications
|
||||
destructive: true
|
||||
until: "{{ wait.trigger.payload_json['type'] == 'end' }}"
|
||||
- wait_for_trigger:
|
||||
- platform: event
|
||||
event_type: mobile_app_notification_action
|
||||
event_data:
|
||||
action: silence-{{ camera }}
|
||||
timeout:
|
||||
seconds: 30
|
||||
continue_on_timeout: false
|
||||
- delay:
|
||||
minutes: 30
|
||||
@@ -0,0 +1,159 @@
|
||||
id: "automation_frigate_person_from_street"
|
||||
alias: Frigate Person From Street
|
||||
description: "Fire a notification if a person is detected by Frigate coming towards the house from the street"
|
||||
mode: single
|
||||
max_exceeded: silent
|
||||
trigger:
|
||||
platform: mqtt
|
||||
topic: frigate/events
|
||||
payload: new
|
||||
value_template: "{{ value_json.type }}"
|
||||
|
||||
variables:
|
||||
id: "{{ trigger.payload_json['after']['id'] }}"
|
||||
camera: "{{ trigger.payload_json['after']['camera'] }}"
|
||||
camera_name: "{{ camera | replace('_', ' ') | title }}"
|
||||
object: "{{ trigger.payload_json['after']['label'] }}"
|
||||
label: "{{ object | title }}"
|
||||
entered_zones: "{{ trigger.payload_json['after']['entered_zones'] }}"
|
||||
type: "{{ trigger.payload_json['type'] }}"
|
||||
stationary: "{{ trigger.payload_json['after']['stationary'] }}"
|
||||
base_url: https://automation.clintweaver.com
|
||||
group_target: ""
|
||||
zone_only: true
|
||||
before_zones:
|
||||
- from_street
|
||||
after_zones:
|
||||
- driveway_center
|
||||
- driveway_east_side
|
||||
- parking_spot
|
||||
input_zones:
|
||||
- from_street
|
||||
zones: "{{ input_zones | list }}"
|
||||
input_labels:
|
||||
- person
|
||||
labels: "{{ input_labels | list }}"
|
||||
presence_entity: person.clint
|
||||
|
||||
condition:
|
||||
- "{{ type != 'end' }}"
|
||||
- "{{ not zone_only or entered_zones|length > 0 }}"
|
||||
- "{{ not stationary }}"
|
||||
- "{{ not zones|length or zones|select('in', entered_zones)|list|length > 0 }}"
|
||||
- "{{ not labels|length or object in labels }}"
|
||||
#- "{{ not presence_entity or not is_state(presence_entity, 'home') }}"
|
||||
#- "{{ not garage_door or not is_state(garage_door, 'on') }}"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions: "{{ not group_target }}"
|
||||
sequence:
|
||||
- device_id: 70c62eb366d6ed914b0ccc6bf41c32fd
|
||||
domain: mobile_app
|
||||
type: notify
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: "{{ id }}"
|
||||
group: frigate-notification-{{ camera }}
|
||||
image: /api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
|
||||
- service: persistent_notification.create
|
||||
data:
|
||||
title: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
message: 'A {{ label }} was detected on the {{ camera_name }} camera. '
|
||||
notification_id: "{{ id }}"
|
||||
default:
|
||||
- service: notify.{{ group_target }}
|
||||
data:
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: "{{ id }}"
|
||||
group: frigate-notification-{{ camera }}
|
||||
image: /api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
- repeat:
|
||||
sequence:
|
||||
- wait_for_trigger:
|
||||
- platform: mqtt
|
||||
topic: frigate/events
|
||||
payload: "{{ id }}"
|
||||
value_template: "{{ value_json['after']['id'] }}"
|
||||
timeout:
|
||||
minutes: 2
|
||||
continue_on_timeout: false
|
||||
- condition: template
|
||||
value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}"
|
||||
- choose:
|
||||
- conditions: "{{ not group_target }}"
|
||||
sequence:
|
||||
- device_id: 70c62eb366d6ed914b0ccc6bf41c32fd
|
||||
domain: mobile_app
|
||||
type: notify
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: "{{ id }}"
|
||||
group: frigate-notification-{{ camera }}
|
||||
url: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
clickAction: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
image: >-
|
||||
/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
sound: none
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
actions:
|
||||
- action: URI
|
||||
title: View Clip
|
||||
uri: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
- action: URI
|
||||
title: View Snapshot
|
||||
uri: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg
|
||||
- action: silence-{{ camera }}
|
||||
title: Silence Notifications
|
||||
destructive: true
|
||||
default:
|
||||
- service: notify.{{ group_target }}
|
||||
data:
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: "{{ id }}"
|
||||
group: frigate-notification-{{ camera }}
|
||||
url: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
clickAction: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
image: >-
|
||||
/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
sound: none
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
actions:
|
||||
- action: URI
|
||||
title: View Clip
|
||||
uri: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
- action: URI
|
||||
title: View Snapshot
|
||||
uri: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg
|
||||
- action: silence-{{ camera }}
|
||||
title: Silence Notifications
|
||||
destructive: true
|
||||
until: "{{ wait.trigger.payload_json['type'] == 'end' }}"
|
||||
- wait_for_trigger:
|
||||
- platform: event
|
||||
event_type: mobile_app_notification_action
|
||||
event_data:
|
||||
action: silence-{{ camera }}
|
||||
timeout:
|
||||
seconds: 30
|
||||
continue_on_timeout: false
|
||||
- delay:
|
||||
minutes: 30
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
id: "1642041485222"
|
||||
alias: Frigate Person Front Porch
|
||||
description: "Fire a notification if a person is detected by Frigate in the front yard"
|
||||
mode: single
|
||||
max_exceeded: silent
|
||||
trigger:
|
||||
platform: mqtt
|
||||
topic: frigate/events
|
||||
payload: frigate_cam19
|
||||
value_template: "{{ value_json['after']['camera'] }}"
|
||||
variables:
|
||||
id: "{{ trigger.payload_json['after']['id'] }}"
|
||||
camera: "{{ trigger.payload_json['after']['camera'] }}"
|
||||
camera_name: "{{ camera | replace('_', ' ') | title }}"
|
||||
object: "{{ trigger.payload_json['after']['label'] }}"
|
||||
label: "{{ object | title }}"
|
||||
entered_zones: "{{ trigger.payload_json['after']['entered_zones'] }}"
|
||||
type: "{{ trigger.payload_json['type'] }}"
|
||||
base_url: https://automation.clintweaver.com
|
||||
group_target: ""
|
||||
zone_only: true
|
||||
input_zones:
|
||||
- front_porch
|
||||
- driveway
|
||||
zones: "{{ input_zones | list }}"
|
||||
input_labels:
|
||||
- person
|
||||
labels: "{{ input_labels | list }}"
|
||||
presence_entity: person.clint
|
||||
condition:
|
||||
- "{{ type != 'end' }}"
|
||||
- "{{ not zone_only or entered_zones|length > 0 }}"
|
||||
- "{{ not zones|length or zones|select('in', entered_zones)|list|length > 0 }}"
|
||||
- "{{ not labels|length or object in labels }}"
|
||||
#- "{{ not presence_entity or not is_state(presence_entity, 'home') }}"
|
||||
- '{{ is_state("binary_sensor.garage_door","off") }}'
|
||||
- '{{ is_state("binary_sensor.outer_garage_door","off") }}'
|
||||
- '{{ is_state("binary_sensor.front_door_contact","off") }}'
|
||||
- '{{ is_state("binary_sensor.patio_door_contact","off") }}'
|
||||
- '{{ is_state("binary_sensor.front_porch_motion","off") }}'
|
||||
- '{{ is_state("binary_sensor.garage_motion_switch_home_security_motion_detection","off") }}'
|
||||
action:
|
||||
- choose:
|
||||
- conditions: "{{ not group_target }}"
|
||||
sequence:
|
||||
- device_id: 70c62eb366d6ed914b0ccc6bf41c32fd
|
||||
domain: mobile_app
|
||||
type: notify
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: "{{ id }}"
|
||||
group: frigate-notification-{{ camera }}
|
||||
image: /api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
|
||||
- service: persistent_notification.create
|
||||
data:
|
||||
title: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
message: 'A {{ label }} was detected on the {{ camera_name }} camera. '
|
||||
notification_id: "{{ id }}"
|
||||
default:
|
||||
- service: notify.{{ group_target }}
|
||||
data:
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: "{{ id }}"
|
||||
group: frigate-notification-{{ camera }}
|
||||
image: /api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
- repeat:
|
||||
sequence:
|
||||
- wait_for_trigger:
|
||||
- platform: mqtt
|
||||
topic: frigate/events
|
||||
payload: "{{ id }}"
|
||||
value_template: "{{ value_json['after']['id'] }}"
|
||||
timeout:
|
||||
minutes: 2
|
||||
continue_on_timeout: false
|
||||
- condition: template
|
||||
value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}"
|
||||
- choose:
|
||||
- conditions: "{{ not group_target }}"
|
||||
sequence:
|
||||
- device_id: 70c62eb366d6ed914b0ccc6bf41c32fd
|
||||
domain: mobile_app
|
||||
type: notify
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: "{{ id }}"
|
||||
group: frigate-notification-{{ camera }}
|
||||
url: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
clickAction: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
image: >-
|
||||
/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
sound: none
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
actions:
|
||||
- action: URI
|
||||
title: View Clip
|
||||
uri: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
- action: URI
|
||||
title: View Snapshot
|
||||
uri: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg
|
||||
- action: silence-{{ camera }}
|
||||
title: Silence Notifications
|
||||
destructive: true
|
||||
default:
|
||||
- service: notify.{{ group_target }}
|
||||
data:
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: "{{ id }}"
|
||||
group: frigate-notification-{{ camera }}
|
||||
url: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
clickAction: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
image: >-
|
||||
/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
sound: none
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
actions:
|
||||
- action: URI
|
||||
title: View Clip
|
||||
uri: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
- action: URI
|
||||
title: View Snapshot
|
||||
uri: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg
|
||||
- action: silence-{{ camera }}
|
||||
title: Silence Notifications
|
||||
destructive: true
|
||||
until: "{{ wait.trigger.payload_json['type'] == 'end' }}"
|
||||
- wait_for_trigger:
|
||||
- platform: event
|
||||
event_type: mobile_app_notification_action
|
||||
event_data:
|
||||
action: silence-{{ camera }}
|
||||
timeout:
|
||||
seconds: 30
|
||||
continue_on_timeout: false
|
||||
- delay:
|
||||
minutes: 30
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
alias: Frigate Vehicle Notification
|
||||
id: automation_frigate_vehicle_notification
|
||||
description: "Fire a notification if a vehicle is detected by Frigate entering the driveway"
|
||||
mode: single
|
||||
max_exceeded: silent
|
||||
|
||||
trigger:
|
||||
platform: mqtt
|
||||
topic: frigate/events
|
||||
payload: new
|
||||
value_template: "{{ value_json.type }}"
|
||||
|
||||
variables:
|
||||
id: "{{ trigger.payload_json['after']['id'] }}"
|
||||
camera: "{{ trigger.payload_json['after']['camera'] }}"
|
||||
camera_name: "{{ camera | replace('_', ' ') | title }}"
|
||||
object: "{{ trigger.payload_json['after']['label'] }}"
|
||||
label: "{{ object | title }}"
|
||||
entered_zones: "{{ trigger.payload_json['after']['entered_zones'] }}"
|
||||
type: "{{ trigger.payload_json['type'] }}"
|
||||
stationary: "{{ trigger.payload_json['after']['stationary'] }}"
|
||||
base_url: https://automation.clintweaver.com
|
||||
group_target: "mobile_app_ticwatch_pro_3_gps"
|
||||
zone_only: true
|
||||
before_zones:
|
||||
- from_street
|
||||
after_zones:
|
||||
- driveway_center
|
||||
- driveway_east_side
|
||||
- parking_spot
|
||||
input_zones:
|
||||
- from_street
|
||||
zones: "{{ input_zones | list }}"
|
||||
input_labels:
|
||||
- vehicle
|
||||
labels: "{{ input_labels | list }}"
|
||||
presence_entity: "device_tracker.chevrolet_mylink"
|
||||
boolean_entity: input_boolean
|
||||
garage_door: binary_sensor.garage_door
|
||||
primary_vehicle: device_tracker.chevrolet_mylink
|
||||
|
||||
condition:
|
||||
- "{{ type != 'end' }}"
|
||||
- "{{ not zone_only or entered_zones|length > 0 }}"
|
||||
- "{{ not stationary }}"
|
||||
- "{{ not zones|length or zones|select('in', entered_zones)|list|length > 0 }}"
|
||||
- "{{ not labels|length or object in labels }}"
|
||||
#- "{{ not presence_entity or not is_state(presence_entity, 'home') }}"
|
||||
#- "{{ not garage_door or not is_state(garage_door, 'on') }}"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions: "{{ not group_target }}"
|
||||
sequence:
|
||||
- device_id: 70c62eb366d6ed914b0ccc6bf41c32fd
|
||||
domain: mobile_app
|
||||
type: notify
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: "{{ id }}"
|
||||
group: frigate-notification-{{ camera }}
|
||||
image: /api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
|
||||
- service: persistent_notification.create
|
||||
data:
|
||||
title: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
message: 'A {{ label }} was detected on the {{ camera_name }} camera. '
|
||||
notification_id: "{{ id }}"
|
||||
default:
|
||||
- service: notify.{{ group_target }}
|
||||
data:
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: "{{ id }}"
|
||||
group: frigate-notification-{{ camera }}
|
||||
image: /api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
- repeat:
|
||||
sequence:
|
||||
- wait_for_trigger:
|
||||
- platform: mqtt
|
||||
topic: frigate/events
|
||||
payload: "{{ id }}"
|
||||
value_template: "{{ value_json['after']['id'] }}"
|
||||
timeout:
|
||||
minutes: 2
|
||||
continue_on_timeout: false
|
||||
- condition: template
|
||||
value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}"
|
||||
- choose:
|
||||
- conditions: "{{ not group_target }}"
|
||||
sequence:
|
||||
- device_id: 70c62eb366d6ed914b0ccc6bf41c32fd
|
||||
domain: mobile_app
|
||||
type: notify
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: "{{ id }}"
|
||||
group: frigate-notification-{{ camera }}
|
||||
url: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
clickAction: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
image: >-
|
||||
/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
sound: none
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
actions:
|
||||
- action: URI
|
||||
title: View Clip
|
||||
uri: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
- action: URI
|
||||
title: View Snapshot
|
||||
uri: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg
|
||||
- action: silence-{{ camera }}
|
||||
title: Silence Notifications
|
||||
destructive: true
|
||||
default:
|
||||
- service: notify.{{ group_target }}
|
||||
data:
|
||||
message: A {{ label }} was detected on the {{ camera_name }} camera.
|
||||
data:
|
||||
tag: "{{ id }}"
|
||||
group: frigate-notification-{{ camera }}
|
||||
url: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
clickAction: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
image: >-
|
||||
/api/frigate/notifications/{{id}}/thumbnail.jpg?format=android
|
||||
sound: none
|
||||
attachment:
|
||||
url: /api/frigate/notifications/{{id}}/thumbnail.jpg
|
||||
actions:
|
||||
- action: URI
|
||||
title: View Clip
|
||||
uri: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4
|
||||
- action: URI
|
||||
title: View Snapshot
|
||||
uri: >-
|
||||
{{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg
|
||||
- action: silence-{{ camera }}
|
||||
title: Silence Notifications
|
||||
destructive: true
|
||||
until: "{{ wait.trigger.payload_json['type'] == 'end' }}"
|
||||
- wait_for_trigger:
|
||||
- platform: event
|
||||
event_type: mobile_app_notification_action
|
||||
event_data:
|
||||
action: silence-{{ camera }}
|
||||
timeout:
|
||||
seconds: 30
|
||||
continue_on_timeout: false
|
||||
- delay:
|
||||
minutes: 30
|
||||
Reference in New Issue
Block a user