• Stars
    star
    1,959
  • Rank 22,601 (Top 0.5 %)
  • Language
    Ruby
  • License
    MIT License
  • Created about 11 years ago
  • Updated 26 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿš˜ A Ruby gem and unofficial documentation of Tesla's JSON API for the Model S, 3, X, and Y.

Referrals are back! Need a vehicle to test with? Get a Tesla with free supercharging

Do you work at Tesla? Get in contact! I'd love to help with making this API official.

Tesla JSON API

View Documentation

This is unofficial documentation of the Tesla JSON API used by the iOS and Android apps. The API provides functionality to monitor and control the Model S (and future Tesla vehicles) remotely. The project provides both a documentation of the API and a Ruby library for accessing it.

If any folks at Tesla are reading this, I'd love to help coordinate a developer program for your APIs. If there's any way I can be helpful, please feel free to get in contact. Also, I'd love to be in the beta firmware program ๐Ÿ˜‰

Ruby Gem Gem Version Build Status

This gem provides a basic wrapper around the API to easily query and command the car remotely. It also provides access to the streaming API and a means to process data coming from it.

Installation

Add this line to your application's Gemfile:

gem 'tesla_api'

Or install it yourself:

gem install tesla_api

Usage

Here's a quick example:

require 'tesla_api'

tesla_api = TeslaApi::Client.new(email: email, client_id: client_id, client_secret: client_secret)
tesla_api.login!(password)
# Or if you have an access token:
tesla_api = TeslaApi::Client.new(access_token: access_token)

model_s = tesla_api.vehicles.first # => <TeslaApi::Vehicle>

model_s.wake_up
vehicle_data = model_s.vehicle_data
model_s.auto_conditioning_start unless vehicle_data["climate_state"]["is_auto_conditioning_on"]

model_s.set_charge_limit(90)
model_s.charge_start

charge_state = vehicle_data["charge_state"]
puts "Your Model S is #{charge_state["charging_state"]} " +
     "with a SOC of #{charge_state["battery_level"]}% " +
     "and an estimate range of #{charge_state["est_battery_range"]} miles"

Copyright

Ruby portions are Copyright (c) 2014-Present Tim Dorr. Released under the terms of the MIT license. See LICENSE for details.

More Repositories

1

spotifeed

A simple service to serve up Spotify podcasts as RSS feeds for use in any podcast app.
Ruby
471
star
2

react-log-state

JavaScript
24
star
3

tesla-trip

๐Ÿ“ A tracker for our annual trip up the East Coast in a Tesla Model S.
TypeScript
19
star
4

colony

๐Ÿ A very lightweight, minimalist MVC framework for PHP
PHP
10
star
5

teslalexa

Control your Tesla with Alexa
JavaScript
6
star
6

deskjockey

๐ŸŽง A custom feedback and support widget for Zendesk.
Ruby
5
star
7

-

5
star
8

turntable-api

TypeScript
4
star
9

atljs-webpack

๐Ÿ“ฃ Code from my talk to the Atlanta JavaScript Meetup about Webpack.
JavaScript
3
star
10

house

๐Ÿก Tim builds a house
3
star
11

reparty

๐Ÿ“ˆ A business analytics reporting party!
Ruby
3
star
12

techsta.rs

JavaScript
2
star
13

confsched

๐Ÿ“† A conference room scheduling app backed by Freshbooks. Built for Ignition Alley, an Atlanta coworking facility.
PHP
2
star
14

hubugz

๐Ÿ› A frontend for GitHub Issues, allowing for public access to private repos.
PHP
2
star
15

react-restate

JavaScript
2
star
16

atlco.work

TypeScript
2
star
17

dna

๐Ÿ”ฌ My genetic information
2
star
18

atlpeeps

๐Ÿค˜ Atlanta's entrepreneurial, technical, and creative community
Ruby
2
star
19

alexa

JavaScript
2
star
20

tesla-time

โŒš It's Time for Tesla! A Pebble watch app for the Model S and Model X
JavaScript
2
star
21

timbot

TypeScript
1
star
22

techstars-airtable-tools

TypeScript
1
star
23

timdorr.github.io

๐Ÿ’ฉ Testing stuff
HTML
1
star
24

rere

1
star
25

timdorr

1
star
26

lab-starter

1
star
27

dotfiles

:neckbeard: My files containing dots.
1
star