All Projects → gutenye → tesla-api

gutenye / tesla-api

Licence: MIT license
Unofficial API Wrapper for Tesla Model S and X. #follows-javascript-conventions #es6 #es7

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to tesla-api

tesla auth
Securely generate API tokens for third-party access to your Tesla.
Stars: ✭ 114 (+375%)
Mutual labels:  tesla, tesla-api
TeslaPy
A Python module to use the Tesla Motors Owner API
Stars: ✭ 216 (+800%)
Mutual labels:  tesla, tesla-api
Tesla-API
A iOS, macOS, watchOS and tvOS framework written in Swift to communicate with Teslas vehicle API
Stars: ✭ 32 (+33.33%)
Mutual labels:  tesla, tesla-api
TeslaKit
Elegant Tesla API in Swift
Stars: ✭ 47 (+95.83%)
Mutual labels:  tesla, tesla-api
teslaapi.io
Unofficial Tesla API Documentation
Stars: ✭ 29 (+20.83%)
Mutual labels:  tesla, tesla-api
tesla.dart
Tesla Client Library for Dart
Stars: ✭ 28 (+16.67%)
Mutual labels:  tesla, tesla-api
teslausb
Steps and scripts for turning a Raspberry Pi into a useful USB drive for a Tesla
Stars: ✭ 1,426 (+5841.67%)
Mutual labels:  tesla
node-tesla-data
App which pulls and stores Tesla data in a MySQL database
Stars: ✭ 28 (+16.67%)
Mutual labels:  tesla
testube
fullscreen entertainment options for your tesla
Stars: ✭ 23 (-4.17%)
Mutual labels:  tesla
tesla-usb-drive
Tesla DashCam & Music USB drive maker tool
Stars: ✭ 17 (-29.17%)
Mutual labels:  tesla
Animated-Tesla-Car-App-using-Flutter
No description or website provided.
Stars: ✭ 141 (+487.5%)
Mutual labels:  tesla
alexa-tesla
Alexa Skills Kit (ASK) project - Tesla monitoring and control for Amazon Echo devices
Stars: ✭ 23 (-4.17%)
Mutual labels:  tesla
ha-config-ataraxis
My Home Assistant Configs. If you like what you see, please ⭐️my repo. It would encourage me a lot 🤘
Stars: ✭ 146 (+508.33%)
Mutual labels:  tesla
openpilot
FOR PRE-AP/AP1/AP2 TESLA CARS ONLY: open source driving agent. You can help development by donating @ https://github.com/sponsors/BogGyver
Stars: ✭ 30 (+25%)
Mutual labels:  tesla
tesla powerwall
Python API for Tesla Powerwall
Stars: ✭ 43 (+79.17%)
Mutual labels:  tesla
tesla
Tesla custom integration for Home Assistant. This requires a refresh token be generated by third-party apps to login.
Stars: ✭ 145 (+504.17%)
Mutual labels:  tesla
teslamateapi
TeslaMateApi is a RESTful API to get data collected by self-hosted data logger TeslaMate in JSON
Stars: ✭ 47 (+95.83%)
Mutual labels:  tesla
TeslaMateAgile
Integration to automatically fill in prices for charge data captured by TeslaMate for smart energy providers
Stars: ✭ 40 (+66.67%)
Mutual labels:  tesla
tesla api
Lightweight Python API client for the Tesla API.
Stars: ✭ 73 (+204.17%)
Mutual labels:  tesla
hashcat-benchmark-comparison
Hashcat Benchmark Comparison
Stars: ✭ 22 (-8.33%)
Mutual labels:  tesla

tesla-api, Unofficial API Wrapper for Tesla Model S and X

Homepage | API Documentation | Issue Tracker | MIT License | by Guten | Gratipay | Bountysource

Install
Node yarn add tesla-api

Philosophy

API wrappers should reflect the idioms of the language in which they were written. tesla-api wraps the Tesla API in a flat API client that follows Javascript conventions and requires little knowledge of REST.

Getting started

With ES2015 and Async Functions

import Tesla from "tesla-api"

async function main() {
  try {
    const vehicles = await Tesla.login({email: x, password: y})
    const vehicle = vehicles[0]
    const chargeState = await vehicle.chargeState()
    console.log(chargeState)              //-> { chargeState: 'Completed', ... }
  } catch (err) {
    if (err.status) {                     // 4xx, 5xx response error
      console.log(`<${err.status} ${err.message}>`, err.response.body)
    } else {                              // Network failures, timeouts, and other errors
      console.error(err.stack)
    }
  }
}
main()

Streaming driving state

vehicle.stream().subscribe(
  data => console.log(data.speed),
  err => console.error(err),
  () => console.log("complete")
)

stream returns a Observable.

Follows Javascript Conventions

Convert response key from underscore to camelCase

{
  response: {
    display_name: "Hello",
    remote_start_enabled: true
  }
}

->

{
  response: {
    displayName: "Hello",
    remoteStartEnabled: true
  }
}

Automatical re-Authentication

When credientals are expires, automatically authenticate it again.

Units Support

Tesla.login({distanceUnit: "km"})

odometer, batteryRange, etc returns in kilometer unit instead of mile

API Reference

Read the source for now :), also see API Documentation for a reference.

Projects using this library

Feel free to send a PR to include your projects.

  • tesla-slack Integrates your Tesla Model S/X fleet to Slack.

Development

Contributing

  • Submit any bugs/features/ideas to GitHub issue tracker.
  • Thanks to all contributors.

Resource

Copyright

The MIT License

Copyright (c) 2015 Guten Ye

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].