mirror of
https://github.com/skalavala/mysmarthome.git
synced 2025-08-28 08:50:57 +00:00
micor changes and clean up.
This commit is contained in:
@@ -1,69 +1,68 @@
|
||||
###############################################################################
|
||||
# @author : Mahasri Kalavala
|
||||
# @date : 04/15/2017
|
||||
# @package : Daily Light Routine around the house
|
||||
# @package : Daily Light Routine around the house
|
||||
# @description : Daily light routine stuff
|
||||
###############################################################################
|
||||
|
||||
automation:
|
||||
|
||||
# ÛÛÛÛÛÛ ÛÛÛÛÛÛ ÛÛÛ
|
||||
# °°ÛÛÛÛÛÛ ÛÛÛÛÛÛ °°°
|
||||
# °ÛÛÛ°ÛÛÛÛÛ°ÛÛÛ ÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ
|
||||
# °ÛÛÛ°°ÛÛÛ °ÛÛÛ ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ °°ÛÛÛ °°ÛÛÛ°°ÛÛÛ ÛÛÛ°°ÛÛÛ
|
||||
# °ÛÛÛ °°° °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °°° °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
|
||||
# °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
|
||||
# ÛÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛ
|
||||
# °°°°° °°°°° °°°°°° °°°°° °°°° °°°°° °°°°° °°°° °°°°° °°°°°ÛÛÛ
|
||||
# ÛÛÛ °ÛÛÛ
|
||||
# °°ÛÛÛÛÛÛ
|
||||
# °°°°°°
|
||||
###############################################################################
|
||||
# Turn Indoor lights ON only during weekdays
|
||||
###############################################################################
|
||||
# ÛÛÛÛÛÛ ÛÛÛÛÛÛ ÛÛÛ
|
||||
# °°ÛÛÛÛÛÛ ÛÛÛÛÛÛ °°°
|
||||
# °ÛÛÛ°ÛÛÛÛÛ°ÛÛÛ ÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ
|
||||
# °ÛÛÛ°°ÛÛÛ °ÛÛÛ ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ °°ÛÛÛ °°ÛÛÛ°°ÛÛÛ ÛÛÛ°°ÛÛÛ
|
||||
# °ÛÛÛ °°° °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °°° °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
|
||||
# °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
|
||||
# ÛÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛ
|
||||
# °°°°° °°°°° °°°°°° °°°°° °°°° °°°°° °°°°° °°°° °°°°° °°°°°ÛÛÛ
|
||||
# ÛÛÛ °ÛÛÛ
|
||||
# °°ÛÛÛÛÛÛ
|
||||
# °°°°°°
|
||||
###############################################################################
|
||||
# Turn Indoor lights ON only during weekdays
|
||||
###############################################################################
|
||||
- alias: Morning Indoor Lights ON
|
||||
initial_state: true
|
||||
trigger:
|
||||
platform: time_pattern
|
||||
minutes: '/5'
|
||||
minutes: "/5"
|
||||
seconds: 00
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: 'binary_sensor.workday_sensor'
|
||||
state: 'on'
|
||||
entity_id: "binary_sensor.workday_sensor"
|
||||
state: "on"
|
||||
- condition: template
|
||||
value_template: '{{ states.sensor.wakeup_hour.state |int == now().hour |int }}'
|
||||
value_template: "{{ states('sensor.wakeup_hour') |int == now().hour |int }}"
|
||||
- condition: template
|
||||
value_template: '{{ states.sensor.wakeup_minute.state|int == now().minute|int }}'
|
||||
value_template: "{{ states('sensor.wakeup_minute') |int == now().minute|int }}"
|
||||
- condition: state
|
||||
entity_id: input_boolean.light_automations
|
||||
state: 'on'
|
||||
state: "on"
|
||||
action:
|
||||
- service: switch.turn_on
|
||||
data:
|
||||
entity_id: switch.kitchen
|
||||
|
||||
###############################################################################
|
||||
# Turn ON Master Bedroom lights ON in the morning
|
||||
# Turn On Bedroom Lights 10 minutes after wake up time
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
# Turn ON Master Bedroom lights ON in the morning
|
||||
# Turn On Bedroom Lights 10 minutes after wake up time
|
||||
###############################################################################
|
||||
- alias: Morning Master Bedroom Lights ON (Mallika)
|
||||
initial_state: true
|
||||
trigger:
|
||||
platform: time_pattern
|
||||
minutes: '/5'
|
||||
minutes: "/5"
|
||||
seconds: 00
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: 'binary_sensor.workday_sensor'
|
||||
state: 'on'
|
||||
entity_id: "binary_sensor.workday_sensor"
|
||||
state: "on"
|
||||
- condition: template
|
||||
value_template: '{{ states.sensor.wakeup_hour.state |int == now().hour|int }}'
|
||||
value_template: "{{ states('sensor.wakeup_hour') |int == now().hour|int }}"
|
||||
- condition: template
|
||||
value_template: '{{ now().minute | int == (states.sensor.wakeup_minute.state | int + 10) }}'
|
||||
value_template: "{{ now().minute | int == (states('sensor.wakeup_minute') | int + 10) }}"
|
||||
- condition: state
|
||||
entity_id: input_boolean.light_automations
|
||||
state: 'on'
|
||||
state: "on"
|
||||
action:
|
||||
- service: light.turn_on
|
||||
data:
|
||||
@@ -76,113 +75,113 @@ automation:
|
||||
initial_state: true
|
||||
trigger:
|
||||
platform: time_pattern
|
||||
minutes: '/5'
|
||||
minutes: "/5"
|
||||
seconds: 00
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: 'binary_sensor.workday_sensor'
|
||||
state: 'on'
|
||||
entity_id: "binary_sensor.workday_sensor"
|
||||
state: "on"
|
||||
- condition: template
|
||||
value_template: '{{ states.sensor.wakeup_hour.state|int == now().hour|int }}'
|
||||
value_template: "{{ states('sensor.wakeup_hour') |int == now().hour|int }}"
|
||||
- condition: template
|
||||
value_template: '{{ now().minute|int == (states.sensor.wakeup_minute.state|int + 15) }}'
|
||||
value_template: "{{ now().minute|int == (states('sensor.wakeup_minute') |int + 15) }}"
|
||||
- condition: state
|
||||
entity_id: input_boolean.light_automations
|
||||
state: 'on'
|
||||
state: "on"
|
||||
action:
|
||||
- service: light.turn_off
|
||||
data:
|
||||
entity_id: light.master_bedroom_2
|
||||
|
||||
###############################################################################
|
||||
# Turn off outdoor lights 15 minutes after sunrise
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
# Turn off outdoor lights 15 minutes after sunrise
|
||||
###############################################################################
|
||||
- alias: Morning Outdoor Lights OFF
|
||||
initial_state: true
|
||||
trigger:
|
||||
platform: sun
|
||||
event: sunrise
|
||||
offset: '00:15:00'
|
||||
offset: "00:15:00"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.light_automations
|
||||
state: 'on'
|
||||
state: "on"
|
||||
action:
|
||||
- service: switch.turn_off
|
||||
entity_id: switch.frontyard_light
|
||||
- service: switch.turn_off
|
||||
entity_id: switch.wemobackyardlightswitch
|
||||
|
||||
###############################################################################
|
||||
# Turn OF Kitchen Lights after 3 hours of wake up time during school/work days
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
# Turn OF Kitchen Lights after 3 hours of wake up time during school/work days
|
||||
###############################################################################
|
||||
- alias: Morning Kitchen Light OFF
|
||||
initial_state: true
|
||||
trigger:
|
||||
platform: time_pattern
|
||||
minutes: '/5'
|
||||
minutes: "/5"
|
||||
seconds: 00
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: 'binary_sensor.workday_sensor'
|
||||
state: 'on'
|
||||
entity_id: "binary_sensor.workday_sensor"
|
||||
state: "on"
|
||||
- condition: template
|
||||
value_template: '{{ now().hour|int == (states.sensor.wakeup_hour.state|int + 3) }}'
|
||||
value_template: "{{ now().hour|int == (states('sensor.wakeup_hour') |int + 3) }}"
|
||||
- condition: template
|
||||
value_template: '{{ states.sensor.wakeup_minute.state|int == now().minute|int }}'
|
||||
value_template: "{{ states('sensor.wakeup_minute') |int == now().minute|int }}"
|
||||
- condition: state
|
||||
entity_id: input_boolean.light_automations
|
||||
state: 'on'
|
||||
state: "on"
|
||||
action:
|
||||
- service: switch.turn_off
|
||||
entity_id: switch.kitchen
|
||||
- service: switch.turn_off
|
||||
entity_id: switch.kitchen
|
||||
|
||||
# ÛÛÛÛÛÛÛÛÛÛ ÛÛÛ
|
||||
# °°ÛÛÛ°°°°°Û °°°
|
||||
# °ÛÛÛ Û ° ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ
|
||||
# °ÛÛÛÛÛÛ °°ÛÛÛ °°ÛÛÛ ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ °°ÛÛÛ °°ÛÛÛ°°ÛÛÛ ÛÛÛ°°ÛÛÛ
|
||||
# °ÛÛÛ°°Û °ÛÛÛ °ÛÛÛ °ÛÛÛÛÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
|
||||
# °ÛÛÛ ° Û °°ÛÛÛ ÛÛÛ °ÛÛÛ°°° °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
|
||||
# ÛÛÛÛÛÛÛÛÛÛ °°ÛÛÛÛÛ °°ÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛ
|
||||
# °°°°°°°°°° °°°°° °°°°°° °°°° °°°°° °°°°° °°°° °°°°° °°°°°ÛÛÛ
|
||||
# ÛÛÛ °ÛÛÛ
|
||||
# °°ÛÛÛÛÛÛ
|
||||
# °°°°°°
|
||||
###############################################################################
|
||||
# Turn outdoor lights on 15 minutes before sunset
|
||||
###############################################################################
|
||||
# ÛÛÛÛÛÛÛÛÛÛ ÛÛÛ
|
||||
# °°ÛÛÛ°°°°°Û °°°
|
||||
# °ÛÛÛ Û ° ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ
|
||||
# °ÛÛÛÛÛÛ °°ÛÛÛ °°ÛÛÛ ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ °°ÛÛÛ °°ÛÛÛ°°ÛÛÛ ÛÛÛ°°ÛÛÛ
|
||||
# °ÛÛÛ°°Û °ÛÛÛ °ÛÛÛ °ÛÛÛÛÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
|
||||
# °ÛÛÛ ° Û °°ÛÛÛ ÛÛÛ °ÛÛÛ°°° °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
|
||||
# ÛÛÛÛÛÛÛÛÛÛ °°ÛÛÛÛÛ °°ÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛ
|
||||
# °°°°°°°°°° °°°°° °°°°°° °°°° °°°°° °°°°° °°°° °°°°° °°°°°ÛÛÛ
|
||||
# ÛÛÛ °ÛÛÛ
|
||||
# °°ÛÛÛÛÛÛ
|
||||
# °°°°°°
|
||||
###############################################################################
|
||||
# Turn outdoor lights on 15 minutes before sunset
|
||||
###############################################################################
|
||||
- alias: Evening Outdoor Lights ON (At Sunset)
|
||||
initial_state: true
|
||||
trigger:
|
||||
platform: sun
|
||||
event: sunset
|
||||
offset: '+00:00:00'
|
||||
offset: "+00:00:00"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.light_automations
|
||||
state: 'on'
|
||||
state: "on"
|
||||
action:
|
||||
- service: switch.turn_on
|
||||
entity_id: switch.frontyard_light
|
||||
- service: switch.turn_on
|
||||
entity_id: switch.wemobackyardlightswitch
|
||||
|
||||
###############################################################################
|
||||
# Turn indoor lights on 30 minutes before sunset
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
# Turn indoor lights on 30 minutes before sunset
|
||||
###############################################################################
|
||||
- alias: Evening Indoor Lights ON Before Sunset
|
||||
initial_state: true
|
||||
trigger:
|
||||
platform: sun
|
||||
event: sunset
|
||||
offset: '-00:30:00'
|
||||
offset: "-00:30:00"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.light_automations
|
||||
state: 'on'
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: input_boolean.movie_time
|
||||
state: 'off'
|
||||
state: "off"
|
||||
action:
|
||||
- service: switch.turn_on
|
||||
data:
|
||||
@@ -220,37 +219,37 @@ automation:
|
||||
- service: switch.turn_on
|
||||
entity_id: switch.kids_bed_accent
|
||||
|
||||
# ÛÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ
|
||||
# °°ÛÛÛÛÛÛ °°ÛÛÛ °°° °°ÛÛÛ °°ÛÛÛ
|
||||
# °ÛÛÛ°ÛÛÛ °ÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛ °ÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ
|
||||
# °ÛÛÛ°°ÛÛÛ°ÛÛÛ °°ÛÛÛ ÛÛÛ°°ÛÛÛ °ÛÛÛ°°ÛÛÛ °°°ÛÛÛ°
|
||||
# °ÛÛÛ °°ÛÛÛÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
|
||||
# °ÛÛÛ °°ÛÛÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ ÛÛÛ
|
||||
# ÛÛÛÛÛ °°ÛÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ °°ÛÛÛÛÛ
|
||||
# °°°°° °°°°° °°°°° °°°°°ÛÛÛ°°°° °°°°° °°°°°
|
||||
# ÛÛÛ °ÛÛÛ
|
||||
# °°ÛÛÛÛÛÛ
|
||||
# °°°°°°
|
||||
###############################################################################
|
||||
# Set the mood for bed time - Dim Family Room lights if they are ON
|
||||
###############################################################################
|
||||
# ÛÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ
|
||||
# °°ÛÛÛÛÛÛ °°ÛÛÛ °°° °°ÛÛÛ °°ÛÛÛ
|
||||
# °ÛÛÛ°ÛÛÛ °ÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛ °ÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ
|
||||
# °ÛÛÛ°°ÛÛÛ°ÛÛÛ °°ÛÛÛ ÛÛÛ°°ÛÛÛ °ÛÛÛ°°ÛÛÛ °°°ÛÛÛ°
|
||||
# °ÛÛÛ °°ÛÛÛÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
|
||||
# °ÛÛÛ °°ÛÛÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ ÛÛÛ
|
||||
# ÛÛÛÛÛ °°ÛÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ °°ÛÛÛÛÛ
|
||||
# °°°°° °°°°° °°°°° °°°°°ÛÛÛ°°°° °°°°° °°°°°
|
||||
# ÛÛÛ °ÛÛÛ
|
||||
# °°ÛÛÛÛÛÛ
|
||||
# °°°°°°
|
||||
###############################################################################
|
||||
# Set the mood for bed time - Dim Family Room lights if they are ON
|
||||
###############################################################################
|
||||
- alias: Night Dim TV Lights
|
||||
initial_state: true
|
||||
trigger:
|
||||
platform: time_pattern
|
||||
minutes: '/5'
|
||||
minutes: "/5"
|
||||
seconds: 00
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: '{{ states.sensor.bedtime_hour.state|int == now().hour|int }}'
|
||||
value_template: "{{ states('sensor.bedtime_hour') |int == now().hour|int }}"
|
||||
- condition: template
|
||||
value_template: '{{ (states.sensor.bedtime_minute.state|int - 15 ) == now().minute|int }}'
|
||||
value_template: "{{ (states('sensor.bedtime_minute') |int - 15 ) == now().minute|int }}"
|
||||
- condition: state
|
||||
entity_id: light.family_room
|
||||
state: 'on'
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: input_boolean.light_automations
|
||||
state: 'on'
|
||||
state: "on"
|
||||
action:
|
||||
- service: light.turn_on
|
||||
data:
|
||||
@@ -259,42 +258,42 @@ automation:
|
||||
color_temp: 154
|
||||
transition: 15
|
||||
|
||||
###############################################################################
|
||||
# TURN INDOOR LIGHTS OFF AFTER BED TIME
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
# TURN INDOOR LIGHTS OFF AFTER BED TIME
|
||||
###############################################################################
|
||||
- alias: Night Turn Lights Off
|
||||
initial_state: true
|
||||
trigger:
|
||||
platform: time_pattern
|
||||
minutes: '/5'
|
||||
minutes: "/5"
|
||||
seconds: 00
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: '{{ states.sensor.bedtime_hour.state|int == now().hour|int }}'
|
||||
value_template: "{{ states('sensor.bedtime_hour') |int == now().hour|int }}"
|
||||
- condition: template
|
||||
value_template: '{{ states.sensor.bedtime_minute.state|int == now().minute|int }}'
|
||||
value_template: "{{ states('sensor.bedtime_minute') |int == now().minute|int }}"
|
||||
- condition: state
|
||||
entity_id: input_boolean.light_automations
|
||||
state: 'on'
|
||||
state: "on"
|
||||
action:
|
||||
- service: script.all_indoor_lights_off
|
||||
- service: script.notify_me
|
||||
data:
|
||||
data:
|
||||
message: "It is bed time, turned lights off!"
|
||||
|
||||
###############################################################################
|
||||
# Provide Bed time Report via TTS
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
# Provide Bed time Report via TTS
|
||||
###############################################################################
|
||||
- alias: Night Bedtime Report
|
||||
initial_state: true
|
||||
trigger:
|
||||
platform: time
|
||||
at: '22:10:00'
|
||||
at: "22:10:00"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: group.all_devices
|
||||
state: 'home'
|
||||
state: "home"
|
||||
- condition: template
|
||||
value_template: "{{ states('input_boolean.nightly_report') == 'on' }}"
|
||||
action:
|
||||
- service: script.good_night_tts
|
||||
- service: script.good_night_tts
|
||||
|
Reference in New Issue
Block a user