-
Notifications
You must be signed in to change notification settings - Fork 6
/
cctv_ai_notification_script_UPDATE
65 lines (65 loc) · 2.05 KB
/
cctv_ai_notification_script_UPDATE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
alias: Camera - Driveway 1 - Snapshot, AI & Notification
sequence:
- service: camera.snapshot
metadata: {}
data:
filename: ./www/snapshots/driveway1_snapshot1.jpg
target:
device_id: ***YOUR_CAMERAS_DEVICE_ID***
enabled: true
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 500
enabled: true
- service: camera.snapshot
metadata: {}
data:
filename: ./www/snapshots/driveway1_snapshot2.jpg
target:
device_id: ***YOUR_CAMERAS_DEVICE_ID***
enabled: true
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 500
enabled: true
- service: camera.snapshot
metadata: {}
data:
filename: ./www/snapshots/driveway1_snapshot3.jpg
target:
device_id: ***YOUR_CAMERAS_DEVICE_ID***
enabled: true
- service: google_generative_ai_conversation.generate_content
metadata: {}
data:
prompt: >-
Motion has been detected, compare and very briefly describe what you see
in the following sequence of images from my driveway camera number 1.
What do you think caused the motion alarm? If a person or car is
present, describe them in detail. Do not describe stationary objects or
buildings. If you see no obvious causes of motion, reply with "No
Obvious Motion Detected." Your message needs to be short enough to fit
in a phone notification.
image_filename:
- ./www/snapshots/driveway1_snapshot1.jpg
- ./www/snapshots/driveway1_snapshot2.jpg
- ./www/snapshots/driveway1_snapshot3.jpg
response_variable: generated_content
- if:
- condition: template
value_template: "{{ 'No Obvious Motion Detected.' in generated_content.text }}"
then:
- stop: ""
else:
- service: notify.mobile ***** YOUR PHONE ID ********
metadata: {}
data:
title: Driveway 1 Motion Detected
message: "{{generated_content['text'] }}"
data:
image: /local/snapshots/driveway1_snapshot2.jpg
mode: single