Next day check for google calendar

Yes they are included into the calendrer as well

question? how do i exclude days like (parent/ teacher conference and testing day)?

Do you want the Input Button to be turned on 20 hours before the start of 'Staff Development Day’ and ‘Teacher Work Day’ or do you want to exclude those events?

Keep those, its the parent teacher conference and test days i want to exclude, due to my kids will still be going to school those days.

To selectively include (or exclude) events is by searching for specific words in the event’s name.

For example, you can include events whose name contains the word “Break”. However, this will only work correctly if the events have a consistent naming scheme. For example, it will include “Winter Break” but exclude “Spring Recess” because it doesn’t contain the word “Break”. In that case, it would need to search for event names containing “Break” or “Recess”.

I view that “parent” and “testing” are the only ones with those names. They would be the only one excluded

If you only exclude events whose names contain the words “parent” or “testing”, then “Staff Development Day” and “Teacher Work Day” will be included because they don’t contain those words.

That’s why I suggested you indicate what words are found in the names of the events you want to include (not exclude). For example, we know you want to include events whose name contains “Break”. Are there other words, perhaps “Holiday”?

Oh ok So I would include the words that dont begin with “Parent” and “testing”. How would I accomplish that?

Include, “Staff” “Break” “Good”, The holidays all end with “Day” But testing ends with “Days” Would that be a issue?

You must specify the words that can exist in the event names you want to include. For example, the word “Break” (because it is in “Winter Break”). Look at the calendar and examine the names of all the events you want to include. Identify common words they contain.

Would I specify using a template?

The following example turns on the Input Boolean 20 hours before the event but only for events whose name contains “Break” or “Holiday”. It also turns off the Input Boolean when the event ends.

alias: School Calendrer Toggle
description: ""
trigger:
  - platform: calendar
    event: start
    offset: "-20:0:0"
    entity_id: calendar.kids_school
    id: 'on'
    alias: Kids Start
  - platform: calendar
    event: end
    offset: "0:0:0"
    entity_id: calendar.kids_school
    id: 'off'
    alias: Kids End
condition:
  - condition: template
    value_template: "{{ trigger.calendar_event.summary is search('(Break|Holiday)') }}"
action:
  - service: 'input_boolean.turn_{{ trigger.id }}'
    target:
      entity_id: input_boolean.kids_school_helper
mode: single
alias: School Calendrer Toggle
description: ""
trigger:
  - platform: calendar
    event: start
    offset: "-20:0:0"
    entity_id: calendar.kids_school
    id: Kids start
    alias: Kids Start
  - platform: calendar
    event: end
    offset: "0:0:0"
    entity_id: calendar.kids_school
    id: Kids End
    alias: Kids End
condition:
  - condition: template
    value_template: >-
      {{ trigger.calendar_event.summary is
      search('(Break|Holiday|Day|Good|Staff)') }}
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - Kids start
        sequence:
          - service: input_boolean.turn_on
            data: {}
            target:
              entity_id: input_boolean.kids_school_helper
      - conditions:
          - condition: trigger
            id:
              - Kids End
        sequence:
          - service: input_boolean.turn_off
            data: {}
            target:
              entity_id: input_boolean.kids_school_helper
mode: single

I assume you understand that by adding the word Day here:

search('(Break|Holiday|Day|Good|Staff)') 

It means it will include these events that you originally said you wanted to exclude:

  • Staff Development Day
  • Teacher Work Day

Yes correct because those are the days they will be out of school.

In that case, your automation will not correctly set the Input Boolean when it encounters consecutively scheduled events.

Staff Development Day is scheduled immediately after Winter Break which means the Input Boolean will be turned on 20 hours before Staff Development Day and then turned off at 00:00 when Winter Break ends and Staff Development Day officially begins. That’s incorrect because the Input Boolean should be left on throughout Staff Development Day.

Your automation will need an additional Calendar Trigger set for the start of an event but offset by a few seconds.

alias: School Calendrer Toggle
description: ""
trigger:
  - platform: calendar
    event: start
    offset: "-20:0:0"
    entity_id: calendar.kids_school
    id: 'on'
    alias: Before Kids Start
  - platform: calendar
    event: start
    offset: "0:0:5"
    entity_id: calendar.kids_school
    id: 'on'
    alias: Kids Start
  - platform: calendar
    event: end
    offset: "0:0:0"
    entity_id: calendar.kids_school
    id: 'off'
    alias: Kids End
