Additional update for FATHER'S Day #288.
This commit is contained in:
parent
a3d03fa158
commit
e59c99a4b7
|
@ -90,6 +90,13 @@ sensor:
|
|||
value_template: "{{ (value|replace(' days', '')) | int }}"
|
||||
unit_of_measurement: Days
|
||||
scan_interval: 43200
|
||||
|
||||
- platform: rest
|
||||
name: Father's Day Countdown
|
||||
resource: !secret wolframalpha_fathersday_api
|
||||
value_template: "{{ (value|replace(' days', '')) | int }}"
|
||||
unit_of_measurement: Days
|
||||
scan_interval: 43200
|
||||
###############################################################################
|
||||
# Automation that notifies of a Holiday "state" change
|
||||
###############################################################################
|
||||
|
|
|
@ -121,6 +121,19 @@
|
|||
{% endif %}
|
||||
{%- endmacro -%}
|
||||
|
||||
{%- macro days_until() -%}
|
||||
{% set month=states("sensor.date").split('-')[1] | int %}
|
||||
{%- if month == 5 -%}
|
||||
There are {{ states.sensor.mothersday_countdown.state }} days until Mothers day!
|
||||
{%- elif month == 6 -%}
|
||||
There are {{ states.sensor.fathersday_countdown.state }} days until Fathers day!
|
||||
{%- elif month == 10 -%}
|
||||
There are {{ states.sensor.halloween_countdown.state }} days until Halloween!
|
||||
{%- elif month == 12 -%}
|
||||
There are {{ states.sensor.xmas_countdown.state }} days until Christmas!
|
||||
{% endif %}
|
||||
{%- endmacro -%}
|
||||
|
||||
{% macro inspirational_quote() %}
|
||||
{% set inspirational_quote = [
|
||||
"and one more thing, Life is about making an impact, make it a positive one. ",
|
||||
|
|
|
@ -77,3 +77,4 @@ wolframalpha_halloween_api: https://api.wolframalpha.com/v2/result?appid=JIUY8U-
|
|||
wolframalpha_xmas_api: https://api.wolframalpha.com/v2/result?appid=JIUY8U-4V8KY45VT1&i=How%20many%20days%20until%20christmas
|
||||
wolframalpha_easter_api: https://api.wolframalpha.com/v2/result?appid=JIUY8U-4V8KY45VT1&i=How%20many%20days%20until%20easter
|
||||
wolframalpha_mothersday_api: https://api.wolframalpha.com/v2/result?appid=JIUY8U-4V8KY45VT1&i=How%20many%20days%20until%20mothers%20day
|
||||
wolframalpha_fathersday_api: https://api.wolframalpha.com/v2/result?appid=JIUY8U-4V8KY45VT1&i=How%20many%20days%20until%20fathers%20day
|
||||
|
|
Loading…
Reference in New Issue