I’ve been connecting everything I can to my Home Assistant lately, from my BBQ smoker to a small fleet of robotic vacuums. It’s excellent for reducing cognitive load, centralizing all your home’s needs in one glorious dashboard that you can automate in many ways.
But I realized I’ve been creating more scheduling issues by looking for things to add, when I should have been looking for existing scheduled events to make them better. After integrating Google Calendar and some specific calendars for various series of events, my smart home is now calendar-aware and can run automations based on calendar events with particular keywords in them, reducing the number of things I need to do for regularly scheduled tasks, like work meetings. Just a few minutes was all I needed to save at least five minutes before every Google Meet event, and that’s just the tip of the iceberg.
Integrating Google Calendar was the easy bit
Home Assistant makes it easy to build solid frameworks out
While Home Assistant can use either local or web calendars to trigger automations, my life is pretty much contained inside Google, so Google Calendar is where I started. I’ve even got calendars for the whole family, and for individual members, so that every event can be scheduled without looking like everything is overlapping on one messy dashboard.
To get Google Calendar in Home Assistant requires two things. A client ID and client secret created in the Google Developers Console for the Google Calendar API, and the Google Calendar integration for Home Assistant. The tricky part is finding your way around the GDC, because it’s a complicated mess, but the steps in the Home Assistant integration page are correct. I had some issues with setting up an OAuth Client, but creating a new one as a Web Application got things working.
Then, I added the Google Calendar integration and put the OAuth Client ID and Client Secret into the pop-up. That gave me a new sidebar option in HA for the Calendar, and a button at the bottom to add new events. Now all I have to do is figure out precisely what sequences of events any given calendar event will trigger.
Deciding who, what, and when to trigger from calendar events was not
This took some thinking about how to ensure the correct events were utilized
Now that Google Calendar is set up, we can use it as a trigger for all kinds of automation. If HASS.Agent is installed on your computer, you can use the calendar events to open programs or send notifications, or anything you can turn into a macro, like changing the ARGB lights in your PC to a different color or to flash, getting your attention about whatever the event is.
Or you can use it for internal Home Assistant automations, using the same calendar triggers but to control other devices connected to your HA install.
An example of a calendar trigger would be:
automation:
– alias: “Calendar notification”
triggers:
– trigger: calendar
event: start
entity_id: calendar.personal
actions:
– action: persistent_notification.create
data:
message: >-
Event {{ trigger.calendar_event.summary }} @
{{ trigger.calendar_event.start }}
This sends a notification with the title and start time of the event, and will allow multiple events starting at the same time. It’s essential to know the limitations of this system, as the integration checks Google Calendar every 15 minutes, so that’s the minimum time between events.
Ideas of what to trigger
The tricky part is deciding which calendar events are worth adding automation to. Maybe you
Video meeting automation: I have an automation triggered from keywords like meeting, call, Teams, Zoom, or conference that flashes my smart bulbs 15 minutes before the call so that I can get ready. It also turns off the volume on my Sonos system (if anything is playing), and turns on all the lighting in my office.
HVAC: I have another one that checks for any meetings or events that aren’t at our home address, then checks for the presence of our smartphones before turning the HVAC to a more efficient setting based on the time of year. If either of our phones is still at home, the automation won’t change the HVAC, so we stay comfortable.
Trash collection: I have a separate calendar that has our refuse, recycling, and bulk trash dates on it, plus any non-standard changes due to holidays. This gets sent to my phone the night before pickup day, as another layer of reminders to put the bins out.
Birthdays: I never miss a birthday now thanks to a birthday calendar for family and friends that reminds me in advance to get presents, cards, or just to wish them a special day.
Home maintenance: Things like smoke alarm tests, battery changes, water tank sediment draining, and more get their own calendar. This currently only notifies me of when they should be done, but I want to add a running checklist so that I have a record of doing each thing when the time has come.
I’m sure I could put a ton more things, but we both work from home, our schedules are fairly simple, and I don’t want to add more complexity when unnecessary. I’m sure that as our family needs grow, I’ll find more things to add, and see more ways of chaining different smart home devices together off the events calendar.
Making my smart home calendar-aware was eye-opening
Now my smart home is part of the notifications and feedback loop that I use to remember all the tasks that need to be done. And for tasks like those pesky video calls, having Home Assistant set up the environment for the call each time takes a ton of stress away from me, when I’m usually running around trying to get everything ready before the call starts. Having Home Assistant be calendar-aware makes it smarter and able to respond to my family’s needs, once I’ve identified what those needs are and set up handy automations.