condition:
  - condition: template
    value_template: >
      {{ trigger.calendar_event.summary is search('(Break|Holiday|Day|Good|Staff)') }}"
action:
  - service: 'input_boolean.turn_{{ trigger.id }}'
    target:
      entity_id: input_boolean.kids_school_helper
mode: single

Thank you i have added that to my automation. my last question is im making a automation based off the trigger status. the automation is basically Sunday my echo and google announce at 5:30 that kids have 30 min before games are done for the day. My question is when there is a holiday on Monday, it wont run of course. But for Monday, Tuesday etc how can I make it run for the next day to check and run the same automation like Sunday.

here is what i have so far:

alias: Game time is over in 30 mins
description: ""
trigger:
  - platform: time
    at: "17:30:00"
condition: []
action:
  - choose:
      - conditions:
          - condition: time
            weekday:
              - sun
          - condition: state
            entity_id: input_boolean.kids_school_helper
            state: "off"
        sequence:
          - parallel:
              - if:
                  - condition: state
                    entity_id: media_player.gaming_tv_s_kids
                    state: playing
                then:
                  - service: media_player.media_play_pause
                    data: {}
                    target:
                      entity_id:
                        - media_player.gaming_tv_s_kids
              - service: tts.speak
                data:
                  cache: true
                  media_player_entity_id: media_player.google_nest
                  message: >-
                    Just a reminder, that you have 30 minutes left until game
                    time is over.
                target:
                  entity_id: tts.google_en_com
              - service: notify.alexa_media_jamar_echo_2
                data:
                  message: >-
                    Just a reminder, that you have 30 minutes left until game
                    time is over.
              - service: tts.speak
                data:
                  cache: true
                  media_player_entity_id: media_player.paris_google_mini
                  message: >-
                    Just a reminder, that you have 30 minutes left until game
                    time is over.
                target:
                  entity_id: tts.google_en_com
              - service: notify.alexa_media_animeking_echo_dot
                data:
                  message: >-
                    Just a reminder, the kids have 30 minutes left until game
                    time is over.
              - if:
                  - condition: state
                    entity_id: media_player.gaming_tv_s_kids
                    state: paused
                then:
                  - service: media_player.media_play_pause
                    data: {}
                    target:
                      entity_id:
                        - media_player.gaming_tv_s_kids
      - conditions:
          - condition: time
            weekday:
              - mon
              - tue
              - wed
              - thu
          - condition: state
            entity_id: input_boolean.kids_school_helper
            state: "on"
        sequence:
          - parallel:
              - if:
                  - condition: state
                    entity_id: media_player.gaming_tv_s_kids
                    state: playing
                then:
                  - service: media_player.media_play_pause
                    data: {}
                    target:
                      entity_id:
                        - media_player.gaming_tv_s_kids
              - service: tts.speak
                data:
                  cache: true
                  media_player_entity_id: media_player.google_nest
                  message: >-
                    Just a reminder, that you have 30 minutes left until game
                    time is over.
                target:
                  entity_id: tts.google_en_com
              - service: notify.alexa_media_jamar_echo_2
                data:
                  message: >-
                    Just a reminder, that you have 30 minutes left until game
                    time is over.
              - service: tts.speak
                data:
                  cache: true
                  media_player_entity_id: media_player.paris_google_mini
                  message: >-
                    Just a reminder, that you have 30 minutes left until game
                    time is over.
                target:
                  entity_id: tts.google_en_com
              - service: notify.alexa_media_animeking_echo_dot
                data:
                  message: >-
                    Just a reminder, the kids have 30 minutes left until game
                    time is over.
              - if:
                  - condition: state
                    entity_id: media_player.gaming_tv_s_kids
                    state: paused
                then:
                  - service: media_player.media_play_pause
                    data: {}
                    target:
                      entity_id:
                        - media_player.gaming_tv_s_kids
    alias: School Day Options
mode: single

The scenario is my kids can only play video games on weekends and holidays during school. On Sunday the day before school the games stop at 6:00pm unless Monday is a holiday. That’s the automation I am trying to accomplish Just to remind them.

You’re welcome!

Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.

For more information about the Solution tag, refer to guideline 21 in the FAQ.


This topic now contains over 40 posts to answer your original question. Please consider creating a new topic for additional questions.

created 2nd post: Reminder for kids (videogames turn off)

Again thank you for helping me with the first part

1 Like