Browse Source

Updated file

ref: https://github.com/blakeblackshear/frigate/issues/373
tubalainen 4 years ago
parent
commit
8b9c8a2e80
1 changed files with 17 additions and 17 deletions
  1. 17 17
      docs/notification-examples.md

+ 17 - 17
docs/notification-examples.md

@@ -8,45 +8,45 @@ automation:
       platform: mqtt
       topic: frigate/events
     conditions: 
-      - "{{ trigger.payload_json["after"]["label"] == 'person' }}"
-      - "{{ 'yard' in trigger.payload_json["after"]["entered_zones"] }}"
+      - "{{ trigger.payload_json['after']['label'] == 'person' }}"
+      - "{{ 'yard' in trigger.payload_json['after']['entered_zones'] }}"
     action:
       - service: notify.mobile_app_pixel_3
         data_template:
-          message: 'A {{trigger.payload_json["after"]["label"]}} has entered the yard.'
+          message: "A {{trigger.payload_json['after']['label']}} has entered the yard."
           data:
-            image: 'https://url.com/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}.jpg'
-            tag: '{{trigger.payload_json["after"]["id"]}}'
+            image: "https://url.com/api/frigate/notifications/{{trigger.payload_json['after']['id']}}.jpg"
+            tag: "{{trigger.payload_json['after']['id']}}"
 
   - alias: When a person leaves a zone named yard
     trigger:
       platform: mqtt
       topic: frigate/events
     conditions: 
-      - "{{ trigger.payload_json["after"]["label"] == 'person' }}"
-      - "{{ 'yard' in trigger.payload_json["before"]["current_zones"] }}"
-      - "{{ not 'yard' in trigger.payload_json["after"]["current_zones"] }}"
+      - "{{ trigger.payload_json['after']['label'] == 'person' }}"
+      - "{{ 'yard' in trigger.payload_json['before']['current_zones'] }}"
+      - "{{ not 'yard' in trigger.payload_json['after']['current_zones'] }}"
     action:
       - service: notify.mobile_app_pixel_3
         data_template:
-          message: 'A {{trigger.payload_json["after"]["label"]}} has left the yard.'
+          message: "A {{trigger.payload_json['after']['label']}} has left the yard."
           data:
-            image: 'https://url.com/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}.jpg'
-            tag: '{{trigger.payload_json["after"]["id"]}}'
+            image: "https://url.com/api/frigate/notifications/{{trigger.payload_json['after']['id']}}.jpg"
+            tag: "{{trigger.payload_json['after']['id']}}"
 
   - alias: Notify for dogs in the front with a high top score
     trigger:
       platform: mqtt
       topic: frigate/events
     conditions: 
-      - "{{ trigger.payload_json["after"]["label"] == 'dog' }}"
-      - "{{ trigger.payload_json["after"]["camera"] == 'front' }}"
-      - "{{ trigger.payload_json["after"]["top_score"] > 0.98 }}"
+      - "{{ trigger.payload_json['after']['label'] == 'dog' }}"
+      - "{{ trigger.payload_json['after']['camera'] == 'front' }}"
+      - "{{ trigger.payload_json['after']['top_score'] > 0.98 }}"
     action:
       - service: notify.mobile_app_pixel_3
         data_template:
           message: 'High confidence dog detection.'
           data:
-            image: 'https://url.com/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}.jpg'
-            tag: '{{trigger.payload_json["after"]["id"]}}'
-```
+            image: "https://url.com/api/frigate/notifications/{{trigger.payload_json['after']['id']}}.jpg"
+            tag: "{{trigger.payload_json['after']['id']}}"
+```