diff --git a/.gitignore b/.gitignore index 4928621..cc62cf6 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ transporter.py **.spotify-token-cache **zones.yaml **test.yaml +**testing.yaml **.homekit* **.vscode **.pid diff --git a/config/automations.yaml b/config/automations.yaml index 414b1a8..1cd2f6a 100644 --- a/config/automations.yaml +++ b/config/automations.yaml @@ -15,7 +15,6 @@ - data: entity_id: switch.upstairs_fan service: switch.turn_on - - id: '1562066108032' alias: Living Room Fan On diff --git a/config/configuration.yaml b/config/configuration.yaml index 3cca207..83bcf2f 100644 --- a/config/configuration.yaml +++ b/config/configuration.yaml @@ -278,16 +278,11 @@ group: !include groups.yaml ### Includes ### alert: !include_dir_merge_named alerts/ automation: !include automations.yaml -script: !include_dir_merge_named scripts -#automation: !include automations.yaml +script: !include scripts.yaml sensor: !include_dir_merge_list sensors binary_sensor: !include_dir_merge_list binary_sensors -#light: !include_dir_merge_list lights light: !include lights.yaml -#switch: !include_dir_merge_list switches switch: !include switches.yaml -#script: !include_dir_merge_named scripts -#intent_script: !include intents/intents.yaml scene: !include scenes.yaml input_select: !include input_select.yaml input_boolean: !include input_boolean.yaml diff --git a/config/packages/announcements.yaml b/config/packages/announcements.yaml index 83cbfd1..4e5936c 100755 --- a/config/packages/announcements.yaml +++ b/config/packages/announcements.yaml @@ -256,9 +256,9 @@ automation: data_template: time: > {% if states.calendar.skylar_school.attributes.offset_reached == True %} - 07:00 + 06:15 {% else %} - 07:58 + 07:15 {% endif %} - id: set_morning_report_time @@ -272,7 +272,7 @@ automation: data_template: time: > {% if states.calendar.skylar_school.attributes.offset_reached == True %} - 07:00 + 07:10 {% else %} 08:00 {% endif %} diff --git a/config/packages/camera.yaml b/config/packages/camera.yaml index dd597ef..11f111d 100755 --- a/config/packages/camera.yaml +++ b/config/packages/camera.yaml @@ -14,6 +14,14 @@ camera: - platform: ffmpeg input: !secret livingroom_cam # wyze cam v2 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_bin: /usr/bin/ffmpeg \ No newline at end of file diff --git a/config/packages/daily.yaml b/config/packages/daily.yaml index 452c29e..2249396 100755 --- a/config/packages/daily.yaml +++ b/config/packages/daily.yaml @@ -69,8 +69,8 @@ automation: entity_id: scene.skylar_room_prebed - - id: jeff_lights_out - alias: Jeff lights out + - id: master_bedroom_lights_out + alias: Master Bedroom lights out initial_state: true trigger: - platform: time @@ -81,41 +81,24 @@ automation: state: 'off' action: - service: scene.turn_on - entity_id: scene.jeff_light_off - - id: jeff_bedtime - alias: Jeff bedtime - initial_state: true - 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 + entity_id: scene.master_bedroom_off + + - id: master_bedroom_lights_out + alias: Master Bedroom lights out initial_state: true trigger: - platform: time at: '22:30: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_night_light - - id: jeff_light_on - alias: Jeff Light On + entity_id: scene.master_bedroom_dim + + - id: master_bedroom_lights_on + alias: Master Bedroom Lights On initial_state: true trigger: - platform: time @@ -126,34 +109,36 @@ automation: state: 'off' action: - service: scene.turn_on - entity_id: scene.jeff_light_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 + entity_id: scene.master_bedroom_on + - # - id: jeff_wake_up - # alias: Jeff wake up - # initial_state: true - # trigger: - # - platform: time - # at: 04:30:00 - # condition: - # - condition: state - # entity_id: input_boolean.vacation_mode - # state: 'off' - # action: - # - service: scene.turn_on - # entity_id: scene.jeff_wake_up + - id: master_bedroom_alarm + alias: Master bedroom alarm + initial_state: true + trigger: + - platform: time + at: 06:00:00 + condition: + - condition: state + entity_id: input_boolean.vacation_mode + state: 'off' + action: + - service: scene.turn_on + 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 alias: Good Night @@ -268,31 +253,31 @@ automation: "/config/www/tweet_images/sunrise3.jpg", "/config/www/tweet_images/sunrise2.jpg"] | random }} - - id: inside_on_sunset - alias: Inside on at Sunset - initial_state: true - trigger: - - platform: sun - event: sunset - offset: -02:00:00 - condition: - - condition: template - value_template: > - {%- if states.weather.klzu_hourly.state != "sunny" or states.weather.klzu_hourly.state != "partlycloudy" or states.weather.klzu_hourly.state != "clear" -%} - true - {%- endif -%} - action: - - service: scene.turn_on - entity_id: scene.normal_livingroom_lighting - - service: scene.turn_on - entity_id: scene.normal_kitchen_lighting - - service: script.twitter_notify - data: - message: >- - {{ [ "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. ", - "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 }} + # - id: inside_on_sunset + # alias: Inside on at Sunset + # initial_state: true + # trigger: + # - platform: sun + # event: sunset + # offset: -02:00:00 + # condition: + # - condition: template + # value_template: > + # {%- if states.weather.klzu_hourly.state != "sunny" or states.weather.klzu_hourly.state != "partlycloudy" or states.weather.klzu_hourly.state != "clear" -%} + # true + # {%- endif -%} + # action: + # - service: scene.turn_on + # entity_id: scene.normal_livingroom_lighting + # - service: scene.turn_on + # entity_id: scene.normal_kitchen_lighting + # - service: script.twitter_notify + # data: + # message: >- + # {{ [ "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. ", + # "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 }} - id: inside_off_after_sunrise alias: Inside off after Sunrise @@ -308,20 +293,11 @@ automation: true {%- endif -%} 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 entity_id: scene.skylar_room_day - - service: script.twitter_notify - data: - 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 }} + - service: scene.turn_on + entity_id: scene.master_bedroom_off + - id: ha_start alias: HA Startup diff --git a/config/packages/lighting.yaml b/config/packages/lighting.yaml new file mode 100755 index 0000000..b21f143 --- /dev/null +++ b/config/packages/lighting.yaml @@ -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 + + + + \ No newline at end of file diff --git a/config/packages/presence.yaml b/config/packages/presence.yaml index 1ceb172..7503385 100755 --- a/config/packages/presence.yaml +++ b/config/packages/presence.yaml @@ -244,6 +244,8 @@ automation: action: - service: input_boolean.turn_on entity_id: input_boolean.skylar_school + - service: switch.turn_off + entity_id: switch.forest initial_state: true - id: skylar_left_school diff --git a/config/packages/security.yaml b/config/packages/security.yaml index 1c691c9..2698053 100755 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -78,6 +78,12 @@ automation: - condition: state entity_id: sensor.family_status state: Home + - condition: state + entity_id: person.jeffrey + state: home + - condition: state + entity_id: person.katherine + state: home - condition: state entity_id: input_boolean.guest_mode state: 'on' diff --git a/config/packages/spotify.yaml b/config/packages/spotify.yaml new file mode 100755 index 0000000..a69e9e8 --- /dev/null +++ b/config/packages/spotify.yaml @@ -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 \ No newline at end of file diff --git a/config/scripts/appliances.yaml b/config/scripts/appliances.yaml deleted file mode 100755 index a43be22..0000000 --- a/config/scripts/appliances.yaml +++ /dev/null @@ -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 \ No newline at end of file diff --git a/config/scripts/general.yaml b/config/scripts/general.yaml deleted file mode 100755 index ad00a4d..0000000 --- a/config/scripts/general.yaml +++ /dev/null @@ -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 - - - - - - - diff --git a/config/scripts/lights.yaml b/config/scripts/lights.yaml deleted file mode 100755 index 594bc3d..0000000 --- a/config/scripts/lights.yaml +++ /dev/null @@ -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 - - - - - - diff --git a/config/scripts/spotify.yaml b/config/scripts/spotify.yaml deleted file mode 100755 index c8eb2b0..0000000 --- a/config/scripts/spotify.yaml +++ /dev/null @@ -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 \ No newline at end of file