Added in Code for Countdown sensors #288

This commit is contained in:
ccostan 2019-10-06 14:00:44 -04:00
parent 54fc32114d
commit a3d03fa158
3 changed files with 36 additions and 1 deletions

View File

@ -59,6 +59,37 @@ sensor:
False
{% endfor -%}
################################################################################
# Countdown Sesor using WolfRam Alpha Natural language queries
################################################################################
- platform: rest
name: Halloween Countdown
resource: !secret wolframalpha_halloween_api
value_template: "{{ (value|replace(' days', '')) | int }}"
unit_of_measurement: Days
scan_interval: 43200
- platform: rest
name: Christams Countdown
resource: !secret wolframalpha_xmas_api
value_template: "{{ (value|replace(' days', '')) | int }}"
unit_of_measurement: Days
scan_interval: 43200
- platform: rest
name: Easter Countdown
resource: !secret wolframalpha_easter_api
value_template: "{{ (value|replace(' days', '')) | int }}"
unit_of_measurement: Days
scan_interval: 43200
- platform: rest
name: Mother's Day Countdown
resource: !secret wolframalpha_mothersday_api
value_template: "{{ (value|replace(' days', '')) | int }}"
unit_of_measurement: Days
scan_interval: 43200
###############################################################################
# Automation that notifies of a Holiday "state" change
###############################################################################

2
config/templates/speech/briefing.yaml Normal file → Executable file
View File

@ -237,4 +237,4 @@
{% endif %}
{# call a Random fact about the house or inspiration quote #}
{{ ([iss, iss, moon, uv, moon, uv, moon, uv, holiday, holiday, outside_weather, outside_weather, inspirational_quote]|random)() }}
{{ ([iss, moon, uv, holiday, outside_weather, outside_weather, inspirational_quote]|random)() }}

View File

@ -73,3 +73,7 @@ cloud_user_pool: 'SuperSecretPlace'
cloud_relayer: 'SuperSecretWebThingy'
vantage_api: LONGAPIKEYFORFREE
minecraft: private_server.com
wolframalpha_halloween_api: https://api.wolframalpha.com/v2/result?appid=JIUY8U-4V8KY45VT1&i=How%20many%20days%20until%20halloween
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