forked from BeardedTinker/Home-Assistant_Config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotify_engine.yaml
93 lines (92 loc) · 3.96 KB
/
notify_engine.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#####
# Notifications engine - adapted from CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
#
# Service template is used to select who will receive message.
# It can be used for individual messages but groups too
# for example - Discord sends message to both Discord and me etc.
#
# When you call script from automation, you can specify variables provided below to tweak ho notification will behave.
#
# List of variables you can used when calling this script:
#
# who: List of available platforms and variable that is used to select where to push notification
# title: Title of the message - not all notification platforms support this
# value1: value variables are used as messge body. Up to 3 lines can be used
# value2:
# value3:
# target_id: Some platforms require you to specify target ID of the channel for message in ex. Discord, Telegram etc
#
# Additiona variables that can be used to further customize Companion App notifications
#
# subtitle: Subtitle can be used for text under the title (subtitle in iOS, subject in Android)
# clickAction: Used toprovide URL that can be called after clisking notification (url in iOS, clickAction in Android)
# tag_id: Used to tag notifications, useful for mobile app notifications
# group: Used to group notificatrions, useful for mobile app notifications
# sticky: Android specific - true will make notification stick even when you press on it, default is false
# color: Android specific - change notification color. can use hex code or color name (#ff0000 or 'orange')
# channel_id: Android specific - create or use channel for notification. Default is 'general'
# importance_id: Android specific - in combination with channel used to define importance: high, low, max, min and default
# vibrationPattern: Android specific - NOT YET USED
# ledColor: Android specific - you can use hex code or color name (#ff0000 or 'orange')
# timeout_sec: Android specific - allows you to atumaticly expire notification after nnn secons - numeric value, in ex. 900
# camera_entity: Disply image
# ios_category: iOS specific -
# iso_sound: iOS specific - DISABLED
# ios_badge: iOS specific - DISABLED
#
#####
notify_engine:
sequence:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.text_notifications
state: 'on'
- service: >
{% if who == 'mirta' %}
notify.mobile_app_eml_l29
{% elif who == 'andrej' %}
notify.mobile_app_ele_l29
{% elif who == 'luka' %}
notify.mobile_app_iphone
{% elif who == 'zita' %}
notify.mobile_app_fig_lx1
{% elif who == 'parents' %}
notify.parents
{% elif who == 'family' %}
notify.family
{% elif who == 'discord' %}
notify.andrej_discord
{% else %}
notify.ebroz_bot
{% endif %}
data:
title: "{{ title }}"
message: "{{ value1 }} {{ value2 }} {{ value3 }}"
target: "{{ target_id }}"
data:
subtitle: "{{ subtitle }}"
subject: "{{ subtitle }}"
attachment:
url: "{{ clickAction }}"
content-type: "{{ content_type }}"
hide-thumbnail: false
url: "{{ clickAction }}"
clickAction: "{{ clickAction }}"
apns_headers:
'apns-collapse-id': "{{ tag_id }}"
group: "{{ group }}"
tag: "{{ tag_id }}"
importance: "{{ importance_id }}"
color: "{{ color }}"
sticky: "{{ sticky }}"
channel: "{{ channel_id }}"
# vibrationPattern: "100 1000 100 1000 100"
# ledColor: "{{ ledColor }}"
timeout: "{{ timeout_sec }}"
entity_id: "{{ camera_entity }}"
push:
category: "{{ ios_category }}"
# sound: "{{ ios_sound }}"
# badge: "{{ ios_badge }}"