Massive config migration - lots of moving around in prep for future projects

This commit is contained in:
Jeffrey Stone 2020-10-05 12:04:04 -04:00
parent 10c70a1950
commit 2f398c68ce
14 changed files with 374 additions and 556 deletions

1
.gitignore vendored
View File

@ -39,6 +39,7 @@ transporter.py
**.spotify-token-cache **.spotify-token-cache
**zones.yaml **zones.yaml
**test.yaml **test.yaml
**testing.yaml
**.homekit* **.homekit*
**.vscode **.vscode
**.pid **.pid

View File

@ -15,7 +15,6 @@
- data: - data:
entity_id: switch.upstairs_fan entity_id: switch.upstairs_fan
service: switch.turn_on service: switch.turn_on
- id: '1562066108032' - id: '1562066108032'
alias: Living Room Fan On alias: Living Room Fan On

View File

@ -278,16 +278,11 @@ group: !include groups.yaml
### Includes ### ### Includes ###
alert: !include_dir_merge_named alerts/ alert: !include_dir_merge_named alerts/
automation: !include automations.yaml automation: !include automations.yaml
script: !include_dir_merge_named scripts script: !include scripts.yaml
#automation: !include automations.yaml
sensor: !include_dir_merge_list sensors sensor: !include_dir_merge_list sensors
binary_sensor: !include_dir_merge_list binary_sensors binary_sensor: !include_dir_merge_list binary_sensors
#light: !include_dir_merge_list lights
light: !include lights.yaml light: !include lights.yaml
#switch: !include_dir_merge_list switches
switch: !include switches.yaml switch: !include switches.yaml
#script: !include_dir_merge_named scripts
#intent_script: !include intents/intents.yaml
scene: !include scenes.yaml scene: !include scenes.yaml
input_select: !include input_select.yaml input_select: !include input_select.yaml
input_boolean: !include input_boolean.yaml input_boolean: !include input_boolean.yaml

View File

@ -256,9 +256,9 @@ automation:
data_template: data_template:
time: > time: >
{% if states.calendar.skylar_school.attributes.offset_reached == True %} {% if states.calendar.skylar_school.attributes.offset_reached == True %}
07:00 06:15
{% else %} {% else %}
07:58 07:15
{% endif %} {% endif %}
- id: set_morning_report_time - id: set_morning_report_time
@ -272,7 +272,7 @@ automation:
data_template: data_template:
time: > time: >
{% if states.calendar.skylar_school.attributes.offset_reached == True %} {% if states.calendar.skylar_school.attributes.offset_reached == True %}
07:00 07:10
{% else %} {% else %}
08:00 08:00
{% endif %} {% endif %}

View File

@ -14,6 +14,14 @@ camera:
- platform: ffmpeg - platform: ffmpeg
input: !secret livingroom_cam # wyze cam v2 input: !secret livingroom_cam # wyze cam v2
name: livingroom name: livingroom
- platform: ffmpeg
input: !secret kitchen_cam # wyze cam v2
name: kitchen
- platform: ffmpeg
input: !secret theater_cam # wyze cam v2
name: theater
- platform: ffmpeg
input: !secret laundry_cam # wyze cam v2
name: laundry
ffmpeg: ffmpeg:
ffmpeg_bin: /usr/bin/ffmpeg ffmpeg_bin: /usr/bin/ffmpeg

View File

