|
|
|
@ -38,19 +38,17 @@ sensor:
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{{ holiday }}
|
|
|
|
{{ holiday }}
|
|
|
|
|
|
|
|
|
|
|
|
# - platform: rest
|
|
|
|
- platform: rest
|
|
|
|
# resource: http://www.webcal.fi/cal.php?id=335&format=json&start_year=current_year&end_year=2020&tz=America%2FNew_York
|
|
|
|
resource: http://www.webcal.fi/cal.php?id=335&format=json&start_year=current_year&end_year=current_year&tz=America%2FNew_York
|
|
|
|
# name: Flag
|
|
|
|
name: Flag
|
|
|
|
# scan_interval: 14400
|
|
|
|
scan_interval: 14400
|
|
|
|
# value_template: >-
|
|
|
|
value_template: >-
|
|
|
|
# {% set is_flag_day = False %}
|
|
|
|
{%- set now_string = now().strftime('%Y-%m-%d') %}
|
|
|
|
# {%- for day_val in value_json -%}
|
|
|
|
{% for day_val in value_json if day_val.date == now_string %}
|
|
|
|
# {% set now_string = now().strftime('%Y-%m-%d') %}
|
|
|
|
True
|
|
|
|
# {%- if day_val.date==now_string and day_val.flag_day==1 -%}
|
|
|
|
{% else %}
|
|
|
|
# {% set is_flag_day = True %}
|
|
|
|
False
|
|
|
|
# {%- endif -%}
|
|
|
|
{% endfor -%}
|
|
|
|
# {% endfor %}
|
|
|
|
|
|
|
|
# {{is_flag_day}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
###############################################################################
|
|
|
|
# Automation that notifies of a Holiday "state" change
|
|
|
|
# Automation that notifies of a Holiday "state" change
|
|
|
|
|