###################################
# @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
##  Start Up Section
##  Video Explanation can be found here :
##  https://www.vcloudinfo.com/2019/06/how-to-use-template-conditions-in-home-assistant.html
###################################

- alias: Check if it's summer vacation on startup.
  hide_entity: True
  trigger:
    - platform: homeassistant
      event: start
    - platform: time_pattern
      hours: '/12'

  condition:
    - condition: template
      value_template: >
        {% set month=states("sensor.date").split('-')[1] | int %}
        {%- if month == 6 or month == 7 -%}
          true
        {%- endif -%}

  action:
    - service: input_boolean.turn_off
      entity_id: input_boolean.school_mode