Added in more Holiday announcements #288

This commit is contained in:
ccostan 2020-05-23 14:09:48 -04:00
parent b65043a531
commit 688a25ef27
1 changed files with 11 additions and 6 deletions

View File

@ -147,14 +147,19 @@
{# YOUTUBE VIDEO ********* https://www.vcloudinfo.com/2019/11/adding-days-until-sensor-to-my-home-assistant-speech-routines.html #}
{%- macro days_until() -%}
{% set month=states("sensor.date").split('-')[1] | int %}
{%- if month == 4 or month == 5 -%}
and don't forget, there are {{ states.sensor.mothers_countdown.state }} days until Mothers day!
{%- elif month == 6 -%}
{%- if states('sensor.mothers_countdown') | int < 30 -%}
and don't forget, there are {{ states.sensor.mothers_countdown.state }} days until Mothers day!
{%- elif states('sensor.fathers_countdown') | int < 30 -%}
and don't forget, there are {{ states.sensor.fathers_countdown.state }} days until Fathers day!
{%- elif month == 9 or month == 10 -%}
{%- elif states('sensor.easter_countdown') | int < 15 -%}
and don't forget, there are {{ states.sensor.easter_countdown.state }} days until Easter Sunday!
{%- elif states('sensor.thanksgiving_day_countdown') | int < 30 -%}
and don't forget, there are {{ states.sensor.thanksgiving_day_countdown.state }} days until Thanksgiving!
{%- elif states('sensor.halloween_countdown') | int < 30 -%}
and don't forget, there are {{ states.sensor.halloween_countdown.state }} days until Halloween!
{%- elif month == 11 or month == 12 -%}
{%- elif states('sensor.chanukkah_countdown') | int < 15 -%}
and don't forget, there are {{ states.sensor.chanukkah_countdown.state }} days until Chanukkah!
{%- elif states('sensor.christmas_countdown') | int < 30 -%}
and don't forget, there are {{ states.sensor.christmas_countdown.state }} days until Christmas!
{% endif %}
{%- endmacro -%}