-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathraspberry_pi_endpoint_blueprint.yaml
92 lines (91 loc) · 2.96 KB
/
raspberry_pi_endpoint_blueprint.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
blueprint:
name: Notification: Raspberry Pi Performance Issue
description: >
This blueprint provides a personal guardian for your device. It monitors the device's performance and sends an alert if it detects throttling. The alert includes detailed information about the device's state. This blueprint is designed to work with any device that has the necessary sensors.
domain: automation
input:
raspberry_pi_sensor:
name: Device Sensor
description: The sensor entity for the device
selector:
entity:
domain: sensor
person_entity:
name: Person Entity
description: The person entity to check the home status
selector:
entity:
domain: person
mobile_device:
name: Mobile Device
description: The mobile device to send the notification
selector:
entity:
domain: notify
start_time:
name: Start Time
description: The start time for the automation
default: "08:00:00"
selector:
time:
end_time:
name: End Time
description: The end time for the automation
default: "22:00:00"
selector:
time:
termux_action:
name: Termux Action
description: Whether to include the Termux action in the alert
default: true
selector:
boolean:
local_push:
name: Local Push
description: Whether to send a local push notification
default: true
selector:
boolean:
trigger:
- platform: state
entity_id: !input 'raspberry_pi_sensor'
attribute: throttled_state
from: "0x0"
condition:
- condition: time
after: !input 'start_time'
before: !input 'end_time'
- condition: template
value_template: "{{ states(!input 'raspberry_pi_sensor') != 'unavailable' }}"
action:
- service: !input 'mobile_device'
data:
message: >-
Device is having issues! Throttled State: {{
state_attr(!input 'raspberry_pi_sensor', 'throttled_state')
}}. CPU Temp: {{ state_attr(!input 'raspberry_pi_sensor',
'cpu_temperature') }}°C. CPU Freq: {{
state_attr(!input 'raspberry_pi_sensor',
'cpu_frequency_mhz') }} MHz. Core Voltage: {{
state_attr(!input 'raspberry_pi_sensor', 'core_voltage')
}}V. SDRAM C Voltage: {{
state_attr(!input 'raspberry_pi_sensor', 'sdram_c_voltage')
}}V. SDRAM I Voltage: {{
state_attr(!input 'raspberry_pi_sensor', 'sdram_i_voltage')
}}V. SDRAM P Voltage: {{
state_attr(!input 'raspberry_pi_sensor', 'sdram_p_voltage')
}}V.
title: Device Alert
data:
ttl: 0
tag: device_alert
icon: mdi:raspberry-pi
color: red
local_push: "{{ is_state('input_boolean.local_push', 'on') }}"
actions: >
{% if is_state('input_boolean.termux_action', 'on') %}
- action: URI
title: Open Termux
uri: app://com.termux.styling
{% endif %}
mode: single