tesla-control

command
v0.0.0-...-81a5b18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

README

Tesla Control Utility

The tesla-control application provides a command-line interface for sending commands to Tesla vehicles.

This application does not run on Windows due to limitations in the available Golang BLE packages.

Building

Run go get to install Golang dependencies, and go build to compile.

You may also run go install to place tesla-control in your GOBIN directory.

Key management

Commands are end-to-end authenticated, which means tesla-control requires access to a private key, and the public key must be enrolled on the target vehicle.

We'll use tesla-keygen to generate a key. See the root directory README file for instructions on installing this tool.

Export environment variables shared by these tools:

export TESLA_KEY_NAME=$(whoami)
export TESLA_VIN=<your Tesla's VIN>

Generate a private key in your system keyring, and save the public key to a file:

tesla-keygen create > public_key.pem

Now you can pair your public key with your Tesla. Get in your car and have your NFC card handy. Then run:

tesla-control -ble add-key-request public_key.pem owner cloud_key

The program should instruct you to confirm the new key by tapping your NFC card on the center console.

Sending commands

You should now be able to send commands over BLE:

tesla-control -ble lock

If you've set up your OAuth token (see repository README file), you can also send commands over the Internet:

tesla-control lock

Run tesla-control -h to see a full list of supported commands.

Documentation

Overview

Tesla-control provides a command-line interface for sending commands to Tesla vehicles. It requires either a BLE connection or Tesla Fleet API credentials to the account that owns the vehicle.

The README.md file in the project root contains some examples of use.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL