How to Set Up Calendar Automation for Car Reminder

Hi everyone, I’m trying to set up an automation that reminds me to check my car’s maintenance based on a calendar entry. Here’s the scenario: I have a calendar entry named 🚗 in garage that gets created when I press a physical button. I want this automation to trigger if the most recent entry is older than 7 days.

I’ve set up an input_number to 7 and an input_datetime to 12:30. My goal is to have the automation fire at 12:30 if the last car-related event was more than 7 days ago. For example, if today is May 19th and the last entry was on May 12th, I want the notification to go off.

I tried using the calendar.list_events service call to fetch events from the last 7 days, but I’m stuck on how to filter the events to find the one with the matching summary (🚗 car in garage). Once I find that event, I need to check if it’s been more than 7 days since it occurred.

I think this could be simplified with a template sensor that calculates the number of days since the last relevant calendar entry. However, I’m not sure how to implement this. If anyone has experience with Jinja2 or knows a better way to approach this, I’d really appreciate the help! Thanks in advance! :smile: