For a good while now I have been using hass-config based on matt8707 config on my Home Assistant instance. It is still great looking and highly functional, allowing me to glance at the most important information and interact with my smart home.
I read somewhere on a Home Assistant forum about a Node-RED flow that collects various kinds of information and presents to Home Assistant.
Based on that I created my own template which is then rendered to a daily digest or briefing text. When a kitchen motion sensor detects movement in the morning between 6:00 AM and 12:00 AM for the first time, that text is then fed to TTS service and spoken on a Google Next Mini speaker.
The information provided is the usual:
- Current and expected weather, incl. temperature, wind, rainfall, etc.
- Estimated commute time to work.
- Reminder to put out trash if today is the day.
- Calendar events for today.
- Kids school plan for the day.
- Expected package deliveries.
Here is the template if you find it useful:
Good moring. Today is
{#- Date -#}
{%- set days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] -%}
{%- set months = ['January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December'] %}
{% set temp = states('sensor.openweathermap_feels_like_temperature')|round %}
{{- days[now().weekday()] }} {{ strptime(states('sensor.date'), '%Y-%m-%d').day }} {{ months[now().month-1] }}.
{#- Weather -#}
Currently the weather is {{states('sensor.openweathermap_weather')}} and temperature feels like: {{ temp }}
{%- if temp|int == 1 %} degree.
{% elif (temp|int % 10 >= 2 and temp|int % 10 <= 4 and (temp|int % 100 < 10 or temp|int % 100 >= 20)) %} degrees.
{% else %} degrees.
{% endif -%}
{%- set forecast = state_attr('sensor.weather_forecast_daily','forecast')[0] -%}
{%- set condition = forecast.condition -%}
{%- set temp = forecast.temperature |round -%}
Today will be {% if condition == 'clear-night' -%}clear
{%- elif condition == 'cloudy' -%}cloudy
{%- elif condition == 'exceptional' -%}exceptional
{%- elif condition == 'fog'-%}foggy
{%- elif condition == 'hail' -%}hail
{%- elif condition == 'lightning' -%}stormy
{%- elif condition == 'lightning-rainy' -%}stormy and rainy
{%- elif condition == 'partlycloudy' -%}partly cloudy
{%- elif condition == 'pouring' -%}heavy rain
{%- elif condition == 'rainy' -%}rainy
{%- elif condition == 'snowy' -%}snowy
{%- elif condition == 'snowy-rainy' -%}rain with snow
{%- elif condition == 'sunny' -%}sunny
{%- elif condition == 'windy' -%}windy
{%- elif condition == 'windy-variant' -%}windy
{% endif -%}, and the maximum temperature will be: {{ temp }}
{%- if temp|int == 1 %} degree.
{% elif (temp|int % 10 >= 2 and temp|int % 10 <= 4 and (temp|int % 100 < 10 or temp|int % 100 >= 20)) %} degrees.
{% else %} degrees.
{% endif -%}
The wind will blow from {% set windbearing = ((forecast.wind_bearing |int / 45) % 8) |round %}
{%- set winddir = ['north', 'northeast','east','southeast','south','southwest','west','northwest', 'north'] -%}
{{ winddir[windbearing] }} with speed {{forecast.wind_speed|round}} km/h.
{% if forecast.precipitation_probability |int == 0 %} No rain expected today.
{% else -%} Forecasted precipitation is {{ forecast.precipitation | replace(".", ",") }} millimeters.
{% endif -%}
{#- Commute time -#}
{{ Commute time to work: {{states('sensor.home_to_work')}} minutes. }}
{#- Garbage reminder #}
{% set entities = states.sensor | selectattr('attributes.device_class', 'defined')
| selectattr('attributes.device_class', 'eq', 'garbage_collection__schedule')
| rejectattr('entity_id', 'search', 'garbage')
| list -%}
{% if entities -%}
{% if entities | selectattr('attributes.days','eq', 1) | list | count > 0 -%}
Remember to take out the trash tonight: {% for sensor in entities if sensor.attributes.days == 1 -%}
{% if not loop.first %}{% if not loop.last %}, {% else %} and {% endif %}{% endif %}{{ sensor.name | lower }}
{%- endfor -%}.
{% endif -%}
{% endif -%}
{#- Calendar -#}
{%- set entities = states.sensor | selectattr('entity_id','search','ical_calendar')
| selectattr('attributes.start','defined') | list -%}
{%- set ns = namespace(today=false) -%}
{%- for item in entities %}
{%- if item.attributes.start.strftime('%Y-%m-%d') == now().strftime('%Y-%m-%d') -%}
{%- set ns.today = true -%}
{%- endif -%}
{%- endfor -%}
{% if ns.today %}
today in your calendar you have {% for sensor in entities if sensor.attributes.start.strftime('%Y-%m-%d') == now().strftime('%Y-%m-%d') -%}
{% if not loop.first %}{% if not loop.last %}, {% else %} and {% endif %}{% endif %}
{{- sensor.name + '\n' | lower }} at {{ sensor.attributes.start.strftime('%H:%M') }}
{% endfor %}.
{%- else %}You have nothing in your calendar today. {% endif -%}
{#- Kid 1 School Schedule -#}
{%- set ns = namespace(today=false) -%}
{%- set ns.tomorrow=false -%}
{# Get a list of calendar event entities with start times #}
{%- set entities = states.sensor | selectattr('entity_id','search','ical_school_schedule_kid1') | selectattr('attributes.start','defined') | list -%}
{# Check if there is any event today or tomorrow #}
{%- if entities -%}
{%- set first = (entities | first).attributes.start.strftime('%H:%M') -%}
{%- for item in entities -%}
{%- if item.attributes.start.strftime('%Y-%m-%d') == now().strftime('%Y-%m-%d') -%}
{%- set ns.today = true -%}
{%- elif item.attributes.start.strftime('%Y-%m-%d') == (now() + timedelta(days=1)).strftime('%Y-%m-%d') -%}
{%- set ns.tomorrow = true -%}
{%- endif -%}
{%- endfor %}
{# If there is at least one event today, iterate over them #}
{%- if ns.today -%}
Kid 1 starts today at {{ first }} and has:{{ '\n' }}
{% for sensor in entities if sensor.attributes.start.strftime('%Y-%m-%d') == now().strftime('%Y-%m-%d') -%}
{%- set start_time = sensor.attributes.start -%}
{%- set event = sensor.attributes.summary -%}
{%- if start_time != None -%}
{% if not loop.first %}{% if not loop.last %}, {% else %} and {% endif %}{% endif %}{{ event }}.
{% if loop.last %}
Classes end at {{ sensor.attributes.end.strftime('%H:%M') }}.
{% endif %}
{%- endif -%}
{%- endfor -%}.
{%- endif -%}
{% endif %}
{#- Kid 2 School Schedule -#}
{%- set ns = namespace(today=false) -%}
{%- set ns.tomorrow=false -%}
{# Get a list of calendar event entities with start times #}
{%- set entities = states.sensor | selectattr('entity_id','search','ical_school_schedule_kid2') | selectattr('attributes.start','defined') | list -%}
{# Check if there is any event today or tomorrow #}
{%- if entities -%}
{%- set first = (entities | first).attributes.start.strftime('%H:%M') -%}
{%- for item in entities -%}
{%- if item.attributes.start.strftime('%Y-%m-%d') == now().strftime('%Y-%m-%d') -%}
{%- set ns.today = true -%}
{%- elif item.attributes.start.strftime('%Y-%m-%d') == (now() + timedelta(days=1)).strftime('%Y-%m-%d') -%}
{%- set ns.tomorrow = true -%}
{%- endif -%}
{%- endfor %}
{# If there is at least one event today, iterate over them #}
{%- if ns.today -%}
Kid 2 starts today at {{ first }} and has:{{ '\n' }}
{% for sensor in entities if sensor.attributes.start.strftime('%Y-%m-%d') == now().strftime('%Y-%m-%d') -%}
{%- set start_time = sensor.attributes.start -%}
{%- set event = sensor.attributes.summary -%}
{%- if start_time != None -%}
{% if not loop.first %}{% if not loop.last %}, {% else %} and {% endif %}{% endif %}{{ event }}.
{% if loop.last %}
Classes end at {{ sensor.attributes.end.strftime('%H:%M') }}.
{% endif %}
{%- endif -%}
{%- endfor -%}.
{%- endif -%}
{% endif %}
{#- Packages -#}
{%- if states("sensor.mail_poczta_polska_delivering")|int(0) > 0 -%}
{% set item = states("sensor.mail_poczta_polska_delivering")|int(0) -%}
Polish Post will deliver today{{' '}}
{%- if item == 1 -%}
1 package.
{%- elif (item % 10 >= 2 and item % 10 <= 4 and (item % 100 < 10 or item % 100 >= 20)) -%}
{{ item }} packages.
{%- elif item >4 -%}
{{ item }} packages.
{%- endif -%}
{%- endif -%}
{%- if states("sensor.mail_dhl_delivering")|int(0) > 0 -%}
{% set item = states("sensor.mail_dhl_delivering")|int(0) -%}
DHL will deliver today{{' '}}
{%- if item == 1 -%}
1 package.
{%- elif (item % 10 >= 2 and item % 10 <= 4 and (item % 100 < 10 or item % 100 >= 20)) -%}
{{ item }} packages.
{%- elif item >4 -%}
{{ item }} packages.
{%- endif -%}
{%- endif -%}
{%- if states("sensor.mail_dpd_com_pl_delivering")|int(0) > 0 -%}
{% set item = states("sensor.mail_dpd_com_pl_delivering")|int(0) -%}
DPD will deliver today{{' '}}
{%- if item == 1 -%}
1 package.
{%- elif (item % 10 >= 2 and item % 10 <= 4 and (item % 100 < 10 or item % 100 >= 20)) -%}
{{ item }} packages.
{%- elif item >4 -%}
{{ item }} packages.
{%- endif -%}
{%- endif -%}
{%- if states("sensor.mail_gls_delivering")|int(0) > 0 -%}
{% set item = states("sensor.mail_dpd_com_pl_delivering")|int(0) -%}
GLS will deliver today{{' '}}
{%- if item == 1 -%}
1 package.
{%- elif (item % 10 >= 2 and item % 10 <= 4 and (item % 100 < 10 or item % 100 >= 20)) -%}
{{ item }} packages.
{%- elif item >4 -%}
{{ item }} packages.
{%- endif -%}
{%- endif -%}
{%- if states("sensor.mail_inpost_pl_delivering")|int(0) > 0 -%}
{% set item = states("sensor.mail_inpost_pl_delivering")|int(0) -%}
InPost will deliver today{{' '}}
{%- if item == 1 -%}
1 package.
{%- elif (item % 10 >= 2 and item % 10 <= 4 and (item % 100 < 10 or item % 100 >= 20)) -%}
{{ item }} packages.
{%- elif item >4 -%}
{{ item }} packages.
{%- endif -%}
{%- endif -%}
{%- if states("sensor.mail_ups_delivering")|int(0) > 0 -%}
{% set item = states("sensor.mail_ups_delivering")|int(0) -%}
UPS will deliver today{{' '}}
{%- if item == 1 -%}
1 package.
{%- elif (item % 10 >= 2 and item % 10 <= 4 and (item % 100 < 10 or item % 100 >= 20)) -%}
{{ item }} packages.
{%- elif item >4 -%}
{{ item }} packages.
{%- endif -%}
{%- endif -%}
{%- if states("sensor.mail_amazon_packages")|int(0) > 0 -%}
{% set item = states("sensor.mail_amazon_packages")|int(0) -%}
Amazon will deliver today{{' '}}
{%- if item == 1 -%}
1 package.
{%- elif (item % 10 >= 2 and item % 10 <= 4 and (item % 100 < 10 or item % 100 >= 20)) -%}
{{ item }} packages.
{%- elif item >4 -%}
{{ item }} packages.
{%- endif -%}
{%- endif -%}
Have a nice day!
This will result in the following example text:
Good morning. Today is Wednesday 9 April.Currently the weather is cloudy and temperature feels like: 8 degrees. Today will be partly cloudy, and the maximum temperature will be: 10 degrees. The wind will blow from northwest with speed 16 km/h. No rain expected today. Commute time to work: 10 minutes. Remember to take out the trash tonight: segragated and bio. Today in your calendar you have: Event 1 at 9:30 and Event 2 at 16:30. Kid 1 starts today at 11:00 and has: English, English, PE and Biology. Classes end at 15:35. Kid 2 starts today at 10:00 and has: Maths, English, Chemisty and PE. Classes end at 14:35. DPD will deliver today 1 package. Have a nice day!
Don’t mind the odd whitespace - if you are going to use TTS they won’t matter. If you want a nicely formatted text you need to adjust Jinja whitespace control.
You can find the Polish version directly on Github .