I’m trying to create an automated setup that looks at my calendar and destination and tells me what time I need to wake up to arrive on time.
I thought of two ways but both didn’t pan out:
I also added the Google Travel Time component, which does work. I made a template sensor that converts the start_time of the next Google Calendar event into a timestamp which I tried to feed to the Travel Time component. The configuration looks like this:
It correctly understands sensor.destination, which is retrieved from the next event’s location into a template, but it doesn’t seem to understand sensor.startevent, which is a timestamp to the start time of the next event.
I tried a different approach where an app creates calendar entries for travel time. This solves the waking up part, but I would like to retrieve the location to the event after the travel time appointment. Home Assistant only shows me the next calendar entry, though I read about it being able to show 5 entries by default. How do you view those next entries?
That’s not correct. This field does not accept a sensor. It accepts timestamps only. So if you want to arrive at the place at 8 am, you’d place ‘08:00:00’.
If you want a dynamic time. You need to calculate everything yourself on the fly. Meaning:
You need to make a template sensor that takes the sesnor.startevent time, subtract the current drive time duration. Then compare that result to the current time.
Thank you for helping me! I’m going to try that approach.
Do you happen to know how you can view the 5 default entries per calendar and use them as inputs as well? I noticed the Lovelace Calendar Card can see the events, but I have no idea how to do it manually.
The card uses the calendar.default information to show 5 entries. The card requests 7 but gets the default 5 from the optional max_entries setting. Makes me think it’s hiding somewhere.
I did manage to get it to work just like Petra mentioned. I have an automation that checks if my travel time is more than 3 minutes and if so it adds another 15 minutes so I can get to my car and have some time left for parking as well. If I’m at home I use TTS and my Sonos speakers to announce that I have to leave. It also sends a notification to my phone with a clickable URL so Apple Maps opens up with the address I need to go too.
A separate wake-up automation looks at the first appointment + travel time + 15 minutes as well. 25 minutes before the wake up time lights turn from a dark red color with brightness 1 to the Adaptive Light (HACS integration) configuration that matches that time of day in a slow transition.
The Google Maps Travel Time and Waze Travel Time integration is currently broken. It won’t pass addresses, but a fix is in the works.
I have an automation calculating Time To Leave every time my calendar or googletraveltime updates and have the result saved in a input_datetime helper that I can also check in the UI. Another automation checks if that date/time passed and sends out a notification with the address to my next destination. It’s a bit messy still, so that’s why I haven’t posted the whole thing.
Travel time gets updated every 5 minutes and the automation picks up on that. Traffic can build anytime but I haven’t ran into any problems yet with this approach.