Since last week I have been the proud driver of a Tesla Model 3. After first trying Autopilot and then experiencing the acceleration capacity, I started looking at the Tesla app. In it you can control everything on the car, but what you can’t do is create a schedule when the climate control must be turned on and off. After some research I found out that a Tesla API could be used and that is how I came up with the idea to heat / cool the Tesla based on my agenda.

Now I also block my travel time in my agenda so I can use that as a trigger. At every meeting in my agenda, Flow checks 5 minutes before time to see if the word ‘Reizen’ appears in the title (that is dutch for travel).

If it really concerns ‘Reizen’ then we will log in to my Tesla account and create an access token. With this token we have access to execute further commands to the car.

If the login is successful, I will save the access token. We then collect from Tesla which car(s) are connected to this account. Multiple cars can be linked to 1 account. In my Flow, however, I assume that it is only 1. You can also see that I use the access token in the header for authorization.

I then request the current status of the car. I do this because I want to check if someone is currently in the car and the car is locked. Of course I don’t want Flow to change the climate control if someone is driving. That’s why I check if nobody is present and the car is locked.

We are dealing with a battery-powered car. And I would like to get into a car with a nice temperature, but not if this means that I can then no longer drive because the battery is empty. Hence I first check whether the battery is more than 30% full.

Then I get the current climate status. With that data (current inside temperature and set climate control temperature) I can check whether the climate control should actually be on. If this deviates more than 2 degrees, I will continue with the Flow.

If all these conditions are met, I activate the climate control of the Tesla. This makes me nice and warm in the winter and I don’t have to scratch ice. And in the summer it is nice and cool.

I still have a 15 minute delay built in after the activation of the climate control. Of course I don’t want ‘Reizen’ to be in my agenda but for some reason I didn’t go. And then my climate control has been on indefinitely. That is why Flow checks after fifteen minutes if someone is in the car. If not, he switches the climate control off again.