-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathon-message-receive.yaml
33 lines (33 loc) · 1.1 KB
/
on-message-receive.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
# turn on the alarmlicht_led, switch REL1 on for 300ms and – depending
# on the global boolean variables - do Divera and ntfy HTTP request
# to trigger alerts via their API
- logger.log:
format: "Pager received a message"
level: INFO
- output.turn_on: alarmlicht_led
# switch the relay off after some time
- output.turn_on: relay_1
- delay: ${relay_on_time}
- output.turn_off: relay_1
# only alerts, when there is a wifi connection
- if:
condition:
wifi.connected:
then:
- lambda: 'id(global_alert_type_test) = false;'
- <<: !include {file: send-alerts.yaml,
vars:
{
divera_type: '${divera_type_alert}',
ntfy_title: '${ntfy_title_alert}',
ntfy_priority: '${ntfy_priority_alert}',
ntfy_tags: '${ntfy_tags_alert}',
ntfy_body: '${ntfy_body_alert}'
}
}
else:
- lambda: 'id(global_alert_pending) = true;'
- lambda: 'id(global_pending_alert_type_test) = false;'
- logger.log:
format: "No wifi connection, alert set to pending."
level: INFO