PHP Application Library for Tesla API
PHP
Latest commit 7fb40ad Jan 14, 2017 @wardmundy committed on GitHub Update config.php
Permalink
Failed to load latest commit information.
LICENSE
README.md
charge_state.php
climate_state.php
config.php
drive_state.php
gui_settings.php
init.php
set_car_doors_lock.php
set_car_doors_unlock.php
set_car_wakeup.php
set_charge_limit_max.php
set_charge_limit_std.php
set_hvac_off.php
set_hvac_on.php
set_hvac_temp.php
set_valet_mode_off.php
set_valet_mode_on.php
set_valet_pin_null.php
token.php
vehicle.php
vehicle_state.php

README.md

php-api-tesla

PHP Application Library for Tesla API

Copyright (c) 2017, Ward Mundy & Associates LLC with GPL3 License

Getting Started

  1. Install all files in a secure directory on your LAMP server: git clone https://github.com/wardmundy/php-api-tesla.git

  2. Run scripts from command line only! Switch to php-api-tesla directory before proceeding and chmod +x *.php.

  3. Edit config.php: set install directory, Tesla credentials and desired valet PIN and temp settings for car.

  4. Before doing anything else, run these two scripts in the following order: ./token.php AND ./vehicle.php

All of the rest of the scripts will then work properly for 90 DAYS, e.g. ./vehicle_state.php

Comments

NOTE: TOKENS last for 90 days! After 90 days, you must rerun token.php and vehicle.php. You'll be reminded.

FUTURE-PROOFING: A web app is coming soon. Please be sure your web server has access to the install directory.

RESOLVING FAILURES: If you get a failure noting "could_not_wake_buses", simply rerun the script a second time.

Special thanks to Hank Lloyd Right of the Tesla Motors Forum for numerous PHP suggestions.