Skip to content

Latest commit

 

History

History
28 lines (17 loc) · 1.59 KB

readme.md

File metadata and controls

28 lines (17 loc) · 1.59 KB

TeslaCommand

Overview

A Golang program to connect to a Tesla vehicle, determine if it's within a GeoFence, and once it enters, if it's not plugged in, send an email alert.

Given a teslamotors.com account, interval, coordinates, and radius, it connects to the Tesla RESTful API, and determines the vehicles location and charging state.

The command line args are specified via minus sign, argname, equal sign, value.

You must first go on Google Maps or LatLong and get the Longitude and Latitude of the center point of your charging destination.

Installation

Install Go and Git if you don't have them. Go can be tricky with paths. Type $ go env and then $ cd into directory in $GOROOT/src. Clone this repository from within the src directory.

$ git clone https://github.com/morrisonbrett/TeslaCommand.git

$ cd TeslaCommand

Below is an example run. The long/lat is for the Tesla Hawthorne, CA Supercharger (replace with your own values):

$ go run TeslaCommand.go -checkInterval=300 -fromAddress="[email protected]" -geoFenceLatitude=33.921063 -geoFenceLongitude=-118.33015434 -mailServer="smtp.gmail.com" -mailServerLogin="[email protected]" -mailServerPassword="the-gmail-password" -mailServerPort=587 -radius=200 -teslaLoginEmail="[email protected]" -teslaLoginPassword="the-teslamotors-password" -toAddress="[email protected]" -vehicleIndex=0

Please see the "Issues" link for a list of "TO DO" items. It's a work in progress... :-)