-
Notifications
You must be signed in to change notification settings - Fork 6
/
systems.yaml
executable file
·257 lines (239 loc) · 8.19 KB
/
systems.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
################################# Proxmox NUC #################################
#proxmoxve:
# - host: 10.10.40.6
# username: !secret proxmox_user
# password: !secret proxmox_pass
# verify_ssl: false
# realm :pam
# port: !secret proxmox_port
# nodes:
# - node: pve
# vms:
# - 101
# - 102
# - 103
# - 105
sensor:
################################# NAS Status #################################
- platform: synologydsm
host: !secret nas_ip
username: !secret nas_username
password: !secret nas_password
monitored_conditions:
- cpu_total_load
- cpu_1min_load
- cpu_5min_load
- memory_total_real
- memory_real_usage
- memory_available_real
- disk_status
- disk_temp
- volume_size_used
- volume_percentage_used
- volume_size_total
- network_up
- network_down
################################# Systems Uptime #################################
- platform: systemmonitor
scan_interval: 60
resources:
- type: last_boot
- platform: template
sensors:
uptime_nuc:
friendly_name: Uptime NUC
icon_template: mdi:server
value_template: >-
{% set lb = states('sensor.last_boot') %}
{% if lb != 'unknown' %}
{% set seconds = (as_timestamp(now()) - as_timestamp(lb))|int %}
{% set days = (seconds / 86400)|int %}
{% set seconds = seconds % 86400 %}
{% set hours = (seconds / 3600)|int %}
{% set seconds = seconds % 3600 %}
{% set minutes = (seconds / 60)|int %}
{% set seconds = seconds % 60 %}
{% if hours == 0 and minutes == 0 %}
{{ time }} seconds
{% else %}
{%- if days > 0 -%}
{%- if days == 1 -%}
1 day
{%- else -%}
{{ days }} days
{%- endif -%}
{%- endif -%}
{%- if hours > 0 and days < 7 -%}
{%- if days > 0 -%}
{{ ', ' }}
{%- endif -%}
{%- if hours == 1 -%}
1 hour
{%- else -%}
{{ hours }} hours
{%- endif -%}
{%- endif -%}
{%- if days == 0 and minutes > 0 -%}
{%- if hours > 0 -%}
{{ ', ' }}{{ minutes }} min
{%- else -%}
{%- if minutes == 1 -%}
1 minute
{%- else -%}
{{ minutes }} minutes
{%- endif -%}
{%- endif -%}
{%- endif -%}
{% endif %}
{% else %}
unknown
{% endif %}
- platform: uptime
name: HASS uptime
scan_interval: 60
unit_of_measurement: hours
- platform: template
sensors:
uptime_hass:
friendly_name: Uptime HASS
icon_template: mdi:home-assistant
value_template: >-
{% set uptime = states('sensor.hass_uptime') | float(-1) %}
{% if uptime >= 0 %}
{% set time = (3600 * uptime) | int %}
{% set minutes = ((time % 3600) / 60) | int %}
{% set hours = ((time % 86400) / 3600) | int %}
{% set days = (time / 86400) | int %}
{% if time < 60 %}
{{ time }} seconds
{% else %}
{%- if days > 0 -%}
{%- if days == 1 -%}
1 day
{%- else -%}
{{ days }} days
{%- endif -%}
{%- endif -%}
{%- if hours > 0 and days < 7 -%}
{%- if days > 0 -%}
{{ ', ' }}
{%- endif -%}
{%- if hours == 1 -%}
1 hour
{%- else -%}
{{ hours }} hours
{%- endif -%}
{%- endif -%}
{%- if days == 0 and minutes > 0 -%}
{%- if hours > 0 -%}
{{ ', ' }}{{ minutes }} min
{%- else -%}
{%- if minutes == 1 -%}
1 minute
{%- else -%}
{{ minutes }} minutes
{%- endif -%}
{%- endif -%}
{%- endif -%}
{% endif %}
{% else %}
unknown
{% endif %}
################################# Versions #################################
- platform: version
name: HASS Available
source: docker
beta: true
- platform: version
name: HASS Installed
- platform: command_line
name: AppDaemon Available
command: >-
curl -L
-H "User-Agent: Home Assistant"
-H "Content-Type: application/json"
https://pypi.python.org/pypi/appdaemon/json
value_template: '{{ value_json.info.version }}'
scan_interval: 3600
################################# Docker switches #################################
switch:
- platform: rest
username: !secret ha-dockermon_user
password: !secret ha-dockermon_key
resource: http://192.168.0.5:8126/container/appdaemon
name: AppDaemon
body_on: '{"state": "start"}'
body_off: '{"state": "stop"}'
is_on_template: '{{ value_json is not none and value_json.state == "running" }}'
- platform: rest
username: !secret ha-dockermon_user
password: !secret ha-dockermon_key
resource: http://192.168.0.5:8126/container/deconz
name: Deconz
body_on: '{"state": "start"}'
body_off: '{"state": "stop"}'
is_on_template: '{{ value_json is not none and value_json.state == "running" }}'
- platform: rest
username: !secret ha-dockermon_user
password: !secret ha-dockermon_key
resource: http://192.168.0.5:8126/container/glances
name: Glances
body_on: '{"state": "start"}'
body_off: '{"state": "stop"}'
is_on_template: '{{ value_json is not none and value_json.state == "running" }}'
- platform: rest
username: !secret ha-dockermon_user
password: !secret ha-dockermon_key
resource: http://192.168.0.5:8126/container/grafana
name: Grafana
body_on: '{"state": "start"}'
body_off: '{"state": "stop"}'
is_on_template: '{{ value_json is not none and value_json.state == "running" }}'
- platform: rest
username: !secret ha-dockermon_user
password: !secret ha-dockermon_key
resource: http://192.168.0.5:8126/container/ha-dockermon
name: Dockermon
body_on: '{"state": "start"}'
body_off: '{"state": "stop"}'
is_on_template: '{{ value_json is not none and value_json.state == "running" }}'
- platform: rest
username: !secret ha-dockermon_user
password: !secret ha-dockermon_key
resource: http://192.168.0.5:8126/container/hass
name: HASS
body_on: '{"state": "start"}'
body_off: '{"state": "stop"}'
is_on_template: '{{ value_json is not none and value_json.state == "running" }}'
- platform: rest
username: !secret ha-dockermon_user
password: !secret ha-dockermon_key
resource: http://192.168.0.5:8126/container/influxdb
name: InfluxDB
body_on: '{"state": "start"}'
body_off: '{"state": "stop"}'
is_on_template: '{{ value_json is not none and value_json.state == "running" }}'
- platform: rest
username: !secret ha-dockermon_user
password: !secret ha-dockermon_key
resource: http://192.168.0.5:8126/container/letsencrypt
name: NGINX
body_on: '{"state": "start"}'
body_off: '{"state": "stop"}'
is_on_template: '{{ value_json is not none and value_json.state == "running" }}'
- platform: rest
username: !secret ha-dockermon_user
password: !secret ha-dockermon_key
resource: http://192.168.0.5:8126/container/mqtt
name: Mosquitto
body_on: '{"state": "start"}'
body_off: '{"state": "stop"}'
is_on_template: '{{ value_json is not none and value_json.state == "running" }}'
- platform: rest
username: !secret ha-dockermon_user
password: !secret ha-dockermon_key
resource: http://192.168.0.5:8126/container/mysql
name: MySQL
body_on: '{"state": "start"}'
body_off: '{"state": "stop"}'
is_on_template: '{{ value_json is not none and value_json.state == "running" }}'