@ -69,8 +69,8 @@ automation:
entity_id: scene.skylar_room_prebed entity_id: scene.skylar_room_prebed
- id: jeff_lights_out - id: master_bedroom_lights_out
alias: Jeff lights out alias: Master Bedroom lights out
initial_state: true initial_state: true
trigger: trigger:
- platform: time - platform: time
@ -81,41 +81,24 @@ automation:
state: 'off' state: 'off'
action: action:
- service: scene.turn_on - service: scene.turn_on
entity_id: scene.jeff_light_off entity_id: scene.master_bedroom_off
- id: jeff_bedtime
alias: Jeff bedtime - id: master_bedroom_lights_out
initial_state: true alias: Master Bedroom lights out
trigger:
- platform: time
at: '22:00:00'
condition:
- condition: state
entity_id: light.jeff_light
state: 'on'
- condition: state
entity_id: input_boolean.vacation_mode
state: 'off'
action:
- service: scene.turn_on
entity_id: scene.jeff_bedtime
- id: jeff_night_light
alias: Jeff night light
initial_state: true initial_state: true
trigger: trigger:
- platform: time - platform: time
at: '22:30:00' at: '22:30:00'
condition: condition:
- condition: state
entity_id: light.jeff_light
state: 'on'
- condition: state - condition: state
entity_id: input_boolean.vacation_mode entity_id: input_boolean.vacation_mode
state: 'off' state: 'off'
action: action:
- service: scene.turn_on - service: scene.turn_on
entity_id: scene.jeff_night_light entity_id: scene.master_bedroom_dim
- id: jeff_light_on
alias: Jeff Light On - id: master_bedroom_lights_on
alias: Master Bedroom Lights On
initial_state: true initial_state: true
trigger: trigger:
- platform: time - platform: time
@ -126,34 +109,36 @@ automation:
state: 'off' state: 'off'
action: action:
- service: scene.turn_on - service: scene.turn_on
entity_id: scene.jeff_light_on entity_id: scene.master_bedroom_on
# - id: jeff_alarm
# alias: Jeff alarm
# initial_state: true
# trigger:
# - platform: time
# at: 05:15:00
# condition:
# - condition: state
# entity_id: input_boolean.vacation_mode
# state: 'off'
# action:
# - service: scene.turn_on
# entity_id: scene.jeff_night_light
# - id: jeff_wake_up - id: master_bedroom_alarm
# alias: Jeff wake up alias: Master bedroom alarm
# initial_state: true initial_state: true
# trigger: trigger:
# - platform: time - platform: time
# at: 04:30:00 at: 06:00:00
# condition: condition:
# - condition: state - condition: state
# entity_id: input_boolean.vacation_mode entity_id: input_boolean.vacation_mode
# state: 'off' state: 'off'
# action: action:
# - service: scene.turn_on - service: scene.turn_on
# entity_id: scene.jeff_wake_up entity_id: scene.master_bedroom_on
- id: master_bedroom_wake_up
alias: Master bedroom Wake Up
initial_state: true
trigger:
- platform: time
at: 05:50:00
condition:
- condition: state
entity_id: input_boolean.vacation_mode
state: 'off'
action:
- service: scene.turn_on
entity_id: scene.master_bedroom_dim
- id: good_night - id: good_night
alias: Good Night alias: Good Night
@ -268,31 +253,31 @@ automation:
"/config/www/tweet_images/sunrise3.jpg", "/config/www/tweet_images/sunrise3.jpg",
"/config/www/tweet_images/sunrise2.jpg"] | random }} "/config/www/tweet_images/sunrise2.jpg"] | random }}
- id: inside_on_sunset # - id: inside_on_sunset
alias: Inside on at Sunset # alias: Inside on at Sunset
initial_state: true # initial_state: true
trigger: # trigger:
- platform: sun # - platform: sun
event: sunset # event: sunset
offset: -02:00:00 # offset: -02:00:00
condition: # condition:
- condition: template # - condition: template
value_template: > # value_template: >
{%- if states.weather.klzu_hourly.state != "sunny" or states.weather.klzu_hourly.state != "partlycloudy" or states.weather.klzu_hourly.state != "clear" -%} # {%- if states.weather.klzu_hourly.state != "sunny" or states.weather.klzu_hourly.state != "partlycloudy" or states.weather.klzu_hourly.state != "clear" -%}
true # true
{%- endif -%} # {%- endif -%}
action: # action:
- service: scene.turn_on # - service: scene.turn_on
entity_id: scene.normal_livingroom_lighting # entity_id: scene.normal_livingroom_lighting
- service: scene.turn_on # - service: scene.turn_on
entity_id: scene.normal_kitchen_lighting # entity_id: scene.normal_kitchen_lighting
- service: script.twitter_notify # - service: script.twitter_notify
data: # data:
message: >- # message: >-
{{ [ "It is dark inside the house due to the conditions outside the house so I am turning on the inside lights.", # {{ [ "It is dark inside the house due to the conditions outside the house so I am turning on the inside lights.",
"When it gets dark enough outside I turn on the inside lights. ", # "When it gets dark enough outside I turn on the inside lights. ",
"Since I monitor the conditions inside and outside the Anchorage House I know all the things. Like it is time to turn on the inside lights." # "Since I monitor the conditions inside and outside the Anchorage House I know all the things. Like it is time to turn on the inside lights."
] | random }} # ] | random }}
- id: inside_off_after_sunrise - id: inside_off_after_sunrise
alias: Inside off after Sunrise alias: Inside off after Sunrise
@ -308,20 +293,11 @@ automation:
true true
{%- endif -%} {%- endif -%}
action: action:
- service: script.livingroom_lights_off
- service: script.kitchen_lights_off
- service: scene.turn_on
entity_id: scene.jeff_light_off
- service: scene.turn_on - service: scene.turn_on
entity_id: scene.skylar_room_day entity_id: scene.skylar_room_day
- service: script.twitter_notify - service: scene.turn_on
data: entity_id: scene.master_bedroom_off
message: >-
{{ [ "Looks like a nice day outside so I am turning off the inside lights.",
"It is now bright enough to turn off the inside lights. ",
"The inside lights are no longer needed so I am turning them off.",
"Two and half hours after sunrise there is enough light to turn off the inside lights."
] | random }}
- id: ha_start - id: ha_start
alias: HA Startup alias: HA Startup

