371 lines
9.8 KiB
YAML
371 lines
9.8 KiB
YAML
homeassistant:
|
|
|
|
# Input DateTime Options:
|
|
# I set the minutes to something that is divisible by 5, so that the automations
|
|
# can check once every 5 minutes without any performance penalty
|
|
###############################################################################
|
|
|
|
input_datetime:
|
|
summer_bed_time:
|
|
name: Summer Bed Time
|
|
has_date: false
|
|
has_time: true
|
|
initial: "23:00:00"
|
|
summer_wakeup_time:
|
|
name: Summer Wakeup Time
|
|
has_date: false
|
|
has_time: true
|
|
initial: "06:00:00"
|
|
|
|
autumn_bed_time:
|
|
name: Autumn Bed Time
|
|
has_date: false
|
|
has_time: true
|
|
initial: "22:00:00"
|
|
|
|
autumn_wakeup_time:
|
|
name: Autumn Wakeup Time
|
|
has_date: false
|
|
has_time: true
|
|
initial: "05:30:00"
|
|
|
|
winter_bed_time:
|
|
name: Winter Bed Time
|
|
has_date: false
|
|
has_time: true
|
|
initial: "22:00:00"
|
|
|
|
winter_wakeup_time:
|
|
name: Winter Wakeup Time
|
|
has_date: false
|
|
has_time: true
|
|
initial: "05:30:00"
|
|
|
|
spring_bed_time:
|
|
name: Spring Bed Time
|
|
has_date: false
|
|
has_time: true
|
|
initial: "22:00:00"
|
|
|
|
spring_wakeup_time:
|
|
name: Spring Wakeup Time
|
|
has_date: false
|
|
has_time: true
|
|
initial: "05:30:00"
|
|
|
|
input_number:
|
|
calendar_remind_before_days:
|
|
name: Calendar Remind Before Days
|
|
min: 1
|
|
max: 15
|
|
step: 1
|
|
mode: box
|
|
battery_alert_threshold:
|
|
name: Notify Low Battery if goes below
|
|
min: 1
|
|
max: 100
|
|
step: 1
|
|
mode: box
|
|
guest_bathroom_exhaust_timer_duration:
|
|
name: Guest Bathroom Shower Exhaust Timer Duration
|
|
min: 5
|
|
max: 240
|
|
step: 5
|
|
mode: box
|
|
master_bathroom_shower_exhaust_timer_duration:
|
|
name: Master Bathroom Shower Exhaust Timer Duration
|
|
min: 5
|
|
max: 240
|
|
step: 5
|
|
mode: box
|
|
master_bathroom_toilet_exhaust_timer_duration:
|
|
name: Master Bathroom Toilet Exhaust Timer Duration
|
|
min: 5
|
|
max: 240
|
|
step: 5
|
|
mode: box
|
|
master_bathroom_toilet_lights:
|
|
name: Master Bathroom Toilet Lights Duration
|
|
min: 5
|
|
max: 240
|
|
step: 5
|
|
mode: box
|
|
|
|
guest_bathroom_lights:
|
|
name: Guest Bathroom Lights Duration
|
|
min: 5
|
|
max: 240
|
|
step: 5
|
|
mode: box
|
|
master_bathroom_lights:
|
|
name: Master Bathroom Lights Duration
|
|
min: 5
|
|
max: 240
|
|
step: 5
|
|
mode: box
|
|
garage_lights:
|
|
name: Garage Lights Duration
|
|
min: 5
|
|
max: 240
|
|
step: 5
|
|
mode: box
|
|
garage_shop_lights:
|
|
name: Garage Shop Lights Duration
|
|
min: 5
|
|
max: 240
|
|
step: 5
|
|
mode: box
|
|
|
|
######################### CLOSET LIGHTS
|
|
hasika_bedroom_closet_lights:
|
|
name: Hasika Closet Lights Duration
|
|
min: 5
|
|
max: 120
|
|
step: 5
|
|
mode: box
|
|
srinika_bedroom_closet_lights:
|
|
name: Srinika Closet Lights Duration
|
|
min: 5
|
|
max: 120
|
|
step: 5
|
|
mode: box
|
|
|
|
sensor:
|
|
- platform: template
|
|
sensors:
|
|
wakeup_hour:
|
|
friendly_name: Wakeup Hour
|
|
value_template: >
|
|
{% if states('sensor.season') | lower == "summer" %}
|
|
{{ states('input_datetime.summer_wakeup_time').split(':')[0] }}
|
|
{% elif states('sensor.season') | lower == "autumn" %}
|
|
{{ states('input_datetime.autumn_wakeup_time').split(':')[0] }}
|
|
{% elif states('sensor.season') | lower == "winter" %}
|
|
{{ states('input_datetime.winter_wakeup_time').split(':')[0] }}
|
|
{% elif states('sensor.season') | lower == "spring" %}
|
|
{{ states('input_datetime.spring_wakeup_time').split(':')[0] }}
|
|
{% else %}
|
|
6
|
|
{% endif %}
|
|
wakeup_minute:
|
|
friendly_name: Wakeup Minute
|
|
value_template: >
|
|
{% if states('sensor.season') | lower == "summer" %}
|
|
{{ states('input_datetime.summer_wakeup_time').split(':')[1] }}
|
|
{% elif states('sensor.season') | lower == "autumn" %}
|
|
{{ states('input_datetime.autumn_wakeup_time').split(':')[1] }}
|
|
{% elif states('sensor.season') | lower == "winter" %}
|
|
{{ states('input_datetime.winter_wakeup_time').split(':')[1] }}
|
|
{% elif states('sensor.season') | lower == "spring" %}
|
|
{{ states('input_datetime.spring_wakeup_time').split(':')[1] }}
|
|
{% else %}
|
|
0
|
|
{% endif %}
|
|
bedtime_hour:
|
|
friendly_name: Bedtime Hour
|
|
value_template: >
|
|
{% if states('sensor.season') | lower == "summer" %}
|
|
{{ states('input_datetime.summer_bed_time').split(':')[0] }}
|
|
{% elif states('sensor.season') | lower == "autumn" %}
|
|
{{ states('input_datetime.autumn_bed_time').split(':')[0] }}
|
|
{% elif states('sensor.season') | lower == "winter" %}
|
|
{{ states('input_datetime.winter_bed_time').split(':')[0] }}
|
|
{% elif states('sensor.season') | lower == "spring" %}
|
|
{{ states('input_datetime.spring_bed_time').split(':')[0] }}
|
|
{% else %}
|
|
0
|
|
{% endif %}
|
|
bedtime_minute:
|
|
friendly_name: Bedtime Minute
|
|
value_template: >
|
|
{% if states('sensor.season') | lower == "summer" %}
|
|
{{ states('input_datetime.summer_bed_time').split(':')[1] }}
|
|
{% elif states('sensor.season') | lower == "autumn" %}
|
|
{{ states('input_datetime.autumn_bed_time').split(':')[1] }}
|
|
{% elif states('sensor.season') | lower == "winter" %}
|
|
{{ states('input_datetime.winter_bed_time').split(':')[1] }}
|
|
{% elif states('sensor.season') | lower == "spring" %}
|
|
{{ states('input_datetime.spring_bed_time').split(':')[1] }}
|
|
{% else %}
|
|
0
|
|
{% endif %}
|
|
|
|
# Input Booleans Options
|
|
###############################################################################
|
|
|
|
input_boolean:
|
|
do_not_disturb:
|
|
name: Do Not Disturb
|
|
initial: off
|
|
icon: mdi:do-not-disturb
|
|
|
|
movie_time:
|
|
name: "Movie Time"
|
|
icon: mdi:movie-roll
|
|
|
|
stream_camera2chromecast:
|
|
name: Stream Cameras to Chromecast
|
|
icon: mdi:cctv
|
|
|
|
home_security:
|
|
name: Home Security System
|
|
icon: mdi:verified
|
|
|
|
home_assistant_status:
|
|
name: Home Status
|
|
icon: mdi:home-assistant
|
|
|
|
working_in_garage:
|
|
name: Working in Garage
|
|
icon: mdi:worker
|
|
|
|
working_in_office_room:
|
|
name: Working in Office Room
|
|
icon: mdi:worker
|
|
|
|
hourly_report:
|
|
name: Hourly Report
|
|
icon: mdi:file-chart
|
|
|
|
nightly_report:
|
|
name: Nightly Report
|
|
icon: mdi:file-chart
|
|
|
|
enjoyable_weather_reminders:
|
|
name: Remind me to enjoy Good Weather
|
|
icon: mdi:weather-sunny
|
|
|
|
security_system_alerts:
|
|
name: Security System Alerts
|
|
icon: mdi:security
|
|
|
|
trash_alerts:
|
|
name: Trash Alerts
|
|
icon: mdi:recycle
|
|
|
|
garage_door_notifications:
|
|
name: Garage Door Alerts
|
|
icon: mdi:garage
|
|
|
|
zone_alerts:
|
|
name: Zone Alerts
|
|
icon: mdi:map-marker
|
|
|
|
battery_alerts:
|
|
name: Battery Alerts
|
|
icon: mdi:battery
|
|
|
|
camera_alerts:
|
|
name: Camera Alerts
|
|
icon: mdi:camera
|
|
|
|
dummy:
|
|
name: "Dummy Input Boolean!"
|
|
icon: mdi:sticker-emoji
|
|
initial: on
|
|
|
|
light_automations:
|
|
name: Light Automations
|
|
icon: mdi:lightbulb-on
|
|
|
|
# Notifications
|
|
telegram_notifications:
|
|
name: Telegram Notifications
|
|
icon: mdi:message
|
|
|
|
firetv_notifications:
|
|
name: FireTV Notifications
|
|
icon: mdi:television
|
|
|
|
email_notifications:
|
|
name: Email Notifications
|
|
icon: mdi:email
|
|
|
|
voice_notifications:
|
|
name: Voice Notifications
|
|
icon: mdi:volume-off
|
|
|
|
led_notifications:
|
|
name: LED Notifications
|
|
icon: mdi:led-strip
|
|
|
|
###############################################################################
|
|
# _ _ _
|
|
# /\ | | | | (_)
|
|
# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
|
|
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
|
|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
|
|
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
|
|
#
|
|
###############################################################################
|
|
|
|
automation:
|
|
# Do not disturb for 2 hours
|
|
# Simply turns ON the Do Not Disturb Flag ad resets
|
|
# after 2 hours. The Do Not Disturb flag is used in
|
|
# voice_notify script
|
|
######################################################
|
|
- alias: Do Not Disturb For 2 hours
|
|
initial_state: true
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.do_not_disturb
|
|
to: "on"
|
|
for:
|
|
hours: 2
|
|
minutes: 0
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
entity_id: input_boolean.do_not_disturb
|
|
|
|
######################################################
|
|
# Reset Movie time after 3 hours
|
|
- alias: Reset Movie Time After 3 Hours
|
|
initial_state: true
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.movie_time
|
|
to: "on"
|
|
for:
|
|
hours: 3
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
entity_id: input_boolean.movie_time
|
|
|
|
# Notify me when DO NOT DISTURB mode is changed
|
|
######################################################
|
|
- alias: Do Not Disturb State Change
|
|
initial_state: true
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.do_not_disturb
|
|
action:
|
|
- service: script.notify_family
|
|
data:
|
|
message: "The Do Not Disturb Mode is {{ trigger.to_state.state |upper }}."
|
|
notify_options:
|
|
- led
|
|
|
|
# Hourly Reports
|
|
######################################################
|
|
- alias: Hourly Report During Day Time
|
|
initial_state: true
|
|
trigger:
|
|
platform: time_pattern
|
|
hours: "/01"
|
|
minutes: 05
|
|
seconds: 00
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ states.input_boolean.hourly_report.state == "on" }}'
|
|
- condition: template
|
|
value_template: >
|
|
{% set hour = now().hour | int %}
|
|
{% if hour > 7 and hour < 21 %}
|
|
true
|
|
{% else %}
|
|
false
|
|
{% endif %}
|
|
action:
|
|
- service: script.home_status
|