mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-02-18 23:36:11 +00:00
ADD in system Monitor stuff to watch hard drives.
This commit is contained in:
parent
6d48831190
commit
2502d74e95
@ -75,3 +75,26 @@
|
||||
- service: script.Voice_notify
|
||||
data_template:
|
||||
value1: "There has been a new device detected on the network. Be sure to appropriately catagorize it within Circle."
|
||||
|
||||
##############################################################################
|
||||
|
||||
- alias: "Disk Use Alarm"
|
||||
trigger:
|
||||
- platform: numeric_state
|
||||
entity_id: sensor.disk_use_percent
|
||||
above: 30.4
|
||||
action:
|
||||
- service: script.Voice_notify
|
||||
data_template:
|
||||
value1: 'Your harddrive has run out of Space! /dev/root:{{ states.sensor.disk_use_.state }}%!'
|
||||
- service: script.ifttt_notify
|
||||
data_template:
|
||||
value1: 'Hard Drive Monitor:'
|
||||
value2: "Your harddrive has run out of Space! /dev/root:{{ states.sensor.disk_use_.state }}%!"
|
||||
value3: ' '
|
||||
|
||||
- service: persistent_notification.create
|
||||
data:
|
||||
title: "Hard Drive Monitor:"
|
||||
message: "Your harddrive has run out of Space! /dev/root:{{ states.sensor.disk_use_.state }}%!"
|
||||
notification_id: "Critical Alert"
|
@ -1,59 +1,61 @@
|
||||
- platform: systemmonitor
|
||||
resources:
|
||||
# - type: last_boot
|
||||
- type: since_last_boot
|
||||
|
||||
- platform: template
|
||||
sensors:
|
||||
since_last_boot_templated:
|
||||
value_template: >-
|
||||
{%- set slb = states.sensor.since_last_boot.state.split(' ') -%}
|
||||
{%- set count = slb | length -%}
|
||||
{%- set hms = slb[count - 1] -%}
|
||||
{%- set hms_trimmed = hms.split('.')[0] -%}
|
||||
{%- set hms_split = hms_trimmed.split(':') -%}
|
||||
{%- set hours = hms_split[0] | int -%}
|
||||
{%- set minutes = hms_split[1] | int -%}
|
||||
{%- set seconds = hms_split[2] | int -%}
|
||||
|
||||
{%- if count == 3 -%}
|
||||
{{ slb[0] ~ ' ' ~ slb[1] ~ ' ' }}
|
||||
{%- endif -%}
|
||||
{%- if hours > 0 -%}
|
||||
{%- if hours == 1 -%}
|
||||
1 hour
|
||||
{%- else -%}
|
||||
{{ hours }} hours
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- if minutes > 0 -%}
|
||||
{%- if hours > 0 -%}
|
||||
{{ ', ' }}
|
||||
{%- endif -%}
|
||||
{%- if minutes == 1 -%}
|
||||
1 minute
|
||||
{%- else -%}
|
||||
{{ minutes }} minutes
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- if seconds > 0 -%}
|
||||
{%- if hours > 0 or minutes > 0 -%}
|
||||
{{ ', ' }}
|
||||
{%- endif -%}
|
||||
{%- if seconds == 1 -%}
|
||||
1 second
|
||||
{%- else -%}
|
||||
{{ seconds }} seconds
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
|
||||
- platform: rest
|
||||
resource: http://ip.jsontest.com
|
||||
name: External IP
|
||||
value_template: '{{ value_json.ip }}'
|
||||
|
||||
- platform: template
|
||||
sensors:
|
||||
ipchange:
|
||||
entity_id: sensor.external_ip
|
||||
- platform: systemmonitor
|
||||
resources:
|
||||
# - type: last_boot
|
||||
- type: since_last_boot
|
||||
- type: disk_use_percent
|
||||
arg: /
|
||||
|
||||
- platform: template
|
||||
sensors:
|
||||
since_last_boot_templated:
|
||||
value_template: >-
|
||||
{%- set slb = states.sensor.since_last_boot.state.split(' ') -%}
|
||||
{%- set count = slb | length -%}
|
||||
{%- set hms = slb[count - 1] -%}
|
||||
{%- set hms_trimmed = hms.split('.')[0] -%}
|
||||
{%- set hms_split = hms_trimmed.split(':') -%}
|
||||
{%- set hours = hms_split[0] | int -%}
|
||||
{%- set minutes = hms_split[1] | int -%}
|
||||
{%- set seconds = hms_split[2] | int -%}
|
||||
|
||||
{%- if count == 3 -%}
|
||||
{{ slb[0] ~ ' ' ~ slb[1] ~ ' ' }}
|
||||
{%- endif -%}
|
||||
{%- if hours > 0 -%}
|
||||
{%- if hours == 1 -%}
|
||||
1 hour
|
||||
{%- else -%}
|
||||
{{ hours }} hours
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- if minutes > 0 -%}
|
||||
{%- if hours > 0 -%}
|
||||
{{ ', ' }}
|
||||
{%- endif -%}
|
||||
{%- if minutes == 1 -%}
|
||||
1 minute
|
||||
{%- else -%}
|
||||
{{ minutes }} minutes
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- if seconds > 0 -%}
|
||||
{%- if hours > 0 or minutes > 0 -%}
|
||||
{{ ', ' }}
|
||||
{%- endif -%}
|
||||
{%- if seconds == 1 -%}
|
||||
1 second
|
||||
{%- else -%}
|
||||
{{ seconds }} seconds
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
|
||||
- platform: rest
|
||||
resource: http://ip.jsontest.com
|
||||
name: External IP
|
||||
value_template: '{{ value_json.ip }}'
|
||||
|
||||
- platform: template
|
||||
sensors:
|
||||
ipchange:
|
||||
entity_id: sensor.external_ip
|
||||
value_template: "{%- if is_state('sensor.external_ip', '!secret external_ip') -%} False {%- else -%} True {%- endif %}"
|
Loading…
x
Reference in New Issue
Block a user