-
Notifications
You must be signed in to change notification settings - Fork 0
/
automations.yaml
57 lines (55 loc) · 2.37 KB
/
automations.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
- id: '1686305498315'
alias: Pronote notif nouvelle note
description: ''
triggers:
- event_type: pronote_event
event_data:
type: new_grade
trigger: event
actions:
- data:
message: '{{ trigger.event.data.child_nickname }} a eu {{ trigger.event.data.data.grade_out_of
}} en {{ trigger.event.data.data.subject }} : {{ trigger.event.data.data.comment
}} le {{ trigger.event.data.data.date.strftime(''%d/%m/%Y'') }}'
title: Pronote {{ trigger.event.data.child_nickname }} note
action: notify.mobile_app_tel_thomas
- data:
message: '{{ trigger.event.data.child_nickname }} a eu {{ trigger.event.data.data.grade_out_of
}} en {{ trigger.event.data.data.subject }} : {{ trigger.event.data.data.comment
}} le {{ trigger.event.data.data.date.strftime(''%d/%m/%Y'') }}'
title: Pronote {{ trigger.event.data.child_nickname }} note
action: notify.mobile_app_m2103k19pg
- id: '1686305498317'
alias: 'Notification: modification emploi du temps'
description: Pronote notif emploi du temps
triggers:
- entity_id:
- sensor.pronote_beck_romain_timetable_period
attribute: canceled_lessons_counter
to:
trigger: state
conditions:
- condition: template
value_template: '{% set items = state_attr(''sensor.pronote_beck_romain_timetable_period'',
''lessons'') %}
{{ true if items | selectattr(''canceled'', ''=='', true) | list or items |
selectattr(''canceled'', ''=='', false) | selectattr(''status'', ''!='', none)
| list else false }}
'
- condition: not
conditions:
- condition: state
entity_id: sensor.pronote_beck_romain_timetable_period
state: '0'
actions:
- data:
title: Pronote
message: "{% set items = state_attr('sensor.pronote_beck_romain_timetable_period','lessons')
%} {%- for item in items -%}\n {%- if item.canceled == True -%}\n {{
item.lesson }} : {{ item.status }}, aujourd'hui de {{ item.start_time }} à
{{ item.end_time}}{{\"\\n\"}}\n {%- endif -%}\n {%- if item.canceled ==
false and item.status != None -%}\n {{ item.lesson }} : {{ item.status
}} le {{as_timestamp(item.start_at) | int | timestamp_custom('%d/%m/%Y', true)}}
de {{ item.start_time }} à {{ item.end_time}}{{\"\\n\"}}\n {%- endif -%}
\ \n{%- endfor -%}"
action: notify.mobile_app_tel_thomas