2018-01-02 00:00:45 +00:00
|
|
|
###################################
|
2019-06-30 16:57:16 +00:00
|
|
|
# @CCOSTAN
|
|
|
|
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
2018-01-02 00:00:45 +00:00
|
|
|
## Start Up Section
|
2019-06-30 16:57:16 +00:00
|
|
|
## Video Explanation can be found here :
|
|
|
|
## https://www.vcloudinfo.com/2019/06/how-to-use-template-conditions-in-home-assistant.html
|
2018-01-02 00:00:45 +00:00
|
|
|
###################################
|
|
|
|
|
|
|
|
- alias: Check if it's summer vacation on startup.
|
2020-03-29 19:38:12 +00:00
|
|
|
|
2018-01-02 00:00:45 +00:00
|
|
|
trigger:
|
|
|
|
- platform: homeassistant
|
|
|
|
event: start
|
2019-06-30 16:57:16 +00:00
|
|
|
- platform: time_pattern
|
|
|
|
hours: '/12'
|
2018-01-02 00:00:45 +00:00
|
|
|
|
|
|
|
condition:
|
|
|
|
- condition: template
|
|
|
|
value_template: >
|
|
|
|
{% set month=states("sensor.date").split('-')[1] | int %}
|
2020-03-29 19:38:12 +00:00
|
|
|
{%- if month == 4 or month == 5 or month == 6 or month == 7 -%}
|
2018-01-02 00:00:45 +00:00
|
|
|
true
|
|
|
|
{%- endif -%}
|
|
|
|
|
|
|
|
action:
|
|
|
|
- service: input_boolean.turn_off
|
|
|
|
entity_id: input_boolean.school_mode
|