Download the PHP package stephangroen/tesla-php-client without Composer

On this page you can find all versions of the php package stephangroen/tesla-php-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tesla-php-client

tesla-php-client

A PHP client for easy integration of the Tesla API

This client is very basic, so most changes to the Tesla API will automatically be accomodated for. You can find the docs of the API at https://tesla-api.timdorr.com/

Installation

This project can easily be installed through Composer.

One-time authentication process

Before you can start, you will first need to get an access token. This is a one-time process. Fortunatly the client makes this very simple. Get the client_id and client_secret here: http://pastebin.com/fX6ejAHd. You need to add them to you environment via a .env file in your existing project or use the functions supplied by the client. You need your email address and password you use for My Tesla. With these credentials you can get the access token.

The access token is the only authentication token you need after this one-time process.

Use the client

Next time you'd like to use the client, initiate it with the access token:

Get and set your vehicle id

In order to execute vehicle specific calls, you need your vehicle id. Retrieve this by requesting all vehicles for your account:

This will return an array with information about your vehicles. Extract the id from the respone, not the vehicle_id which is used for Tesla internal purposes. You might want to store this id locally for future use. When you have the id, let the client know as follows:

Example call

Calls are very simple, read the source code and API docs to find out all available calls. For example, set the charge limit to 90 percent:

So, for every use you initiate the client and set the vehicle id to execute calls for.

Client response

All calls just return an array with the data as described in the API docs mentioned above.

408 responses

You might get some 408 responses when your vehicle still needs to wake up. Wait for a moment and try again.


All versions of tesla-php-client with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stephangroen/tesla-php-client contains the following files

Loading the files please wait ....