Tesla Dashboard Tile, Charge Logging & Notifications


#1

The following is an early effort at using webCoRE with the Tesla API.

The first piston obtains the required OAuth API token and expiration date, plus the Vehicle ID. It also creates a new token prior to the expiration date of the old one. Instructions for the piston are included in the comments just below the Define Variable section. Basically, just add your Tesla email address & account password, create the required Global variables, save and click Test.

The second piston will run successfully ONLY AFTER the first piston has been run successfully and your credentials have been stored in the global variables you created. The second piston a) creates a dashboard tile with the current battery level and mileage estimate, b) uses IFTTT to log the kWh of energy added during the last charge and the current odometer reading to Google Sheets, c) sends a reminder when the battery has reached your preferred minimum level, and d) provides a notification of any software updates.

The piston is triggered by a momentary switch that you’ll have to create. Mine is activated via Tasker whenever my phone’s bluetooth connects or disconnects from the Tesla. It could also be triggered by presence, garage door activity, or on a schedule – although be careful you’re not waking the car too often as it will use your battery.

Screenshot_2018-11-26%20webCoRE%20Dashboard

Here’s the IFTTT applet I’m using to log the vehicle charging. (I’m not currently passing an argument for Value 3, but left it there just in case).

Again, this is fairly preliminary work. Many more commands are available for those interested in developing their own pistons. Expanding upon these ideas further one could easily use a voice assistant such as Alexa or Google Assistant as an IFTTT trigger to perform such actions as warming up or unlocking the car, though one should consider imposing restrictions (presence, vehicle location, etc) to ensure this cannot be misused.

For more information on the Tesla API see: https://www.teslaapi.io/

I hope you find this useful. Good luck!


#2

@bthrock you are killing me with this piston :joy::grin::grin:

I had two dreams,
Create a smart home and buy a Tesla.
I had forgotten about the Tesla:)

“Honey, you know how we talked about kids are going to the best colleges…let’s talk again:” :joy::joy::joy:

IF time changes to after {highschool}
and
IF kids grades are > good
and
IF We have plenty of money
Than
Send them to great colleges

“I don’t think that our piston will trigger:))))”