Well, since I have not yet been able to get the calendar data into the template yet, I don’t have that specific part of the tempate built. But the gist of it is that it is a “morning briefig” that plays first thing in the morning when my wife or I go into the kitchen to get our morning coffee. The templat eselects from a bunch of random “Good moning” statements. It then gives the current weather forecast, recommends clothing such as a coat or umbrella. Next will come calendar information, and then finnaly the daily Bible verse. The plan is to grow the template as I add more devices and integrations into Home Assistant.
That said, here is the general calendar intent. First of all I have 8 calendars, altogether. (There are reasons for keeping them separate, so I don’t want to combine them.) They are as follows:
- calendar.anniversary
- calendar.birthday
- calendar.holidays_us
- calendar.us_awareness_days
- calendar.vacation
- calendar.mike_calendar
- calendar.sheryl_calendar
- calendar.house_party
-
The top 5 calendars contain events that span the day (or multiple days in the case of vacations). The bottom 3 are items that have a specific start and end time. I would like the template to break them down by calendar, and state the following:
“Your personal calendar agenda for today includes the following:”
(a list, item by item of event name and start time) - or,
“You have no personal calendar events, today.”
“Your house party event for today is:”
(the event name and start time)- or,
“You have no house party events, today”
"Today is the anniversary of: "
husband and wife (that is how it is in the calendar, so simply the message attribute)
or no text if it is empty
“Today is the birthday of:”
(name of person listed)
or no text if it is empty
“Today is the US Holiday called:”
(holiday name)
or no text if it is empty
“Today is:”
(US Awareness day)
or no text if it is empty
“Today is your vacation:”
(name lsited for vaction event subject)
or no text if it is empty
If none of the 5 above has any data for the day, then it would select from the following random text:
{{ [
‘You have no special days today.’,
‘There are no special days occurring today.’,
‘There is nothing exciting going on today.’
] | random }}
I know this is fairly long, and I have some of the template built. Here is an example, keeping in mind that the variable name is wrong:
{% if mike_calendar_events | length > 0 %}
Your personal calendar agenda for today includes the following:
{% for event in mike_calendar_events %}
{{ event.start }}: {{ event.summary }}
{% endfor %}
{% else %}
Personal Calendar:
You have no personal calendar events.
{% endif %}
{% else %}
no calendar data available
{% endif %}
Let me know what else you would like to know.