mysmarthome/packages/watchdog.yaml

311 lines
9.4 KiB
YAML
Raw Normal View History

2019-04-17 22:46:06 +00:00
###############################################################################
# @author : Mahasri Kalavala
# @date : 04/15/2017
# @package : WatchDog
# @description : Watchdog Automations
###############################################################################
###############################################################################
2020-03-14 00:10:10 +00:00
# _ _ _
# /\ | | | | (_)
# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
2019-04-17 22:46:06 +00:00
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
2020-03-14 00:10:10 +00:00
#
2019-04-17 22:46:06 +00:00
###############################################################################
automation:
2020-03-14 00:10:10 +00:00
# Garage:
# Working in Garage Mode Watch Dog - Turns off after 2 hours
###############################################################################
2019-04-17 22:46:06 +00:00
- alias: Working In Garage WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- input_boolean.working_in_garage
2020-03-14 00:10:10 +00:00
to: "on"
for:
2019-04-17 22:46:06 +00:00
hours: 2
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
2019-04-17 22:46:06 +00:00
action:
2022-12-03 16:28:12 +00:00
- service: script.notify_family
2020-03-14 00:10:10 +00:00
data:
2022-12-03 16:28:12 +00:00
message: "It has been two hours, are you still working in the garage?"
notify_options:
- telegram
- tv
2019-04-17 22:46:06 +00:00
- service: input_boolean.turn_off
entity_id: input_boolean.working_in_garage
2020-03-14 00:10:10 +00:00
# Garage:
2020-03-21 01:25:56 +00:00
# Keeps and eye on the garage doors... reminds me to close after 5 min
2020-03-14 00:10:10 +00:00
###############################################################################
2019-04-17 22:46:06 +00:00
- alias: Two Car garage Door WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
2020-09-28 01:29:23 +00:00
- binary_sensor.door_window_sensor_158d0004231f7b
- binary_sensor.door_window_sensor_158d0004248d5b
2020-03-14 00:10:10 +00:00
to: "on"
for:
2019-04-17 22:46:06 +00:00
minutes: 5
condition:
- condition: state
entity_id: input_boolean.working_in_garage
2020-03-14 00:10:10 +00:00
state: "off"
- condition: template
value_template: "{{ states('input_boolean.garage_door_notifications') == 'on' }}"
- condition: state
entity_id: input_boolean.light_automations
state: "on"
2019-04-17 22:46:06 +00:00
action:
2022-12-03 16:28:12 +00:00
- service: script.notify_family
2019-04-17 22:46:06 +00:00
data_template:
message: >
2020-03-21 01:25:56 +00:00
Your {{ trigger.to_state.attributes.friendly_name }} is OPEN for more than 5 minutes!
2022-12-03 16:28:12 +00:00
notify_options:
- telegram
- voice
- tv
- led
2020-03-14 00:10:10 +00:00
2020-03-21 01:25:56 +00:00
# Outdoor Lights:
# Keeps and eye on the patio and backyard lights...
2020-03-14 00:10:10 +00:00
###############################################################################
2020-03-21 01:25:56 +00:00
- alias: Outdoor Light WatchDog
2019-04-17 22:46:06 +00:00
initial_state: true
trigger:
- platform: state
entity_id:
2021-01-10 23:15:03 +00:00
- switch.backyard_light
- switch.frontyard_light
2020-03-14 00:10:10 +00:00
to: "on"
2019-04-17 22:46:06 +00:00
for:
minutes: 5
condition:
- condition: state
entity_id: sun.sun
2020-03-14 00:10:10 +00:00
state: "above_horizon"
- condition: state
entity_id: input_boolean.light_automations
state: "on"
2019-04-17 22:46:06 +00:00
action:
- service: switch.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
2022-12-03 16:28:12 +00:00
- service: script.notify_family
2019-04-17 22:46:06 +00:00
data_template:
message: >
{{ trigger.to_state.attributes.friendly_name }} is ON during the day time. Saving power by turning it off!
2022-12-03 16:28:12 +00:00
notify_options:
- telegram
- tv
- led
2020-03-14 00:10:10 +00:00
2020-03-21 01:25:56 +00:00
# General Watch Dog automation:
# Keeps and eye on the lights & switches, turns off after 10 PM if they are on.
2020-03-14 00:10:10 +00:00
###############################################################################
- alias: Lights And Switches WatchDog 10 Min
2019-04-17 22:46:06 +00:00
initial_state: true
trigger:
- platform: state
entity_id:
2020-03-21 01:25:56 +00:00
- switch.basement_left
- switch.basement_right
- switch.front_room
- switch.srinika_bedroom
- switch.hasika_bed_accent
- switch.hasika_bedroom
- switch.kitchen_switch
- switch.study_room
2020-03-21 01:25:56 +00:00
- light.hue_color_lamp_1
- light.hue_color_lamp_2
- light.hue_color_lamp_3
- light.master_bedroom_1
- light.master_bedroom_2
- light.master_bedroom_3
2020-03-14 00:10:10 +00:00
to: "on"
2019-04-17 22:46:06 +00:00
for:
minutes: 10
2020-03-21 01:25:56 +00:00
condition:
- condition: template
value_template: "{{ now().hour |int > 22 }}"
- condition: state
entity_id: input_boolean.light_automations
state: "on"
2019-04-17 22:46:06 +00:00
action:
2020-03-21 01:25:56 +00:00
- service: homeassistant.turn_off
2019-04-17 22:46:06 +00:00
data_template:
2020-03-14 00:10:10 +00:00
entity_id: "{{ trigger.entity_id }}"
- alias: Guest Bathroom Lights WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.guest_bathroom_lights
to: "on"
for:
minutes: "{{ states('input_number.guest_bathroom_lights')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
- alias: Master Bathroom Lights WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- light.master_bathroom_lights
to: "on"
for:
minutes: "{{ states('input_number.master_bathroom_lights')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
- alias: Garage Lights WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.garage
to: "on"
for:
minutes: "{{ states('input_number.garage_lights')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
- alias: Garage Shop Lights WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.garage_shop_lights
to: "on"
for:
minutes: "{{ states('input_number.garage_shop_lights')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
- alias: Guest Bathroom Exhaust WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.guest_bathroom_exhaust
to: "on"
for:
minutes: "{{ states('input_number.guest_bathroom_exhaust_timer_duration')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
- alias: Master Bathroom Shower Exhaust WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.master_bathroom_shower_exhaust
to: "on"
for:
minutes: "{{ states('input_number.master_bathroom_shower_exhaust_timer_duration')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
- alias: Master Bathroom Toilet Exhaust WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.master_bathroom_toilet_exhaust
to: "on"
for:
minutes: "{{ states('input_number.master_bathroom_toilet_exhaust_timer_duration')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
2022-12-03 16:28:12 +00:00
#############################################################################
# CLOSET LIGHTS WATCH DOG
#############################################################################
- alias: Srinika Bedroom Closet WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.srinika_bedroom_closet
to: "on"
for:
minutes: "{{ states('input_number.srinika_bedroom_closet_lights')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
- alias: Hasika Bedroom Closet WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.hasika_bedroom_closet
to: "on"
for:
minutes: "{{ states('input_number.hasika_bedroom_closet_lights')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"