200
config/packages/lighting.yaml Executable file
View File

@ -0,0 +1,200 @@
###############################################################################
# @author : thejefreystone
# @date : 10/05/2020
# @package : Lighting
# @description : All the Lightning specific configs.
###############################################################################
automation:
# Living lights needed when dark and there is motion
- id: e1c9379a-0423-11eb-adc1-0242ac120002
alias: Living Room Lights Needed
initial_state: true
trigger:
- entity_id: binary_sensor.0x00158d0002751bb4_occupancy
from: 'off'
platform: state
to: 'on'
condition:
- below: 50
condition: numeric_state
entity_id: sensor.0x00158d0002751bb4_illuminance
- condition: time
after: '05:30:00'
before: '22:30:00'
action:
- service: scene.turn_on
data:
entity_id: scene.normal_livingroom_lighting
# Inside lights are not needed when it gets bright enough...using living lux sensor as proxy for kitchen
- id: e1c9352e-0423-11eb-adc1-0242ac120002
alias: Inside Lights Not Needed
initial_state: true
trigger:
- entity_id: sensor.0x00158d0002751bb4_illuminance
above: 99
platform: numeric_state
condition:
- condition: state
entity_id: light.kitchen_cabinets
state: "on"
- condition: state
entity_id: light.0xb0ce18140003608a_light
state: "on"
action:
- service: scene.turn_on
data:
entity_id: scene.livingroom_lighting_off
- service: scene.turn_on
data:
entity_id: scene.kitchen_lighting_off
- service: script.twitter_notify
data:
message: >-
{{ [ "Looks like it is bright enough now, so I am turning off the inside lights.",
"It is now bright enough to turn off the inside lights, so thats what I did. Just now. ",
"There is enough natural light, so I am turning off the inside lights.",
""
] | random }}
script:
# Turn on Living Room Lights if sun is down or cloud coverage is above 70%
livingroom_lamps_on:
sequence:
- condition: or
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- service: scene.turn_on
entity_id: scene.normal_livingroom_lighting
# Turn off Living Room Lights if sun is up and it is sunny or partly cloudy
livingroom_lights_off:
sequence:
- condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'above_horizon'
- condition: state
entity_id: binary_sensor.living_room_occupancy
state: 'off'
- condition: template
value_template: >
{%- if states.weather.home.state == "sunny" or states.weather.home.state == "partlycloudy" -%}
true
{%- endif -%}
- service: group.turn_off
entity_id: group.livingroom
# Turn off Kitchen Lights if sun is up and it is sunny or partly cloudy
kitchen_lights_off:
sequence:
- condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'above_horizon'
- condition: state
entity_id: binary_sensor.kitchen_occupancy
state: 'off'
- condition: template
value_template: >
{%- if states.weather.home.state == "sunny" or states.weather.home.state == "partlycloudy" -%}
true
{%- endif -%}
- service: group.turn_off
entity_id: group.kitchen
good_night_loft:
sequence:
- condition: state
entity_id: media_player.pn60e550_pn60e550
state: "off"
- service: switch.turn_off
entity_id: switch.croft_fan
- service: switch.turn_off
entity_id: switch.croft_light
kitchen_lights_on:
sequence:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: time
after: '05:30:00'
before: '22:30:00'
- service: scene.turn_on
entity_id: scene.normal_kitchen_lighting
kitchen_lights_night:
sequence:
- condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: time
after: '22:30:00'
before: '05:30:00'
- service: scene.turn_on
entity_id: scene.diminished_kitchen_lighting
- delay:
minutes: 18
- service: light.turn_off
entity_id: light.kitchen_cabinets
theater_lights_out:
sequence:
- condition: and
conditions:
- condition: template
value_template: >
{%- if states.media_player.home_theater != "playing" -%}
true
{%- endif -%}
- condition: template
value_template: >
{%- if states.media_player.playstation_4 != "playing" -%}
true
{%- endif -%}
- condition: state
entity_id: binary_sensor.theater_occupancy
state: 'off'
- service: scene.turn_on
entity_id: scene.theater_dark
- service: switch.turn_off
entity_id: switch.theater_fan
theater_lights_down:
sequence:
- service: scene.turn_on
entity_id: scene.theater_dim
- delay:
minutes: 1
- service: scene.turn_on
entity_id: scene.theater_dark
theater_lights_up:
sequence:
- service: scene.turn_on
entity_id: scene.theater_dim
- delay:
minutes: 1
- service: scene.turn_on
entity_id: scene.theater_bright

