diff --git a/packages/scheduling.yaml b/packages/scheduling.yaml index d0333c3..9d59961 100644 --- a/packages/scheduling.yaml +++ b/packages/scheduling.yaml @@ -424,6 +424,63 @@ script: {{ (state_attr('input_datetime.tina_workday_end', 'timestamp') + 3600) | timestamp_custom('%H:%M', false) }} {% endif %} {% endif %} + - if: + - condition: state + entity_id: sensor.today_is + state: 'Monday' + then: + - if: + - condition: template + value_template: > + {% from 'easy_time.jinja' import count_the_days, month_week_day %} + {% set month = as_timestamp(now()) | timestamp_custom('%-m') %} + {{ count_the_days(month_week_day(month,3,2)) | int < 7 }} + then: + - service: calendar.create_event + target: + entity_id: calendar.garbage_collection + data: + summary: Large Garbage Pickup + description: Bulk items ARE accepted + start_date: > + {% from 'easy_time.jinja' import this_weekday, count_the_days %} + {% set holiday = state_attr('calendar.holidays','next_holiday') %} + {% if holiday in ["New Year's Day","Memorial Day","Independence Day","Labor Day","Thanksgiving","Christmas"] and count_the_days('calendar.holidays','start_time') | int <= 4 %} + {{ as_timestamp(this_weekday(3)) | timestamp_custom('%Y-%m-%d') }} + {% else %} + {{ as_timestamp(this_weekday(2)) | timestamp_custom('%Y-%m-%d') }} + {% endif %} + end_date: > + {% from 'easy_time.jinja' import this_weekday, count_the_days %} + {% set holiday = state_attr('calendar.holidays','next_holiday') %} + {% if holiday in ["New Year's Day","Memorial Day","Independence Day","Labor Day","Thanksgiving","Christmas"] and count_the_days('calendar.holidays','start_time') | int <= 4 %} + {{ as_timestamp(this_weekday(4)) | timestamp_custom('%Y-%m-%d') }} + {% else %} + {{ as_timestamp(this_weekday(3)) | timestamp_custom('%Y-%m-%d') }} + {% endif %} + else: + - service: calendar.create_event + target: + entity_id: calendar.garbage_collection + data: + summary: Normal Garbage Pickup + description: Bulk items not accepted + start_date: > + {% from 'easy_time.jinja' import this_weekday, count_the_days %} + {% set holiday = state_attr('calendar.holidays','next_holiday') %} + {% if holiday in ["New Year's Day","Memorial Day","Independence Day","Labor Day","Thanksgiving","Christmas"] and count_the_days('calendar.holidays','start_time') | int <= 4 %} + {{ as_timestamp(this_weekday(3)) | timestamp_custom('%Y-%m-%d') }} + {% else %} + {{ as_timestamp(this_weekday(2)) | timestamp_custom('%Y-%m-%d') }} + {% endif %} + end_date: > + {% from 'easy_time.jinja' import this_weekday, count_the_days %} + {% set holiday = state_attr('calendar.holidays','next_holiday') %} + {% if holiday in ["New Year's Day","Memorial Day","Independence Day","Labor Day","Thanksgiving","Christmas"] and count_the_days('calendar.holidays','start_time') | int <= 4 %} + {{ as_timestamp(this_weekday(4)) | timestamp_custom('%Y-%m-%d') }} + {% else %} + {{ as_timestamp(this_weekday(3)) | timestamp_custom('%Y-%m-%d') }} + {% endif %} - if: - condition: template value_template: "{{ states('sensor.todays_high_temp') | int >= states('input_number.hot_day_threshold') | int }}" diff --git a/templates/speech/daily_briefing.yaml b/templates/speech/daily_briefing.yaml index ba161ed..217254b 100644 --- a/templates/speech/daily_briefing.yaml +++ b/templates/speech/daily_briefing.yaml @@ -384,6 +384,18 @@ {% endif %}

+

