-
Notifications
You must be signed in to change notification settings - Fork 58
/
power_supply_notify.yaml
36 lines (31 loc) 路 1.07 KB
/
power_supply_notify.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
#
# Check if Raspberry Pi's power supply is providing enough energy
#
# @subscribe sensor.rpi_power_status
#
- id: power_supply_notify
alias: "Power Supply NOTIFY"
trigger:
# When supplied power is out of spec.
- platform: numeric_state
entity_id: sensor.rpi_power_status
above: 0
action:
# Pin a warning message in the frontend.
- service: persistent_notification.create
data:
notification_id: power_supply
data_template:
title: "Raspbery Pi power issue"
message: >-
{% set description = state_attr('sensor.rpi_power_status', 'description') %}
{% set status = states('sensor.rpi_power_status') %}
{{ description }} (Code {{ status }})
# Warn someone by text to take action.
- service: notify.text
data_template:
title: "Raspbery Pi power issue"
message: >-
{% set description = state_attr('sensor.rpi_power_status', 'description') %}
{% set status = states('sensor.rpi_power_status') %}
{{ description }} (Code {{ status }})