View File

@ -244,6 +244,8 @@ automation:
action: action:
- service: input_boolean.turn_on - service: input_boolean.turn_on
entity_id: input_boolean.skylar_school entity_id: input_boolean.skylar_school
- service: switch.turn_off
entity_id: switch.forest
initial_state: true initial_state: true
- id: skylar_left_school - id: skylar_left_school

View File

@ -78,6 +78,12 @@ automation:
- condition: state - condition: state
entity_id: sensor.family_status entity_id: sensor.family_status
state: Home state: Home
- condition: state
entity_id: person.jeffrey
state: home
- condition: state
entity_id: person.katherine
state: home
- condition: state - condition: state
entity_id: input_boolean.guest_mode entity_id: input_boolean.guest_mode
state: 'on' state: 'on'

85
config/packages/spotify.yaml Executable file
View File

@ -0,0 +1,85 @@
########################################
# Spotify Playlists
#
# Chill - https://open.spotify.com/playlist/0dIzE1HeaUz1kmPX6DTnpY
# Background - https://open.spotify.com/playlist/3tKyL6gGSa5fdyCdo92L8m
# Skylar - https://open.spotify.com/playlist/0hYKkmUpFFG37TtFX23cMM?si=ZQLOiV5iT2yPPBEAEqTP8w
# Classical - https://open.spotify.com/playlist/09IWZAWNkNBl7TzWAoKXy3?si=NW4qtoxiTjqS0NpbynCoUQ
# Christmas - https://open.spotify.com/playlist/5XgmUr452DupjZYfnAcHS0?si=Cncjle8GQd-4Uyk1k4NjyA
# Jukebox - https://open.spotify.com/playlist/4rr6pL3qY8fBMrMDvpbEc8?si=NrIdThTuToCFIl1EGC_UEw
# Scored - https://open.spotify.com/playlist/1XJddjZ9l71FPIJhpyL4vI?si=q-bbG_0fRjuH2wVHGIH2Yg
# Disney - https://open.spotify.com/playlist/0zKtkdfsOFOg2EnjYa3QWb?si=pGDhUQlnTpaL0ESLIDozUw
# Jazz - https://open.spotify.com/playlist/7INVZzAMFf4A5oiXec6FoF?si=Z62yVQ3UTjigoA8U782vtA
# Bedtime - https://open.spotify.com/playlist/3luYE0ii9N8JaOaFnPW9MJ?si=mL4b0NIsTe6RcOK9ANEwGw
#
# Sources:
#
# Everywhere
# Skylar's Bedroom
# Living Room
# Kitchen
#######################################
script:
play_spotify_playlist:
sequence:
- service: media_player.select_source
data_template:
entity_id: media_player.spotify_jarvis
source: >
{{ source }}
- service: media_player.play_media
data_template:
entity_id: media_player.spotify_jarvis
media_content_type: playlist
media_content_id: >
{% if playlist == 'chill' %}
https://open.spotify.com/playlist/0dIzE1HeaUz1kmPX6DTnpY?si=qzhiPR3UQg6H1pk_rq2Eiw
{% elif playlist == 'bedtime' %}
https://open.spotify.com/playlist/3luYE0ii9N8JaOaFnPW9MJ?si=puEZG_VgQuqsZ8CFcxFO9w
{% elif playlist == 'background' %}
https://open.spotify.com/playlist/3tKyL6gGSa5fdyCdo92L8m?si=WV_PS3S6S-WmdjeopUEX8Q
{% elif playlist == 'skylar' %}
https://open.spotify.com/playlist/0hYKkmUpFFG37TtFX23cMM?si=ZQLOiV5iT2yPPBEAEqTP8w
{% elif playlist == 'classical' %}
https://open.spotify.com/playlist/09IWZAWNkNBl7TzWAoKXy3?si=gk1eUcKpRXK1xeQxvYSPcQ
{% elif playlist == 'christmas' %}
https://open.spotify.com/playlist/5XgmUr452DupjZYfnAcHS0?si=1HULm9WMRAGd4R7kW3gsQA
{% elif playlist == 'jukebox' %}
https://open.spotify.com/playlist/4rr6pL3qY8fBMrMDvpbEc8?si=qJ8fTx-IRWewI-VZcGWkfg
{% elif playlist == 'scored' %}
https://open.spotify.com/playlist/1XJddjZ9l71FPIJhpyL4vI?si=q-bbG_0fRjuH2wVHGIH2Yg
{% elif playlist == 'disney' %}
https://open.spotify.com/playlist/0zKtkdfsOFOg2EnjYa3QWb?si=pGDhUQlnTpaL0ESLIDozUw
{% elif playlist == 'jazz' %}
https://open.spotify.com/playlist/7INVZzAMFf4A5oiXec6FoF?si=Z62yVQ3UTjigoA8U782vtA
{% endif %}
- service: media_player.shuffle_set
data:
entity_id: media_player.spotify_jarvis
shuffle: 'true'
skylar_bedtime_music:
alias: Slylar Bedtime Music
sequence:
- service: media_player.volume_set
data_template:
entity_id: media_player.skylar_s_bedroom
volume_level: .25
- service: script.play_spotify_playlist
data_template:
source: Skylar's Bedroom
playlist: bedtime
kitchen_chill_music:
alias: Kitchen Chill Music
sequence:
- service: script.play_spotify_playlist
data_template:
source: Kitchen
playlist: chill

