diff --git a/config/automations.yaml b/config/automations.yaml index 54df492..16ed17d 100644 --- a/config/automations.yaml +++ b/config/automations.yaml @@ -531,6 +531,22 @@ 07:15 {% endif %} +- id: set_skylar_nightly_report_time + alias: set skylar nightly report time + trigger: + - platform: time + at: '18:30:00' + action: + - service: input_datetime.set_datetime + entity_id: input_datetime.skylar_nightly_report + data_template: + time: > + {% if states.sensor.school_tomorrow.state == 'on' %} + 19:00 + {% else %} + 20:00 + {% endif %} + - id: set_good_morning_time alias: set good morning time trigger: @@ -607,7 +623,7 @@ state: 'off' - above: '73' condition: numeric_state - entity_id: sensor.upstairs_temperature + entity_id: sensor.living_room_temperature action: - data: entity_id: switch.living_room_fan @@ -705,5 +721,48 @@ - service: script.kitchen_lights_night - service: script.dog_mode_on - service: script.kitchen_lights_on - - service: script.kitchen_lights_morning - \ No newline at end of file + +- id: driveway_motion_lighting + alias: Driveway Motion Lighting + initial_state: true + trigger: + - platform: state + entity_id: binary_sensor.aarlo_motion_driveway + to: 'on' + condition: + - condition: state + entity_id: sun.sun + state: 'below_horizon' + action: + - service: switch.turn_on + entity_id: switch.driveway_light + - delay: + minutes: 3 + - service: switch.turn_off + entity_id: switch.driveway_light + +- alias: "Delivered Package Notification" + initial_state: 'on' + trigger: + - platform: state + entity_id: sensor.mail_fedex_delivered + #send only if mail or packages are more than 0 + condition: + - condition: or + conditions: + - condition: template + value_template: "{{ states('sensor.mail_fedex_delivered') | int > 0 }}" + action: + - service: script.text_notify + data_template: + who: "jeff" + title: "Package Delivered" + message: "Fedex just made a delivery" + - service: script.ah_report + data_template: + usps: >- + {%- if states.sensor.mail_fedex_delivered.state | int > 0 -%} + Federal Express just left something on the porch. + {%- endif -%} + call_interuption: 1 + diff --git a/config/packages/notify.yaml b/config/packages/notify.yaml index 7129b1f..f352a78 100755 --- a/config/packages/notify.yaml +++ b/config/packages/notify.yaml @@ -737,7 +737,7 @@ script: {% endmacro %} {% macro prebed_routine() %} - Skylar, + Skylar, {{ [ 'It is time to get in the bath. ', 'You only have thirty minutes until bedtime. That means you should be heading for the bathtub. Time to get clean.', 'I cannot communicate with the bathtub. Or I would have started the water for you already. So you will have to start the bath, yourself', @@ -746,12 +746,13 @@ script: 'Did you ever hear the one about the kid who never took a bath? Yeah, me either. So we should keep it that way. Bath time now, sir.', 'Tee Minus 30 minutes and counting until you should be off to sleep. Time to get cleaned up, and get your pajamas on.' ] | random }} - If you go now there may be time for stories. Do not forget to brush your teeth. - {% if is_state('sensor.weekday', 'fri') %} - Oh, and tomorrow is Saturday, so we can sleep in. - {% endif %} - {% if is_state('sensor.weekday', 'sat') %} - Oh, and tomorrow is Sunday, so we can sleep in. + {% if is_state('sensor.school_tomorrow', 'on') %} + {{ [ 'Because you have school tomorrow. ', + 'Because uou have to get up early tomorrow for school.', + 'Because you want to be ready for school tomorrow.' + ] | random }} + {% else %} + Oh, and it appears you do not have school tomorrow so we can sleep in. {% endif %} {% endmacro %} diff --git a/config/sensors/house.yaml b/config/sensors/house.yaml index 67fbf2c..e323338 100755 --- a/config/sensors/house.yaml +++ b/config/sensors/house.yaml @@ -307,4 +307,13 @@ {{ states.calendar.anchorage_holidays.attributes.message }} {% else %} none - {% endif %} \ No newline at end of file + {% endif %} + school_tomorrow: + friendly_name: 'School Tomorrow' + value_template: >- + {%- set test=(as_timestamp(now())+ (86400)) | timestamp_custom("%Y-%m-%d",true) %} + {% if states.calendar.skylar_school.attributes.start_time == test + " 07:35:00" %} + on + {% else %} + off + {% endif %} \ No newline at end of file