From a4d5450b8b9cd6efa31e2819752dd54152a47d05 Mon Sep 17 00:00:00 2001 From: Joshua King Date: Wed, 25 Jun 2025 10:02:29 -0400 Subject: [PATCH] Add day camp automation scripts and configuration --- automations.yaml | 51 +++++++++++++++++++++++++++++++++++++++++++ configuration.yaml | 6 +++++ custom_variables.yaml | 5 +++++ scripts.yaml | 22 +++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 custom_variables.yaml diff --git a/automations.yaml b/automations.yaml index 9dc2e35..002cbf3 100644 --- a/automations.yaml +++ b/automations.yaml @@ -1261,3 +1261,54 @@ data: type: announce method: all +- id: '1744503044812' + alias: Check day camp daily + trigger: + - platform: time + at: '04:00:00' + action: + - service: script.check_day_camp +- id: '1744503044813' + alias: Announce day camp preparation and pause TV + trigger: + - platform: time + at: '08:30:00' + condition: + - condition: state + entity_id: input_boolean.day_camp_today + state: 'on' + action: + - service: notify.alexa_media + data: + target: + - media_player.living_room + - media_player.declan_s_room + - media_player.jordyn_s_room + - media_player.kitchen + - media_player.tv_alexa + message: "Time to prepare for day camp. Please do the following: Fill water bottles, Put on deodorant, Brush hair for Jordyn, Brush teeth." + - service: media_player.media_pause + target: + entity_id: media_player.kids_tv +- id: '1744503044814' + alias: Announce time to leave for day camp and turn off TV + trigger: + - platform: time + at: '08:45:00' + condition: + - condition: state + entity_id: input_boolean.day_camp_today + state: 'on' + action: + - service: notify.alexa_media + data: + target: + - media_player.living_room + - media_player.declan_s_room + - media_player.jordyn_s_room + - media_player.kitchen + - media_player.tv_alexa + message: "It is time to leave for day camp. Please do the following: Put on shoes, Get lunch, Get water bottle, Get bag if needed." + - service: media_player.turn_off + target: + entity_id: media_player.kids_tv \ No newline at end of file diff --git a/configuration.yaml b/configuration.yaml index efbcba6..986fb5d 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -2,6 +2,11 @@ # Loads default set of integrations. Do not remove. default_config: +# Load custom components +input_boolean: !include custom_variables.yaml +script: !include scripts.yaml +automation: !include automations.yaml + # Load frontend themes from the themes folder frontend: themes: !include_dir_merge_named themes @@ -17,6 +22,7 @@ http: - 192.168.1.1 - 192.168.1.62 - 192.168.1.210 + ### SMTP notify: - name: "mailgun_smtp" diff --git a/custom_variables.yaml b/custom_variables.yaml new file mode 100644 index 0000000..b969565 --- /dev/null +++ b/custom_variables.yaml @@ -0,0 +1,5 @@ +# For day camp automation +input_boolean: + day_camp_today: + name: Day Camp Today + initial: off \ No newline at end of file diff --git a/scripts.yaml b/scripts.yaml index e69de29..9ffcafa 100644 --- a/scripts.yaml +++ b/scripts.yaml @@ -0,0 +1,22 @@ +- check_day_camp: + sequence: + - service: calendar.list_events + data: + start_date: "{{ now().date() }}" + end_date: "{{ (now() + timedelta(days=1)).date() }}" + target: + entity_id: calendar.family_events + response_variable: events + - choose: + - conditions: + - condition: template + value_template: > + {{ events.events | selectattr('summary', 'search', 'Camp') | rejectattr('summary', 'search', 'No') | list | count > 0 }} + sequence: + - service: input_boolean.turn_on + target: + entity_id: input_boolean.day_camp_today + default: + - service: input_boolean.turn_off + target: + entity_id: input_boolean.day_camp_today \ No newline at end of file