View File

@ -1,54 +0,0 @@
washer_finished_notification_audible:
sequence:
- delay:
minutes: 15
- service: script.washer_audible
- delay:
minutes: 30
- event: event_washer_complete_notification
event_data:
name: Washer Complete Notification
message: Washer has completed it's cycle
washer_audible:
sequence:
- condition: state
entity_id: sensor.family_status
state: Home
- condition: state
entity_id: sensor.washer_status
state: complete
- service: script.ah_report
data:
call_interuption: 1
call_washer_needs_emptying: 1
washer_idle:
sequence:
- service: mqtt.publish
data:
topic: house/washer/status
payload: idle
retain: true
washer_running:
sequence:
- service: mqtt.publish
data:
topic: house/washer/status
payload: running
retain: true
washer_complete:
sequence:
- service: mqtt.publish
data:
topic: house/washer/status
payload: complete
retain: true
reset_ha_speaker:
sequence:
- delay:
seconds: 30
- service: switch.turn_off
entity_id: switch.ha_speaker

View File

@ -1,180 +0,0 @@
close_garage:
sequence:
- condition: state
entity_id: cover.cargo_bay
state: open
- service: cover.close_cover
entity_id: cover.cargo_bay
open_garage:
sequence:
- condition: state
entity_id: cover.cargo_bay
state: closed
- service: cover.open_cover
entity_id: cover.cargo_bay
sunset_garage_open:
sequence:
- condition: state
entity_id: group.garage_doors
state: 'on'
- service: script.driveway_all_on
turn_on_ha_speaker:
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'off'
- service: input_boolean.turn_on
entity_id: input_boolean.audible_notifications
inside_all_on:
sequence:
- service: scene.turn_on
entity_id: scene.normal_livingroom_lighting
- service: scene.turn_on
entity_id: scene.normal_kitchen_lighting
- service: switch.turn_on
entity_id: switch.fireplace_lights
- service: switch.turn_on
entity_id: switch.croft_light
- service: switch.turn_on
entity_id: switch.rail_lights
- service: scene.turn_on
entity_id: scene.jeff_light_on
inside_all_off:
sequence:
- data:
entity_id: light.tower_lamp_4
service: light.turn_off
- data:
entity_id: light.living_room_lamp
service: light.turn_off
- data:
entity_id: light.front_door_lamp
service: light.turn_off
- data:
entity_id: light.kitchen_cabinets
service: light.turn_off
- data:
entity_id: light.kitchen_cabinet_lights
service: light.turn_off
- entity_id: switch.fireplace_lights
service: switch.turn_off
- entity_id: switch.upstairs
service: switch.turn_off
- entity_id: light.jeff_lamp
service: light.turn_off
all_fans_off:
sequence:
- service: group.turn_off
entity_id: group.all_fans
all_fans_on:
sequence:
- service: group.turn_on
entity_id: group.all_fans
family_is_home:
sequence:
- condition: state
entity_id: sensor.family_status
state: Away
- service: mqtt.publish
data:
topic: house/family/status
payload_template: Home
retain: true
- service: script.vacation_canceled
- service: script.appliances_on
- service: script.standby
- service: script.washer_finished_notification_audible
- service: alarm_control_panel.aarlo_set_mode
data:
entity_id: alarm_control_panel.aarlo_ah_base_station
mode: 'home'
- service: script.family_is_home
family_is_away:
sequence:
- condition: state
entity_id: sensor.family_status
state: Home
- service: mqtt.publish
data:
topic: house/family/status
payload_template: Away
retain: true
- service: script.appliances_off
- service: scene.turn_on
entity_id: scene.lights_out
- service: script.security_check_garage
- service: script.security_check_zones
- service: script.lockdown
- service: script.lockdown_issue
- service: script.all_fans_off
- service: alarm_control_panel.aarlo_set_mode
data:
entity_id: alarm_control_panel.aarlo_ah_base_station
mode: 'Armed'
- service: script.family_is_away
driveway_on:
sequence:
- condition: state
entity_id: sun.sun
state: below_horizon
- data:
entity_id: switch.driveway_light
service: switch.turn_on
- data:
entity_id: light.side_door_light
service: light.turn_on
driveway_off:
sequence:
- delay:
seconds: 120
- condition: state
entity_id: binary_sensor.side_door
state: 'off'
- condition: state
entity_id: binary_sensor.garage_door
state: 'off'
- service: switch.turn_off
entity_id: switch.driveway_light
- service: light.turn_off
entity_id: light.side_door_light
chromecast_media_stop:
sequence:
- service: media_player.media_stop
data:
entity_id: media_player.ha_speaker
appliances_on:
sequence:
- service: switch.turn_on
data:
entity_id: switch.box_fans
appliances_off:
sequence:
- data:
entity_id: switch.incense
service: switch.turn_off
- data:
entity_id: switch.artemis
service: switch.turn_off

