2017-02-07 06:09:31 +00:00
######################################################################
2017-02-07 06:11:25 +00:00
## Some home facts when we get back home from being away.
2017-02-07 06:09:31 +00:00
######################################################################
- alias : 'Home Stats'
2017-02-16 00:03:05 +00:00
2017-02-07 06:09:31 +00:00
trigger :
- platform : state
entity_id :
- group.family
from : 'not_home'
to : 'home'
2017-02-07 06:11:25 +00:00
for : '00:03:00'
2017-02-16 00:03:05 +00:00
- platform : state
entity_id : input_boolean.home_news
state : 'on'
from : 'off'
2017-02-07 06:09:31 +00:00
action :
2017-02-16 00:03:05 +00:00
- service : input_boolean.turn_off
entity_id : input_boolean.home_news
2017-02-16 01:21:33 +00:00
2017-02-07 06:09:31 +00:00
- service : script.Voice_notify
data_template :
value1 : >
2017-02-14 00:26:22 +00:00
"Welcome Home Costanzo Family. Here is what's going on around the house right now:
2017-02-16 01:21:33 +00:00
{%- macro chore_schedule() -%}
{%if now().strftime("%a") == 'Wed' or now().strftime("%a") == 'Sun'%}
Today is {{now().strftime("%A")}} and {{now().strftime("%A")}} is garbage day.
{%endif%}
{% if now().strftime("%j")|int % 2 != 0 %}
Today is Justin's day to do the chores.
{% else %}
Today is Paige's day to do the chores.
{%endif%}
{%- endmacro -%}
{{chore_schedule()}}
2017-02-16 00:03:05 +00:00
Inside the house, it is {{ states.climate.downstairs.attributes["current_temperature"]}} degrees with around {{states('sensor.downstairs_thermostat_humidity')}} percent humidity. Outside, it is going to be {{states('sensor.dark_sky_minutely_summary')}}
2017-02-07 06:09:31 +00:00
{% if is_state('cover.garadget_large', 'open') -%}
2017-02-16 00:03:05 +00:00
Also, The Large Garage Door is still open
2017-02-07 06:09:31 +00:00
{% endif -%}
{% if is_state('cover.garadget_small', 'open') -%}
2017-02-13 20:39:53 +00:00
{% if is_state('cover.garadget_large', 'open') -%}and
{%- endif %} The small Garage Door is still open.
2017-02-07 21:53:28 +00:00
{% endif %}
2017-02-16 00:03:05 +00:00
. There are
2017-02-07 21:53:28 +00:00
{% for state in states.light if state.state == 'on' -%}
2017-02-13 20:39:53 +00:00
{%- if loop.last -%}
{{ loop.index }}
{%- endif -%}
2017-02-10 20:45:11 +00:00
{%- endfor %} lights on right now."
2017-02-16 00:03:05 +00:00
{% set comma = joiner(', ') %} The
2017-02-10 20:45:11 +00:00
{% for group in states.group|groupby('state') -%}
2017-02-13 20:43:09 +00:00
{%- for entity in group.list if entity.state == 'on' and entity.name.split(' ')[1]|lower == 'lights' and entity.name.split(' ')[0]|lower != 'all' and entity.name.split(' ')[0]|lower != 'interior' -%}
2017-02-13 20:39:53 +00:00
{{ ' and' if loop.last and not loop.first else comma() }}
{{ entity.name }}
{%- endfor -%}
2017-02-16 00:03:05 +00:00
{%- endfor %}