-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnotification_samples.yaml
68 lines (63 loc) · 2.82 KB
/
notification_samples.yaml
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
66
67
68
# Generic home assistant SCRIPT to send a notification
alias: Rest notification test
sequence:
- service: notify.tvoverlaysample
data:
data:
id: "notification_sample" # optional id string - if a notification is being displayed and the tvoverlay receives a notification with the same id, the notification displayed is updated instantly
appTitle: AppTitle # optional text field
appIcon: mdi:unicorn # optional - accepts mdi icons, image urls and Bitmap encoded to Base64
color: "#FFF000" # optional - accepts 6 or 8 digit color hex. the '#' is optional
smallIcon: mdi:speaker-multiple # optional - accepts mdi icons, image urls and Bitmap encoded to Base64
largeIcon: mdi:camera # optional - accepts mdi icons, image urls and Bitmap encoded to Base64
corner: bottom_end # optional - values: bottom_start, bottom_end, top_start, top_end
seconds: 7 # optional - exibition duration
image: "https://fastly.picsum.photos/id/778/300/300.jpg" # optional - accepts mdi image urls
message: This is my message to you! # REQUIRED: this is a required field for home assistant, but it can be 'null' if not needed
title: Here is a Title # optional text field
mode: single
# Use case 1: Notify on person arriving Home (AUTOMATION)
alias: Person online notification
trigger:
- platform: state
entity_id:
- person.person1
- person.person2
to: home
from: not_home
condition: []
action:
- service: notify.tvoverlaysuite
data:
data:
smallIcon: mdi:home
color: "#008000"
largeIcon: [home_assistant_external_url]{{ trigger.from_state.attributes.entity_picture }} # home_assistant_external_url is my https url for my home assistant.
message: >-
{{ trigger.from_state.attributes.friendly_name }} is Home
mode: single
# Use case 2: Notify with image, when a motion is detect in a camera
alias: Motion notification
trigger:
- type: motion # For the trigger, I selected my camera device on the UI, and it had an option for 'Motion started detecting motion'
platform: device
device_id: [device_id]
entity_id: [device_id]
domain: binary_sensor
condition: []
action:
- service: notify.tvoverlaysuite
data:
message: Motion detect at Front door!
data:
image: >-
[home_assistant_external_url]{{ state_attr('camera.[CAMERA]',
'entity_picture')+'&time='}}{{as_timestamp(now())}}
# home_assistant_external_url is my https url for my home assistant.
# entity_picture is a parial url to the camera still image, like '/api/camera_proxy/camera.[CAMERA}?token=XXX'.
# I added a timestamp simply to avoid the image being cached.
color: "#B00020"
largeIcon: mdi:motion-sensor
smallIcon: mdi:camera
seconds: 10
mode: single