View File

@ -1,141 +0,0 @@
#########################################
#
# Light Based Scripts
#
#########################################
# Turn on Living Room Lights if sun is down or cloud coverage is above 70%
livingroom_lamps_on:
sequence:
- condition: or
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- service: scene.turn_on
entity_id: scene.normal_livingroom_lighting
# Turn off Living Room Lights if sun is up and it is sunny or partly cloudy
livingroom_lights_off:
sequence:
- condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'above_horizon'
- condition: state
entity_id: binary_sensor.living_room_occupancy
state: 'off'
- condition: template
value_template: >
{%- if states.weather.home.state == "sunny" or states.weather.home.state == "partlycloudy" -%}
true
{%- endif -%}
- service: group.turn_off
entity_id: group.livingroom
# Turn off Kitchen Lights if sun is up and it is sunny or partly cloudy
kitchen_lights_off:
sequence:
- condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'above_horizon'
- condition: state
entity_id: binary_sensor.kitchen_occupancy
state: 'off'
- condition: template
value_template: >
{%- if states.weather.home.state == "sunny" or states.weather.home.state == "partlycloudy" -%}
true
{%- endif -%}
- service: group.turn_off
entity_id: group.kitchen
good_night_loft:
sequence:
- condition: state
entity_id: media_player.pn60e550_pn60e550
state: "off"
- service: switch.turn_off
entity_id: switch.croft_fan
- service: switch.turn_off
entity_id: switch.croft_light
kitchen_lights_on:
sequence:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: time
after: '05:30:00'
before: '22:30:00'
- service: scene.turn_on
entity_id: scene.normal_kitchen_lighting
kitchen_lights_night:
sequence:
- condition: and
conditions:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
- condition: time
after: '22:30:00'
before: '05:30:00'
- service: scene.turn_on
entity_id: scene.diminished_kitchen_lighting
- delay:
minutes: 18
- service: light.turn_off
entity_id: light.kitchen_cabinets
theater_lights_out:
sequence:
- condition: and
conditions:
- condition: template
value_template: >
{%- if states.media_player.home_theater != "playing" -%}
true
{%- endif -%}
- condition: template
value_template: >
{%- if states.media_player.playstation_4 != "playing" -%}
true
{%- endif -%}
- condition: state
entity_id: binary_sensor.theater_occupancy
state: 'off'
- service: scene.turn_on
entity_id: scene.theater_dark
- service: switch.turn_off
entity_id: switch.theater_fan
theater_lights_down:
sequence:
- service: scene.turn_on
entity_id: scene.theater_dim
- delay:
minutes: 1
- service: scene.turn_on
entity_id: scene.theater_dark
theater_lights_up:
sequence:
- service: scene.turn_on
entity_id: scene.theater_dim
- delay:
minutes: 1
- service: scene.turn_on
entity_id: scene.theater_bright

