mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-08-18 03:15:45 +00:00
Moving stuff around for organization.
This commit is contained in:
20
automation/System/Self_heal.yaml
Executable file
20
automation/System/Self_heal.yaml
Executable file
@@ -0,0 +1,20 @@
|
||||
###################################
|
||||
## Self Healing Section -
|
||||
## Home Assistant runs on my [Raspberry Pi 3](http://amzn.to/2e3DOBY) with [Aeon Labs Z Wave Stick (GEN 5)](http://amzn.to/2eAiAP0).
|
||||
###################################
|
||||
|
||||
- alias: Heal ZWave Nightly
|
||||
hide_entity: True
|
||||
trigger:
|
||||
platform: time
|
||||
after: '2:31:00'
|
||||
action:
|
||||
service: zwave.heal_network
|
||||
|
||||
- alias: Flush TTS Cache
|
||||
hide_entity: True
|
||||
trigger:
|
||||
platform: time
|
||||
after: '2:35:00'
|
||||
action:
|
||||
service: tts.clear_cache
|
16
automation/System/bad_logins.yaml
Executable file
16
automation/System/bad_logins.yaml
Executable file
@@ -0,0 +1,16 @@
|
||||
###################################
|
||||
## Uses IFTTT to notify me of bad logins.
|
||||
###################################
|
||||
|
||||
- alias: Login Failure
|
||||
hide_entity: True
|
||||
trigger:
|
||||
platform: template
|
||||
value_template: "{{ states('persistent_notification.httplogin') != 'unknown' }}"
|
||||
|
||||
action:
|
||||
service: script.ifttt_notify
|
||||
data_template:
|
||||
value1: 'Bad Login: '
|
||||
value2: 'There was a Hack attempt!'
|
||||
value3: 'Go Check the GUI for details.'
|
49
automation/System/detect_and_adjust_lights.yaml
Executable file
49
automation/System/detect_and_adjust_lights.yaml
Executable file
@@ -0,0 +1,49 @@
|
||||
##############################################################################
|
||||
### Detect when lights are turned on and adjust them accordingly based on time.
|
||||
### Code by @JesseWebDotCom
|
||||
##############################################################################
|
||||
- alias: detect lights and adjust the brightness when turned on based on time
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: state_changed
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: group.family
|
||||
state: 'home'
|
||||
- condition: state
|
||||
entity_id: input_boolean.alert_mode
|
||||
state: 'off'
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data is not none }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id is not none }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'light' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.tv' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.couch' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.office' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.new_state.state == 'on' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.event.data.old_state.state == 'off' }}"
|
||||
|
||||
action:
|
||||
- service: light.turn_on
|
||||
data_template:
|
||||
entity_id: "{{ trigger.event.data.entity_id }}"
|
||||
brightness: >
|
||||
{% set hour=states("sensor.time").split(':')[0] | int %}
|
||||
{%- if hour >= 5 and hour < 8 -%}
|
||||
50
|
||||
{%- elif hour >= 8 and hour <20 -%}
|
||||
255
|
||||
{%- elif hour >= 20 and hour <24 -%}
|
||||
40
|
||||
{%- else -%}
|
||||
15
|
||||
{%- endif %}
|
||||
|
44
automation/System/device_status.yaml
Executable file
44
automation/System/device_status.yaml
Executable file
@@ -0,0 +1,44 @@
|
||||
###################################
|
||||
## Notifies me via IFTTT when something goes down.
|
||||
###################################
|
||||
|
||||
- alias: 'Device Status'
|
||||
hide_entity: True
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- sensor.wii
|
||||
- sensor.hue_hub
|
||||
- sensor.tablotv
|
||||
- sensor.alexa_echo
|
||||
- sensor.amazon_dot
|
||||
- sensor.circle
|
||||
- sensor.rachio
|
||||
- sensor.skybell
|
||||
#- sensor.samsungtv
|
||||
- sensor.chromecast_audio_1
|
||||
- sensor.chromecast_audio_2
|
||||
- sensor.nest_upstairs
|
||||
- sensor.nest_downstairs
|
||||
- sensor.cisco_ap
|
||||
- sensor.actiontechap
|
||||
- sensor.garadget_small
|
||||
- sensor.garadget_large
|
||||
- sensor.led_rgb_garage_left
|
||||
- sensor.led_rgb_garage_small
|
||||
- sensor.led_rgb_outdoor_den
|
||||
#- sensor.withings_scale
|
||||
- sensor.smart_water_meter
|
||||
- sensor.sleep_number_bed
|
||||
|
||||
action:
|
||||
- service: script.ifttt_notify
|
||||
data_template:
|
||||
value1: 'Device Status:'
|
||||
value2: "{{ trigger.entity_id.split('.')[1]|replace('_', ' ') }} is "
|
||||
value3: "{{ trigger.to_state.state }}"
|
||||
|
||||
- service: script.Voice_notify
|
||||
data_template:
|
||||
value1: "{{ trigger.entity_id.split('.')[1]|replace('_', ' ') }} is now {{ trigger.to_state.state }}"
|
||||
|
19
automation/System/startup_notification.yaml
Executable file
19
automation/System/startup_notification.yaml
Executable file
@@ -0,0 +1,19 @@
|
||||
###################################
|
||||
## Start Up Section
|
||||
###################################
|
||||
|
||||
- alias: Startup Notification and Shut startup lights
|
||||
hide_entity: True
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: homeassistant_start
|
||||
action:
|
||||
- service: script.ifttt_notify
|
||||
data_template:
|
||||
value1: 'Startup: Home Assistant is Up and Running!'
|
||||
value2: ''
|
||||
value3: ''
|
||||
|
||||
- service: light.turn_off
|
||||
entity_id: group.hallway_lights
|
||||
|
29
automation/System/update_notification.yaml
Executable file
29
automation/System/update_notification.yaml
Executable file
@@ -0,0 +1,29 @@
|
||||
- alias: "Update Available Notification"
|
||||
hide_entity: True
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: updater.updater
|
||||
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: "{{ states('updater.updater') != 'unknown' }}"
|
||||
|
||||
action:
|
||||
- service: script.ifttt_notify
|
||||
data_template:
|
||||
value1: 'There is a new Version of Home-Assistant Available.'
|
||||
value2: "{{ states('updater.updater') }}"
|
||||
value3: ''
|
||||
|
||||
- service: notify.html5
|
||||
data_template:
|
||||
title: "Update Available"
|
||||
message: "Home Assistant {{ states('updater.updater') }} is available. - {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %d%b%Y', true) }}"
|
||||
data:
|
||||
url: "https://home-assistant.io/getting-started/installation-raspberry-pi-all-in-one/#upgrading"
|
||||
|
||||
- service: persistent_notification.create
|
||||
data:
|
||||
title: "Update Available"
|
||||
message: "Home Assistant {{ states('updater.updater') }} is available. - {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %d%b%Y', true) }}"
|
||||
notification_id: "update_available"
|
99
automation/System/watchdog.yaml
Executable file
99
automation/System/watchdog.yaml
Executable file
@@ -0,0 +1,99 @@
|
||||
##############################################################################
|
||||
### Detect when things are on and forgotten about. Like any Good Watchdog.
|
||||
##############################################################################
|
||||
|
||||
- alias: Automated Switch WatchDog!
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: switch.printer_outlet
|
||||
state: 'on'
|
||||
for: '00:20:00'
|
||||
- platform: state
|
||||
entity_id: switch.garage_outlet
|
||||
state: 'on'
|
||||
for: '03:00:00'
|
||||
|
||||
#Turn it off twice for good measure!
|
||||
action:
|
||||
- service: switch.turn_off
|
||||
data_template:
|
||||
entity_id: "{{ trigger.entity_id }}"
|
||||
- delay: 00:01:00
|
||||
- service: switch.turn_off
|
||||
data_template:
|
||||
entity_id: "{{ trigger.entity_id }}"
|
||||
|
||||
##############################################################################
|
||||
|
||||
- alias: Automated Light WatchDog!
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- light.hallway
|
||||
- group.foyer_lights
|
||||
- light.master_toilet
|
||||
state: 'on'
|
||||
for: '00:20:00'
|
||||
|
||||
- platform: state
|
||||
entity_id:
|
||||
- light.paige_go
|
||||
- light.justin_go
|
||||
- group.upstairs
|
||||
state: 'on'
|
||||
for: '02:00:00'
|
||||
|
||||
#Turn it off!
|
||||
action:
|
||||
- service: light.turn_off
|
||||
data_template:
|
||||
entity_id: "{{ trigger.entity_id }}"
|
||||
|
||||
##############################################################################
|
||||
|
||||
- alias: "NOTIFY IF IP CHANGES"
|
||||
hide_entity: True
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: sensor.ipchange
|
||||
from: 'False'
|
||||
to: 'True'
|
||||
action:
|
||||
- service: script.ifttt_notify
|
||||
data_template:
|
||||
value1: 'Changed IP address:'
|
||||
value2: "New IP: {{ states('sensor.exteral_ip') }}"
|
||||
value3: ' - Be sure to Change DNS!'
|
||||
|
||||
##############################################################################
|
||||
|
||||
- alias: "New device connected"
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: device_tracker_new_device
|
||||
action:
|
||||
- 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_
|
||||
above: 80
|
||||
action:
|
||||
- service: script.Voice_notify
|
||||
data_template:
|
||||
value1: 'ATTENTION: Your harddrive is running out of Space! /dev/root:{{ states.sensor.disk_use_.state }}%!'
|
||||
- service: script.ifttt_notify
|
||||
data_template:
|
||||
value1: 'Hard Drive Monitor:'
|
||||
value2: "Your harddrive is running out of Space! /dev/root:{{ states.sensor.disk_use_.state }}%!"
|
||||
value3: ' '
|
||||
- service: persistent_notification.create
|
||||
data:
|
||||
title: "Hard Drive Monitor:"
|
||||
message: "Your harddrive is running out of Space! /dev/root:{{ states.sensor.disk_use_.state }}%!"
|
||||
notification_id: "Critical Alert"
|
Reference in New Issue
Block a user