mysmarthome/packages/daily_routines.yaml

297 lines
12 KiB
YAML
Raw Normal View History

2019-04-17 22:46:06 +00:00
###############################################################################
# @author : Mahasri Kalavala
# @date : 04/15/2017
2019-12-20 15:32:28 +00:00
# @package : Daily Light Routine around the house
2019-04-17 22:46:06 +00:00
# @description : Daily light routine stuff
###############################################################################
automation:
2019-12-20 15:32:28 +00:00
# ÛÛÛÛÛÛ ÛÛÛÛÛÛ ÛÛÛ
# °°ÛÛÛÛÛÛ ÛÛÛÛÛÛ °°°
# °ÛÛÛ°ÛÛÛÛÛ°ÛÛÛ ÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ
# °ÛÛÛ°°ÛÛÛ °ÛÛÛ ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ °°ÛÛÛ °°ÛÛÛ°°ÛÛÛ ÛÛÛ°°ÛÛÛ
# °ÛÛÛ °°° °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °°° °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
# °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
# ÛÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛ
# °°°°° °°°°° °°°°°° °°°°° °°°° °°°°° °°°°° °°°° °°°°° °°°°°ÛÛÛ
# ÛÛÛ °ÛÛÛ
# °°ÛÛÛÛÛÛ
# °°°°°°
###############################################################################
# Turn Indoor lights ON only during weekdays
###############################################################################
2019-04-17 22:46:06 +00:00
- alias: Morning Indoor Lights ON
initial_state: true
trigger:
platform: time_pattern
2019-12-20 15:32:28 +00:00
minutes: "/5"
2019-04-17 22:46:06 +00:00
seconds: 00
condition:
- condition: state
2019-12-20 15:32:28 +00:00
entity_id: "binary_sensor.workday_sensor"
state: "on"
2019-04-17 22:46:06 +00:00
- condition: template
2019-12-20 15:32:28 +00:00
value_template: "{{ states('sensor.wakeup_hour') |int == now().hour |int }}"
2019-04-17 22:46:06 +00:00
- condition: template
2019-12-20 15:32:28 +00:00
value_template: "{{ states('sensor.wakeup_minute') |int == now().minute|int }}"
2019-04-17 22:46:06 +00:00
- condition: state
entity_id: input_boolean.light_automations
2019-12-20 15:32:28 +00:00
state: "on"
2019-04-17 22:46:06 +00:00
action:
- service: switch.turn_on
data:
entity_id: switch.kitchen
2019-12-20 15:32:28 +00:00
###############################################################################
# Turn ON Master Bedroom lights ON in the morning
# Turn On Bedroom Lights 10 minutes after wake up time
###############################################################################
2019-04-17 22:46:06 +00:00
- alias: Morning Master Bedroom Lights ON (Mallika)
initial_state: true
trigger:
platform: time_pattern
2019-12-20 15:32:28 +00:00
minutes: "/5"
2019-04-17 22:46:06 +00:00
seconds: 00
condition:
- condition: state
2019-12-20 15:32:28 +00:00
entity_id: "binary_sensor.workday_sensor"
state: "on"
2019-04-17 22:46:06 +00:00
- condition: template
2019-12-20 15:32:28 +00:00
value_template: "{{ states('sensor.wakeup_hour') |int == now().hour|int }}"
2019-04-17 22:46:06 +00:00
- condition: template
2019-12-20 15:32:28 +00:00
value_template: "{{ now().minute | int == (states('sensor.wakeup_minute') | int + 10) }}"
2019-04-17 22:46:06 +00:00
- condition: state
entity_id: input_boolean.light_automations
2019-12-20 15:32:28 +00:00
state: "on"
2019-04-17 22:46:06 +00:00
action:
- service: light.turn_on
data:
entity_id: light.master_bedroom_2
transition: 15
brightness: 25
color_temp: 154
- alias: Morning Master Bedroom Lights OFF (Mallika)
initial_state: true
trigger:
platform: time_pattern
2019-12-20 15:32:28 +00:00
minutes: "/5"
2019-04-17 22:46:06 +00:00
seconds: 00
condition:
- condition: state
2019-12-20 15:32:28 +00:00
entity_id: "binary_sensor.workday_sensor"
state: "on"
2019-04-17 22:46:06 +00:00
- condition: template
2019-12-20 15:32:28 +00:00
value_template: "{{ states('sensor.wakeup_hour') |int == now().hour|int }}"
2019-04-17 22:46:06 +00:00
- condition: template
2019-12-20 15:32:28 +00:00
value_template: "{{ now().minute|int == (states('sensor.wakeup_minute') |int + 15) }}"
2019-04-17 22:46:06 +00:00
- condition: state
entity_id: input_boolean.light_automations
2019-12-20 15:32:28 +00:00
state: "on"
2019-04-17 22:46:06 +00:00
action:
- service: light.turn_off
data:
entity_id: light.master_bedroom_2
2019-12-20 15:32:28 +00:00
###############################################################################
# Turn off outdoor lights 15 minutes after sunrise
###############################################################################
2019-04-17 22:46:06 +00:00
- alias: Morning Outdoor Lights OFF
initial_state: true
trigger:
platform: sun
event: sunrise
2019-12-20 15:32:28 +00:00
offset: "00:15:00"
2019-04-17 22:46:06 +00:00
condition:
- condition: state
entity_id: input_boolean.light_automations
2019-12-20 15:32:28 +00:00
state: "on"
2019-04-17 22:46:06 +00:00
action:
- service: switch.turn_off
entity_id: switch.frontyard_light
- service: switch.turn_off
entity_id: switch.wemobackyardlightswitch
2019-12-20 15:32:28 +00:00
###############################################################################
# Turn OF Kitchen Lights after 3 hours of wake up time during school/work days
###############################################################################
2019-04-17 22:46:06 +00:00
- alias: Morning Kitchen Light OFF
initial_state: true
trigger:
platform: time_pattern
2019-12-20 15:32:28 +00:00
minutes: "/5"
2019-04-17 22:46:06 +00:00
seconds: 00
condition:
- condition: state
2019-12-20 15:32:28 +00:00
entity_id: "binary_sensor.workday_sensor"
state: "on"
2019-04-17 22:46:06 +00:00
- condition: template
2019-12-20 15:32:28 +00:00
value_template: "{{ now().hour|int == (states('sensor.wakeup_hour') |int + 3) }}"
2019-04-17 22:46:06 +00:00
- condition: template
2019-12-20 15:32:28 +00:00
value_template: "{{ states('sensor.wakeup_minute') |int == now().minute|int }}"
2019-04-17 22:46:06 +00:00
- condition: state
entity_id: input_boolean.light_automations
2019-12-20 15:32:28 +00:00
state: "on"
2019-04-17 22:46:06 +00:00
action:
2019-12-20 15:32:28 +00:00
- service: switch.turn_off
entity_id: switch.kitchen
2019-04-17 22:46:06 +00:00
2019-12-20 15:32:28 +00:00
# ÛÛÛÛÛÛÛÛÛÛ ÛÛÛ
# °°ÛÛÛ°°°°°Û °°°
# °ÛÛÛ Û ° ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ
# °ÛÛÛÛÛÛ °°ÛÛÛ °°ÛÛÛ ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ °°ÛÛÛ °°ÛÛÛ°°ÛÛÛ ÛÛÛ°°ÛÛÛ
# °ÛÛÛ°°Û °ÛÛÛ °ÛÛÛ °ÛÛÛÛÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
# °ÛÛÛ ° Û °°ÛÛÛ ÛÛÛ °ÛÛÛ°°° °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
# ÛÛÛÛÛÛÛÛÛÛ °°ÛÛÛÛÛ °°ÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛ
# °°°°°°°°°° °°°°° °°°°°° °°°° °°°°° °°°°° °°°° °°°°° °°°°°ÛÛÛ
# ÛÛÛ °ÛÛÛ
# °°ÛÛÛÛÛÛ
# °°°°°°
###############################################################################
# Turn outdoor lights on 15 minutes before sunset
###############################################################################
2019-04-17 22:46:06 +00:00
- alias: Evening Outdoor Lights ON (At Sunset)
initial_state: true
trigger:
platform: sun
event: sunset
2019-12-20 15:32:28 +00:00
offset: "+00:00:00"
2019-04-17 22:46:06 +00:00
condition:
- condition: state
entity_id: input_boolean.light_automations
2019-12-20 15:32:28 +00:00
state: "on"
2019-04-17 22:46:06 +00:00
action:
- service: switch.turn_on
entity_id: switch.frontyard_light
- service: switch.turn_on
entity_id: switch.wemobackyardlightswitch
2019-12-20 15:32:28 +00:00
###############################################################################
# Turn indoor lights on 30 minutes before sunset
###############################################################################
2019-04-17 22:46:06 +00:00
- alias: Evening Indoor Lights ON Before Sunset
initial_state: true
trigger:
platform: sun
event: sunset
2019-12-20 15:32:28 +00:00
offset: "-00:30:00"
2019-04-17 22:46:06 +00:00
condition:
- condition: state
entity_id: input_boolean.light_automations
2019-12-20 15:32:28 +00:00
state: "on"
2019-05-14 23:32:32 +00:00
- condition: state
entity_id: input_boolean.movie_time
2019-12-20 15:32:28 +00:00
state: "off"
2019-04-17 22:46:06 +00:00
action:
- service: switch.turn_on
data:
entity_id: switch.kitchen
- service: light.turn_on
data:
entity_id: light.hue_color_lamp_1
transition: 15
brightness: 255
color_temp: 154
- service: light.turn_on
data:
entity_id: light.hue_color_lamp_2
transition: 15
brightness: 255
color_temp: 154
- service: light.turn_on
data:
entity_id: light.hue_color_lamp_3
transition: 15
brightness: 255
color_temp: 154
- service: light.turn_on
data:
entity_id: light.master_bedroom_1
brightness: 25
color_temp: 366
- service: light.turn_on
data:
entity_id: light.master_bedroom_2
brightness: 25
color_temp: 366
- service: switch.turn_on
entity_id: switch.zwave_smart_switch_switch
- service: switch.turn_on
entity_id: switch.kids_bed_accent
2019-12-20 15:32:28 +00:00
# ÛÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ
# °°ÛÛÛÛÛÛ °°ÛÛÛ °°° °°ÛÛÛ °°ÛÛÛ
# °ÛÛÛ°ÛÛÛ °ÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛ °ÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ
# °ÛÛÛ°°ÛÛÛ°ÛÛÛ °°ÛÛÛ ÛÛÛ°°ÛÛÛ °ÛÛÛ°°ÛÛÛ °°°ÛÛÛ°
# °ÛÛÛ °°ÛÛÛÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
# °ÛÛÛ °°ÛÛÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ ÛÛÛ
# ÛÛÛÛÛ °°ÛÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ °°ÛÛÛÛÛ
# °°°°° °°°°° °°°°° °°°°°ÛÛÛ°°°° °°°°° °°°°°
# ÛÛÛ °ÛÛÛ
# °°ÛÛÛÛÛÛ
# °°°°°°
###############################################################################
# Set the mood for bed time - Dim Family Room lights if they are ON
###############################################################################
2019-04-17 22:46:06 +00:00
- alias: Night Dim TV Lights
initial_state: true
trigger:
platform: time_pattern
2019-12-20 15:32:28 +00:00
minutes: "/5"
2019-04-17 22:46:06 +00:00
seconds: 00
condition:
- condition: template
2019-12-20 15:32:28 +00:00
value_template: "{{ states('sensor.bedtime_hour') |int == now().hour|int }}"
2019-04-17 22:46:06 +00:00
- condition: template
2019-12-20 15:32:28 +00:00
value_template: "{{ (states('sensor.bedtime_minute') |int - 15 ) == now().minute|int }}"
2019-04-17 22:46:06 +00:00
- condition: state
entity_id: light.family_room
2019-12-20 15:32:28 +00:00
state: "on"
2019-04-17 22:46:06 +00:00
- condition: state
entity_id: input_boolean.light_automations
2019-12-20 15:32:28 +00:00
state: "on"
2019-04-17 22:46:06 +00:00
action:
- service: light.turn_on
data:
entity_id: light.family_room
brightness: 30
color_temp: 154
transition: 15
2019-12-20 15:32:28 +00:00
###############################################################################
# TURN INDOOR LIGHTS OFF AFTER BED TIME
###############################################################################
2019-04-17 22:46:06 +00:00
- alias: Night Turn Lights Off
initial_state: true
trigger:
platform: time_pattern
2019-12-20 15:32:28 +00:00
minutes: "/5"
2019-04-17 22:46:06 +00:00
seconds: 00
condition:
- condition: template
2019-12-20 15:32:28 +00:00
value_template: "{{ states('sensor.bedtime_hour') |int == now().hour|int }}"
2019-04-17 22:46:06 +00:00
- condition: template
2019-12-20 15:32:28 +00:00
value_template: "{{ states('sensor.bedtime_minute') |int == now().minute|int }}"
2019-04-17 22:46:06 +00:00
- condition: state
entity_id: input_boolean.light_automations
2019-12-20 15:32:28 +00:00
state: "on"
2019-04-17 22:46:06 +00:00
action:
- service: script.all_indoor_lights_off
- service: script.notify_me
2019-12-20 15:32:28 +00:00
data:
2019-04-17 22:46:06 +00:00
message: "It is bed time, turned lights off!"
2019-12-20 15:32:28 +00:00
###############################################################################
# Provide Bed time Report via TTS
###############################################################################
2019-04-17 22:46:06 +00:00
- alias: Night Bedtime Report
initial_state: true
trigger:
platform: time
2019-12-20 15:32:28 +00:00
at: "22:10:00"
2019-04-17 22:46:06 +00:00
condition:
- condition: template
value_template: "{{ states('input_boolean.nightly_report') == 'on' }}"
action:
2019-12-20 15:32:28 +00:00
- service: script.good_night_tts