View File

@ -1,79 +0,0 @@
########################################
# Spotify Playlists
#
# Chill - https://open.spotify.com/playlist/0dIzE1HeaUz1kmPX6DTnpY
# Background - https://open.spotify.com/playlist/3tKyL6gGSa5fdyCdo92L8m
# Skylar - https://open.spotify.com/playlist/0hYKkmUpFFG37TtFX23cMM?si=ZQLOiV5iT2yPPBEAEqTP8w
# Classical - https://open.spotify.com/playlist/09IWZAWNkNBl7TzWAoKXy3?si=NW4qtoxiTjqS0NpbynCoUQ
# Christmas - https://open.spotify.com/playlist/5XgmUr452DupjZYfnAcHS0?si=Cncjle8GQd-4Uyk1k4NjyA
# Jukebox - https://open.spotify.com/playlist/4rr6pL3qY8fBMrMDvpbEc8?si=NrIdThTuToCFIl1EGC_UEw
# Scored - https://open.spotify.com/playlist/1XJddjZ9l71FPIJhpyL4vI?si=q-bbG_0fRjuH2wVHGIH2Yg
# Disney - https://open.spotify.com/playlist/0zKtkdfsOFOg2EnjYa3QWb?si=pGDhUQlnTpaL0ESLIDozUw
# Jazz - https://open.spotify.com/playlist/7INVZzAMFf4A5oiXec6FoF?si=Z62yVQ3UTjigoA8U782vtA
# Bedtime - https://open.spotify.com/playlist/3luYE0ii9N8JaOaFnPW9MJ?si=mL4b0NIsTe6RcOK9ANEwGw
#
# Sources:
#
# Everywhere
# Skylar's Bedroom
# Living Room
# Kitchen
#######################################
play_spotify_playlist:
sequence:
- service: media_player.select_source
data_template:
entity_id: media_player.spotify_jarvis
source: >
{{ source }}
- service: media_player.play_media
data_template:
entity_id: media_player.spotify_jarvis
media_content_type: playlist
media_content_id: >
{% if playlist == 'chill' %}
https://open.spotify.com/playlist/0dIzE1HeaUz1kmPX6DTnpY?si=qzhiPR3UQg6H1pk_rq2Eiw
{% elif playlist == 'bedtime' %}
https://open.spotify.com/playlist/3luYE0ii9N8JaOaFnPW9MJ?si=puEZG_VgQuqsZ8CFcxFO9w
{% elif playlist == 'background' %}
https://open.spotify.com/playlist/3tKyL6gGSa5fdyCdo92L8m?si=WV_PS3S6S-WmdjeopUEX8Q
{% elif playlist == 'skylar' %}
https://open.spotify.com/playlist/0hYKkmUpFFG37TtFX23cMM?si=ZQLOiV5iT2yPPBEAEqTP8w
{% elif playlist == 'classical' %}
https://open.spotify.com/playlist/09IWZAWNkNBl7TzWAoKXy3?si=gk1eUcKpRXK1xeQxvYSPcQ
{% elif playlist == 'christmas' %}
https://open.spotify.com/playlist/5XgmUr452DupjZYfnAcHS0?si=1HULm9WMRAGd4R7kW3gsQA
{% elif playlist == 'jukebox' %}
https://open.spotify.com/playlist/4rr6pL3qY8fBMrMDvpbEc8?si=qJ8fTx-IRWewI-VZcGWkfg
{% elif playlist == 'scored' %}
https://open.spotify.com/playlist/1XJddjZ9l71FPIJhpyL4vI?si=q-bbG_0fRjuH2wVHGIH2Yg
{% elif playlist == 'disney' %}
https://open.spotify.com/playlist/0zKtkdfsOFOg2EnjYa3QWb?si=pGDhUQlnTpaL0ESLIDozUw
{% elif playlist == 'jazz' %}
https://open.spotify.com/playlist/7INVZzAMFf4A5oiXec6FoF?si=Z62yVQ3UTjigoA8U782vtA
{% endif %}
- service: media_player.shuffle_set
data:
entity_id: media_player.spotify_jarvis
shuffle: 'true'
skylar_bedtime_music:
alias: Slylar Bedtime Music
sequence:
- service: media_player.volume_set
data_template:
entity_id: media_player.skylar_s_bedroom
volume_level: .25
- service: script.play_spotify_playlist
data_template:
source: Skylar's Bedroom
playlist: bedtime
kitchen_chill_music:
alias: Kitchen Chill Music
sequence:
- service: script.play_spotify_playlist
data_template:
source: Kitchen
playlist: chill