From 688a25ef274bcbd635bb138d60179b4455c6afaf Mon Sep 17 00:00:00 2001 From: ccostan Date: Sat, 23 May 2020 14:09:48 -0400 Subject: [PATCH] Added in more Holiday announcements #288 --- config/templates/speech/briefing.yaml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/config/templates/speech/briefing.yaml b/config/templates/speech/briefing.yaml index 5480a636..429f5642 100755 --- a/config/templates/speech/briefing.yaml +++ b/config/templates/speech/briefing.yaml @@ -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 -%}