-
Notifications
You must be signed in to change notification settings - Fork 0
/
battery_alert
53 lines (53 loc) · 1.56 KB
/
battery_alert
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
blueprint:
name: Battery Level Notification
description: Send a notification to a device when battery drops below a specified value
source_url: https://github.com/pepsonEL/HAblueprints/blob/main/battery_alert
domain: automation
input:
battery_entity:
name: Entity
selector:
entity:
domain: sensor
device_class: battery
battery_level:
name: Battery level
description: What level the device should be to trigger the notification.
default: 50
selector:
number:
min: 1.0
max: 100.0
unit_of_measurement: '%'
step: 1.0
mode: slider
notify_device:
name: Device to notify
description: Device needs to run the official Home Assistant app to receive
notifications.
selector:
device:
integration: mobile_app
message:
name: Message
description: 'Default: " {{ entity_name }} battery has dropped to {{ battery_level
}}% "'
default: ' {{ entity_name }} battery has dropped to {{ battery_level }}% '
trigger:
- platform: numeric_state
entity_id: !input 'battery_entity'
below: !input 'battery_level'
variables:
entity_name: '{{ states[trigger.entity_id].name }}'
battery_level: '{{ states(trigger.entity_id) }}'
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: !input 'battery_entity'
below: !input 'battery_level'
sequence:
domain: mobile_app
type: notify
device_id: !input 'notify_device'
message: !input 'message'