+ {% if count_the_days('calendar.garbage_collection','start_time') == 1 %} + {% if state_attr('calendar.garbage_collection','message') == 'Large Garbage Pickup' %} + Tomorrow is the monthly unlimited garbage pickup. Make sure to take out all regular trash, as well as any larger items that need to be disposed of. + {% else %} + Tomorrow is regular garbage pickup. Make sure that all trash cans are emptied and the outside bin has been wheeled to the curb. + {% endif %} + {% elif is_state('calendar.garbage_collection','on') %} + Today is garbage day. Please make sure to wheel the garbage bin back to the house. + {% endif %} +

+

{% from 'sports.jinja' import sports_pregame, sports_main %} {% if is_state('input_boolean.sports_updates','on') %} diff --git a/templates/speech/morning_briefing.yaml b/templates/speech/morning_briefing.yaml index 86791c6..389cf8d 100644 --- a/templates/speech/morning_briefing.yaml +++ b/templates/speech/morning_briefing.yaml @@ -156,6 +156,18 @@ {% endif %}

+

+ {% if count_the_days('calendar.garbage_collection','start_time') == 1 %} + {% if state_attr('calendar.garbage_collection','message') == 'Large Garbage Pickup' %} + Tomorrow is the monthly unlimited garbage pickup. Make sure to take out all regular trash, as well as any larger items that need to be disposed of. + {% else %} + Tomorrow is regular garbage pickup. Make sure that all trash cans are emptied and the outside bin has been wheeled to the curb. + {% endif %} + {% elif is_state('calendar.garbage_collection','on') %} + Today is garbage day. If the garbage has already been picked up at this time, please wheel the garbage bin back to the house. + {% endif %} +

+

{% from 'sports.jinja' import sports_pregame, sports_main %} {% if is_state('input_boolean.sports_updates','on') %} diff --git a/templates/speech/nightly_briefing.yaml b/templates/speech/nightly_briefing.yaml index c1084e4..8a5dba8 100644 --- a/templates/speech/nightly_briefing.yaml +++ b/templates/speech/nightly_briefing.yaml @@ -5,6 +5,7 @@ {% from 'time.jinja' import input_datetime_12hr, read_time_from_calendar %} {% from 'status.jinja' import emma_sleep %} {% from 'formatting.jinja' import cleanup %} + {% from 'easy_time.jinja' import count_the_days %}

{{ greeting() }}

@@ -251,6 +252,18 @@ {% endif %}

+

+ {% if count_the_days('calendar.garbage_collection','start_time') == 1 %} + {% if state_attr('calendar.garbage_collection','message') == 'Large Garbage Pickup' %} + Tomorrow is the monthly unlimited garbage pickup. Make sure to take out all regular trash, as well as any larger items that need to be disposed of. + {% else %} + Tomorrow is regular garbage pickup. Make sure that all trash cans are emptied and the outside bin has been wheeled to the curb. + {% endif %} + {% elif is_state('calendar.garbage_collection','on') %} + The garbage was picked up today. Please make sure to wheel the garbage bin back to the house if you have not already. + {% endif %} +

+

{{ [ "For some useless trivia that no one asked for, I present to you the following: ", diff --git a/templates/speech/welcome_home.yaml b/templates/speech/welcome_home.yaml index 10be022..09a792a 100644 --- a/templates/speech/welcome_home.yaml +++ b/templates/speech/welcome_home.yaml @@ -5,6 +5,7 @@ {% from 'time.jinja' import input_datetime_12hr %} {% from 'status.jinja' import emma_sleep %} {% from 'formatting.jinja' import cleanup %} + {% from 'easy_time.jinja' import count_the_days %}

"Welcome home, " {% if is_state('person.tony_stork','home') and is_state('person.christina_stork','home') %} @@ -154,6 +155,18 @@ {{ cleanup(emma_sleep()) }}

+

+ {% if count_the_days('calendar.garbage_collection','start_time') == 1 %} + {% if state_attr('calendar.garbage_collection','message') == 'Large Garbage Pickup' %} + Tomorrow is the monthly unlimited garbage pickup. Make sure to take out all regular trash, as well as any larger items that need to be disposed of. + {% else %} + Tomorrow is regular garbage pickup. Make sure that all trash cans are emptied and the outside bin has been wheeled to the curb. + {% endif %} + {% elif is_state('calendar.garbage_collection','on') %} + Today is garbage day. If the garbage has already been picked up, please wheel the garbage bin back to the house. + {% endif %} +

+

{{ dadjoke() }}