mirror of
https://github.com/thejeffreystone/home-assistant-configuration.git
synced 2025-08-20 20:56:44 +00:00
Added time readout to daily announcements.
This commit is contained in:
@@ -306,6 +306,8 @@ script:
|
||||
"There is something that needs your attention."
|
||||
] | random }}
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
|
||||
{% macro morning_greeting() %}
|
||||
{{ [ "Anchorage House. Rise and Shine. ",
|
||||
@@ -332,6 +334,20 @@ script:
|
||||
] | random }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro time_annc() %}
|
||||
|
||||
{% if now().strftime('%H')|int < 12 %}
|
||||
It is now {{ now().strftime('%H')|int }} {{ now().strftime('%M')|int }} AM.
|
||||
|
||||
{% elif now().strftime('%H')|int > 12 %}
|
||||
It is now {{ now().strftime('%H')|int - 12 }} {{ now().strftime('%M')|int }} PM.
|
||||
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endmacro %}
|
||||
|
||||
{% macro weather_alerts() %}
|
||||
There are currently {{states.sensor.nws_alerts.state }} active weather alerts for our area.
|
||||
The National Weather Service Has issued,
|
||||
@@ -745,6 +761,10 @@ script:
|
||||
{{ evening_greeting() }}
|
||||
{% endif %}
|
||||
|
||||
{% if call_time_annc == 1 %}
|
||||
{{ time_annc() }}
|
||||
{% endif %}
|
||||
|
||||
{% if states.sensor.nws_alerts.state | int > 0 and call_weather_alerts == 1 %}
|
||||
{{ weather_alerts() }}
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user