Automating Car Pre-Conditioning with Google Calendar – Tips and Tricks

Hi everyone, I wanted to share my journey in setting up an automation to pre-condition my wife’s car based on her work schedule in Google Calendar. I hope this helps others who are looking to achieve something similar!

The Goal

I wanted the car to start pre-conditioning 20 minutes before her work shift begins. The idea is to ensure the car is at the perfect temperature when she’s ready to leave. It’s a small but thoughtful way to make her mornings smoother!

The Setup

I decided to use Google Calendar as the trigger since her work schedule is already synced there. Here’s how I approached it:

  1. Google Calendar Integration: I set up the Google Calendar integration in Home Assistant to monitor her calendar events.
  2. Automation Rules: I created an automation rule to trigger when the specific event (“JBM Vagt”) appears on her calendar.
  3. Conditions: I added conditions to ensure the car pre-conditioning only happens if she’s home and her phone is also nearby.
  4. Action: The action is straightforward – send a command to her car (via the mobile app) to start pre-conditioning.

The Code

Here’s the automation code I used:
yaml

  • id: ‘1645084866659’
    alias: Test Calendar
    description: ‘’
    trigger:
    • platform: state
      entity_id: xx_gmail_com
      attribute: message
      to: JBM Vagt
      condition:
    • condition: state
      entity_id: person.josefine
      state: home
    • condition: state
      entity_id: device_tracker.escape_pod_1_location_tracker
      state: home
      action:
    • device_id: ff5578aca08bdc5d61c5a89dc850aac8
      domain: mobile_app
      type: notify
      message: Josefine skal på arbejde.
      mode: single

Challenges and Solutions

  1. Trigger Issues: Initially, the automation wasn’t triggering even though the event was present. I realized the issue was with how the calendar sensor was configured. I made sure to include the correct cal_id and set ignore_availability to true.
  2. Time Zone Sync: Ensuring the time zone settings were correct was crucial. Any mismatch would cause the automation to trigger at the wrong time.
  3. Testing: I tested the automation multiple times with different scenarios to make sure it worked as expected. It’s always good to simulate the conditions to avoid surprises!

Tips for Others

  • Logging: Use the logs to troubleshoot. They provide valuable insights into why an automation might not be working.
  • Simplicity First: Start with a basic setup and gradually add complexity. This makes it easier to identify and fix issues.
  • Community Support: Don’t hesitate to ask for help. The Home Assistant community is fantastic, and someone has likely encountered a similar issue.

Final Thoughts

Seeing the automation work perfectly for the first time was really satisfying! It’s a small project, but it makes a big difference in our daily routine. I’d love to hear how others have automated their car pre-conditioning or any smart home tasks using Google Calendar. Feel free to share your experiences and tips below!

Happy automating! :rocket: