Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
3 contributors

Users who have contributed to this file

@mseminatore @DoctorMcKay @thomasmb
2073 lines (1570 sloc) 66.3 KB

Members

streamingPortal
portal
API_LOG_ALWAYS
API_ERR_LEVEL
API_CALL_LEVEL
API_RETURN_LEVEL
API_BODY_LEVEL
API_REQUEST_LEVEL
API_RESPONSE_LEVEL
API_LOG_ALL
CHARGE_STORAGE
CHARGE_DAILY
CHARGE_STANDARD
CHARGE_RANGE
SUNROOF_VENT
SUNROOF_CLOSED
MIN_TEMP
MAX_TEMP
FRUNK
TRUNK
streamingColumns

Functions

setLogLevel(level)

Set the current logging level

getLogLevel()int

Get the current logging level

setPortalBaseURI(uri)

Set the portal base URI

getPortalBaseURI()string

Get the portal base URI

setStreamingBaseURI(uri)

Set the streaming base URI

getStreamingBaseURI()string

Get the streaming base URI

getModel(vehicle)string

Return the car model from vehicle JSON information

getPaintColor(vehicle)string

Return the paint color from vehicle JSON information

getVin(vehicle)string

Return the vehicle VIN from vehicle JSON information

getShortVin(vehicle)string

Return the vehicle VIN from vehicle JSON information

login(username, password, callback)object

Login to the server and receive OAuth tokens

loginAsync(username, password)Promise

Login to the server and receive OAuth tokens

refreshToken(refresh_token, callback)object

Retrieve new OAuth and refresh tokens using a refresh_token

refreshTokenAsync(refresh_token)Promise

Async call to retrieve new OAuth and refresh tokens using a refresh_token

logout(authToken, callback)

Logout and invalidate the current auth token

logoutAsync(authToken)Promise

Logout and invalidate the current auth token

vehicle(options, callback)Vehicle

Return vehicle information on the requested vehicle

vehicleAsync(options)Promise

Return vehicle information on the requested vehicle

vehicles(options, callback)Array.<Vehicles>

Return vehicle information on ALL vehicles

vehiclesAsync(options, callback)Promise

Return vehicle information on ALL vehicles

get_command(options, command, callback)

Generic REST call for GET commands

get_commandAsync(options, command)Promise

Generic Async REST call for GET commands

post_command(options, command, body, callback)

Generic REST call for POST commands

post_commandAsync(options, command, body)Promise

Generic Async REST call for POST commands

vehicleData(options, callback)object

GET all vehicle data in a single call

vehicleDataAsync(options)Promise

Async version to GET all vehicle data in a single call

vehicleConfig(options, callback)object

GET the vehicle config

vehicleConfigAsync(options)Promise

Async version to GET the vehicle config

vehicleState(options, callback)object

GET the vehicle state

vehicleStateAsync(options)Promise

Async version to GET the vehicle state

climateState(options, callback)object

GET the climate state

climateStateAsync(options)Promise

GET the climate state

nearbyChargers(options, callback)object

GET nearby charging sites

nearbyChargersAsync(options)Promise
driveState(options, callback)object

GET the drive state

driveStateAsync(options)Promise
chargeState(options, callback)object

GET the charge state

chargeStateAsync(options)Promise
guiSettings(options, callback)object

GET the GUI settings

guiSettingsAsync(options)Promise
mobileEnabled(options, callback)object

GET the mobile enabled status

mobileEnabledAsync(options)Promise
honkHorn(options, callback)object

Honk the horn

honkHornAsync(options)Promise
flashLights(options, callback)object

Flash the lights

flashLightsAsync(options)Promise
startCharge(options, callback)object

Start charging the car

startChargeAsync(options)Promise

Start charging the car

stopCharge(options, callback)object

Stop charging the car

stopChargeAsync(options)Promise

Stop charging the car

openChargePort(options, callback)object

Open the charge port, or releases the latch if the charge port is open, a cable is plugged in, and charging is stopped

openChargePortAsync(options)Promise

Open the charge port, or releases the latch if the charge port is open, a cable is plugged in, and charging is stopped

closeChargePort(options, callback)object

Close the charge port for appropriately equipped vehicles

closeChargePortAsync(options)Promise

Close the charge port for appropriately equipped vehicles

scheduleSoftwareUpdate(options, offset)object

Schedule a firmware update

scheduleSoftwareUpdateAsync(options, offset)Promise

Schedule a firmware update

cancelSoftwareUpdate(options)object

Cancel a scheduled software update

cancelSoftwareUpdateAsync(options)Promise

Cancel a scheduled software update

navigationRequest(options, subject, text, locale)object

Send a navigation request to the car

navigationRequestAsync(options, subject, text, locale)Promise

Send a navigation request to the car

mediaTogglePlayback(options)object

Toggle media playback

mediaTogglePlaybackAsync(options)Promise

Toggle media playback

mediaPlayNext(options)object

Media play next track

mediaPlayNextAsync(options)Promise

Media play next track

mediaPlayPrevious(options)object

Media play previous track

mediaPlayPreviousAsync(options)Promise

Media play previous track

mediaPlayNextFavorite(options)object

Media play next favorite

mediaPlayNextFavoriteAsync(options)Promise

Media play next favorite

mediaPlayPreviousFavorite(options)object

Media play previous favorite

mediaPlayPreviousFavoriteAsync(options)Promise

Media play previous favorite

mediaVolumeUp(options)object

Media volume up

mediaVolumeUpAsync(options)Promise

Media volume up

mediaVolumeDown(options)object

Media volume down

mediaVolumeDownAsync(options)Promise

Media volume down

speedLimitActivate(options, pin)object

Activate speed limitation

speedLimitActivateAsync(options, pin)Promise

Activate speed limitation

speedLimitDeactivate(options, pin)object

Deactivate speed limitation

speedLimitDeactivateAsync(options, pin)Promise

Deactivate speed limitation

speedLimitClearPin(options, pin)object

Clear speed limitation pin

speedLimitClearPinAsync(options, pin)Promise

Clear speed limitation pin

speedLimitSetLimit(options, limit)object

Set speed limit

speedLimitSetLimitAsync(options, limit)Promise

Set speed limit

setSentryMode(options, onoff)object

Enable or disable sentry mode

setSentryModeAsync(onoff)Promise

Enable or disable sentry mode

seatHeater(options, heater, level)object

Remote seat heater

seatHeaterAsync(options, heater, level)Promise

Remote seat heater

steeringHeater(options, level)object

Remote steering heater

seatHeaterAsync(options, level)Promise

Remote steering heater

setChargeLimit(options, amt, callback)object

Set the charge limit. Note: charging to 100% frequently is NOT recommended for long-term battery health!

setChargeLimitAsync(options, amt)Promise

Set the charge limit async and return Promise. Note: charging to 100% frequently is NOT recommended for long-term battery health!

chargeStandard(options, callback)object

Set the charge limit to (standard) 90%

chargeStandardAsync(options)Promise
chargeMaxRange(options, callback)object

Set charge limit to 100%

chargeMaxRangeAsync(options)Promise
doorLock(options, callback)object

Lock the car doors

doorLockAsync(options)Promise
doorUnlock(options, callback)object

Unlock the car doors

doorUnlockAsync(options)Promise
climateStart(options, callback)object

Turn on HVAC system

climateStartAsync(options)Promise
climateStop(options, callback)object

Turn off HVAC system

climateStopAsync(options)Promise
sunRoofControl(options, state, callback)object

Set sun roof mode

sunRoofControlAsync(options, state)Promise
sunRoofMove(options, percent, callback)object

Set sun roof position

sunRoofMoveAsync(options, percent)Promise
setTemps(options, driver, pass, callback)object

Set the driver/passenger climate temperatures

setTempsAsync(options, driver, pass)Promise
remoteStart(options, password, callback)object

Remote start the car

remoteStartAsync(options, password)Promise
openTrunk(options, which, callback)object

Open the trunk/frunk

openTrunkAsync(options, which)Promise
wakeUp(options, callback)object

Wake up a car that is sleeping

wakeUpAsync(options)Promise
setValetMode(options, onoff, pin, callback)object

Turn valet mode on/off

setValetModeAsync(options, onoff, pin)Promise
resetValetPin(options, callback)object

Reset the valet pin

resetValetPinAsync(options)Promise
calendar(options, entry, callback)object

Set a calendar entry

calendarAsync(options, entry)Promise
makeCalendarEntry(eventName, location, startTime, endTime, accountName, phoneName)object

Create a calendar entry

homelink(options, lat, long, string, callback)object

Trigger homelink

homelinkAsync(options, lat, long, string)Promise
startStreaming(options, callback, onDataCb)object

Start streaming car data

Typedefs

nodeBack : function

Node-style callback function

optionsType : object

TeslaJS options parameter

streamingPortal

Kind: global variable
Default: https://streaming.vn.teslamotors.com/stream

portal

Kind: global variable
Default: https://owner-api.teslamotors.com

API_LOG_ALWAYS

Kind: global variable
Default: 0

API_ERR_LEVEL

Kind: global variable
Default: 1

API_CALL_LEVEL

Kind: global variable
Default: 2

API_RETURN_LEVEL

Kind: global variable
Default: 3

API_BODY_LEVEL

Kind: global variable
Default: 4

API_REQUEST_LEVEL

Kind: global variable
Default: 5

API_RESPONSE_LEVEL

Kind: global variable
Default: 6

API_LOG_ALL

Kind: global variable
Default: 255

CHARGE_STORAGE

Kind: global variable
Default: 50

CHARGE_DAILY

Kind: global variable
Default: 70

CHARGE_STANDARD

Kind: global variable
Default: 90

CHARGE_RANGE

Kind: global variable
Default: 100

SUNROOF_VENT

Kind: global variable
Default: vent

SUNROOF_CLOSED

Kind: global variable
Default: close

MIN_TEMP

Kind: global variable
Default: 15

MAX_TEMP

Kind: global variable
Default: 28

FRUNK

Kind: global variable
Default: front

TRUNK

Kind: global variable
Default: rear

streamingColumns

Kind: global variable
Default: ["elevation","est_heading","est_lat","est_lng","est_range","heading","odometer","power","range","shift_state","speed","soc"]

setLogLevel(level)

Set the current logging level

Kind: global function

Param Type Description
level int logging level

getLogLevel() ⇒ int

Get the current logging level

Kind: global function
Returns: int - the current logging level

setPortalBaseURI(uri)

Set the portal base URI

Kind: global function

Param Type Description
uri string URI for Tesla servers

getPortalBaseURI() ⇒ string

Get the portal base URI

Kind: global function
Returns: string - URI for Tesla servers

setStreamingBaseURI(uri)

Set the streaming base URI

Kind: global function

Param Type Description
uri string URI for Tesla streaming servers

getStreamingBaseURI() ⇒ string

Get the streaming base URI

Kind: global function
Returns: string - URI for Tesla streaming servers

getModel(vehicle) ⇒ string

Return the car model from vehicle JSON information

Kind: global function
Returns: string - vehicle model string

Param Type Description
vehicle object vehicle JSON

getPaintColor(vehicle) ⇒ string

Return the paint color from vehicle JSON information

Kind: global function
Returns: string - the vehicle paint color

Param Type Description
vehicle object vehicle JSON

getVin(vehicle) ⇒ string

Return the vehicle VIN from vehicle JSON information

Kind: global function
Returns: string - the vehicle VIN

Param Type Description
vehicle object vehicle JSON

getShortVin(vehicle) ⇒ string

Return the vehicle VIN from vehicle JSON information

Kind: global function
Returns: string - the short version of the vehicle VIN

Param Type Description
vehicle object vehicle JSON

login(username, password, callback) ⇒ object

Login to the server and receive OAuth tokens

Kind: global function
Returns: object - {response, body, authToken, refreshToken}

Param Type Description
username string Tesla.com username
password string Tesla.com password
callback nodeBack Node-style callback

loginAsync(username, password) ⇒ Promise

Login to the server and receive OAuth tokens

Kind: global function
Returns: Promise - {response, body, authToken, refreshToken}

Param Type Description
username string Tesla.com username
password string Tesla.com password

refreshToken(refresh_token, callback) ⇒ object

Retrieve new OAuth and refresh tokens using a refresh_token

Kind: global function
Returns: object - {response, body, authToken, refreshToken}

Param Type Description
refresh_token string a valid OAuth refresh_token from a previous login
callback nodeBack Node-style callback

refreshTokenAsync(refresh_token) ⇒ Promise

Async call to retrieve new OAuth and refresh tokens using a refresh_token

Kind: global function
Returns: Promise - {response, body, authToken, refreshToken}

Param Type Description
refresh_token string a valid OAuth refresh_token from a previous login

logout(authToken, callback)

Logout and invalidate the current auth token

Kind: global function

Param Type Description
authToken string Tesla provided OAuth token
callback nodeBack Node-style callback

logoutAsync(authToken) ⇒ Promise

Logout and invalidate the current auth token

Kind: global function
Returns: Promise - result

Param Type Description
authToken string Tesla provided OAuth token

vehicle(options, callback) ⇒ Vehicle

Return vehicle information on the requested vehicle

Kind: global function
Returns: Vehicle - vehicle JSON data

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

vehicleAsync(options) ⇒ Promise

Return vehicle information on the requested vehicle

Kind: global function
Returns: Promise - vehicle JSON data

Param Type Description
options optionsType options object

vehicles(options, callback) ⇒ Array.<Vehicles>

Return vehicle information on ALL vehicles

Kind: global function
Returns: Array.<Vehicles> - array of vehicle JSON data

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

vehiclesAsync(options, callback) ⇒ Promise

Return vehicle information on ALL vehicles

Kind: global function
Returns: Promise - array of vehicle JSON data

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

get_command(options, command, callback)

Generic REST call for GET commands

Kind: global function

Param Type Description
options optionsType options object
command string REST command
callback nodeBack Node-style callback

get_commandAsync(options, command) ⇒ Promise

Generic Async REST call for GET commands

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
command string REST command

post_command(options, command, body, callback)

Generic REST call for POST commands

Kind: global function

Param Type Description
options optionsType options object
command string REST command
body object JSON payload
callback nodeBack Node-style callback

post_commandAsync(options, command, body) ⇒ Promise

Generic Async REST call for POST commands

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
command string REST command
body object JSON payload

vehicleData(options, callback) ⇒ object

GET all vehicle data in a single call

Kind: global function
Returns: object - vehicle_data object

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

vehicleDataAsync(options) ⇒ Promise

Async version to GET all vehicle data in a single call

Kind: global function
Returns: Promise - vehicle_data object

Param Type Description
options optionsType options object

vehicleConfig(options, callback) ⇒ object

GET the vehicle config

Kind: global function
Returns: object - vehicle_config object

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

vehicleConfigAsync(options) ⇒ Promise

Async version to GET the vehicle config

Kind: global function
Returns: Promise - vehicle_config object

Param Type Description
options optionsType options object

vehicleState(options, callback) ⇒ object

GET the vehicle state

Kind: global function
Returns: object - vehicle_state object

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

vehicleStateAsync(options) ⇒ Promise

Async version to GET the vehicle state

Kind: global function
Returns: Promise - vehicle_state object

Param Type Description
options optionsType options object

climateState(options, callback) ⇒ object

GET the climate state

Kind: global function
Returns: object - climate_state object

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

climateStateAsync(options) ⇒ Promise

GET the climate state

Kind: global function
Returns: Promise - climate_state object

Param Type Description
options optionsType options object

nearbyChargers(options, callback) ⇒ object

GET nearby charging sites

Kind: global function
Returns: object - climate_state object

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

nearbyChargersAsync(options) ⇒ Promise

Kind: global function
Returns: Promise - climate_state object

Param Type Description
options optionsType options object

driveState(options, callback) ⇒ object

GET the drive state

Kind: global function
Returns: object - drive_state object

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

driveStateAsync(options) ⇒ Promise

Kind: global function
Returns: Promise - drive_state object

Param Type Description
options optionsType options object

chargeState(options, callback) ⇒ object

GET the charge state

Kind: global function
Returns: object - charge_state object

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

chargeStateAsync(options) ⇒ Promise

Kind: global function
Returns: Promise - charge_state object

Param Type Description
options optionsType options object

guiSettings(options, callback) ⇒ object

GET the GUI settings

Kind: global function
Returns: object - gui_settings object

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

guiSettingsAsync(options) ⇒ Promise

Kind: global function
Returns: Promise - gui_settings object

Param Type Description
options optionsType options object

mobileEnabled(options, callback) ⇒ object

GET the mobile enabled status

Kind: global function
Returns: object - mobile_enabled object

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

mobileEnabledAsync(options) ⇒ Promise

Kind: global function
Returns: Promise - mobile_enabled object

Param Type Description
options optionsType options object

honkHorn(options, callback) ⇒ object

Honk the horn

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

honkHornAsync(options) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

flashLights(options, callback) ⇒ object

Flash the lights

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

flashLightsAsync(options) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

startCharge(options, callback) ⇒ object

Start charging the car

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

startChargeAsync(options) ⇒ Promise

Start charging the car

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

stopCharge(options, callback) ⇒ object

Stop charging the car

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

stopChargeAsync(options) ⇒ Promise

Stop charging the car

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

openChargePort(options, callback) ⇒ object

Open the charge port, or releases the latch if the charge port is open, a cable is plugged in, and charging is stopped

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

openChargePortAsync(options) ⇒ Promise

Open the charge port, or releases the latch if the charge port is open, a cable is plugged in, and charging is stopped

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

closeChargePort(options, callback) ⇒ object

Close the charge port for appropriately equipped vehicles

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

closeChargePortAsync(options) ⇒ Promise

Close the charge port for appropriately equipped vehicles

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

scheduleSoftwareUpdate(options, offset) ⇒ object

Schedule a firmware update

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
offset number delay in ms before installation begins

scheduleSoftwareUpdateAsync(options, offset) ⇒ Promise

Schedule a firmware update

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
offset number delay in ms before installation begins

cancelSoftwareUpdate(options) ⇒ object

Cancel a scheduled software update

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object

cancelSoftwareUpdateAsync(options) ⇒ Promise

Cancel a scheduled software update

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

navigationRequest(options, subject, text, locale) ⇒ object

Send a navigation request to the car

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
subject string short-hand name for the destination
text string address details including things like name, address, map link
locale string the language locale, for example "en-US"

navigationRequestAsync(options, subject, text, locale) ⇒ Promise

Send a navigation request to the car

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
subject string short-hand name for the destination
text string address details including things like name, address, map link
locale string the language locale, for example "en-US"

mediaTogglePlayback(options) ⇒ object

Toggle media playback

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object

mediaTogglePlaybackAsync(options) ⇒ Promise

Toggle media playback

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

mediaPlayNext(options) ⇒ object

Media play next track

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object

mediaPlayNextAsync(options) ⇒ Promise

Media play next track

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

mediaPlayPrevious(options) ⇒ object

Media play previous track

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object

mediaPlayPreviousAsync(options) ⇒ Promise

Media play previous track

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

mediaPlayNextFavorite(options) ⇒ object

Media play next favorite

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object

mediaPlayNextFavoriteAsync(options) ⇒ Promise

Media play next favorite

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

mediaPlayPreviousFavorite(options) ⇒ object

Media play previous favorite

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object

mediaPlayPreviousFavoriteAsync(options) ⇒ Promise

Media play previous favorite

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

mediaVolumeUp(options) ⇒ object

Media volume up

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object

mediaVolumeUpAsync(options) ⇒ Promise

Media volume up

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

mediaVolumeDown(options) ⇒ object

Media volume down

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object

mediaVolumeDownAsync(options) ⇒ Promise

Media volume down

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

speedLimitActivate(options, pin) ⇒ object

Activate speed limitation

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
pin number Activation pin code. Not the same as valet pin

speedLimitActivateAsync(options, pin) ⇒ Promise

Activate speed limitation

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
pin number Activation pin code. Not the same as valet pin

speedLimitDeactivate(options, pin) ⇒ object

Deactivate speed limitation

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
pin number Activation pin code. Not the same as valet pin

speedLimitDeactivateAsync(options, pin) ⇒ Promise

Deactivate speed limitation

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
pin number Activation pin code. Not the same as valet pin

speedLimitClearPin(options, pin) ⇒ object

Clear speed limitation pin

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
pin number Activation pin code. Not the same as valet pin

speedLimitClearPinAsync(options, pin) ⇒ Promise

Clear speed limitation pin

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
pin number Activation pin code. Not the same as valet pin

speedLimitSetLimit(options, limit) ⇒ object

Set speed limit

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
limit number Speed limit in mph

speedLimitSetLimitAsync(options, limit) ⇒ Promise

Set speed limit

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
limit number Speed limit in mph

setSentryMode(options, onoff) ⇒ object

Enable or disable sentry mode

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
onoff boolean true to turn on sentry mode, false to turn off

setSentryModeAsync(onoff) ⇒ Promise

Enable or disable sentry mode

Kind: global function
Returns: Promise - result

Param Type Description
onoff boolean true to turn on sentry mode, false to turn off

seatHeater(options, heater, level) ⇒ object

Remote seat heater

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
heater number Which heater to adjust (0-5)
level number Level for the heater (0-3)

seatHeaterAsync(options, heater, level) ⇒ Promise

Remote seat heater

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
heater number Which heater to adjust (0-5)
level number Level for the heater (0-3)

steeringHeater(options, level) ⇒ object

Remote steering heater

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
level number Level for the heater (0-3)

seatHeaterAsync(options, level) ⇒ Promise

Remote steering heater

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
level number Level for the heater (0-3)

setChargeLimit(options, amt, callback) ⇒ object

Set the charge limit. Note: charging to 100% frequently is NOT recommended for long-term battery health!

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
amt int charge limit in percent
callback nodeBack Node-style callback

setChargeLimitAsync(options, amt) ⇒ Promise

Set the charge limit async and return Promise. Note: charging to 100% frequently is NOT recommended for long-term battery health!

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
amt int charge limit in percent

chargeStandard(options, callback) ⇒ object

Set the charge limit to (standard) 90%

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

chargeStandardAsync(options) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

chargeMaxRange(options, callback) ⇒ object

Set charge limit to 100%

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

chargeMaxRangeAsync(options) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

doorLock(options, callback) ⇒ object

Lock the car doors

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

doorLockAsync(options) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

doorUnlock(options, callback) ⇒ object

Unlock the car doors

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

doorUnlockAsync(options) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

climateStart(options, callback) ⇒ object

Turn on HVAC system

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

climateStartAsync(options) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

climateStop(options, callback) ⇒ object

Turn off HVAC system

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

climateStopAsync(options) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

sunRoofControl(options, state, callback) ⇒ object

Set sun roof mode

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
state string one of "vent", "close"
callback nodeBack Node-style callback

sunRoofControlAsync(options, state) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
state string one of "vent", "close"

sunRoofMove(options, percent, callback) ⇒ object

Set sun roof position

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
percent int position in percent
callback nodeBack Node-style callback

sunRoofMoveAsync(options, percent) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
percent int position in percent

setTemps(options, driver, pass, callback) ⇒ object

Set the driver/passenger climate temperatures

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
driver number driver temp in Deg.C
pass number passenger temp in Deg.C
callback nodeBack Node-style callback

setTempsAsync(options, driver, pass) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
driver number driver temp in Deg.C
pass number passenger temp in Deg.C

remoteStart(options, password, callback) ⇒ object

Remote start the car

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
password string Tesla.com password
callback nodeBack Node-style callback

remoteStartAsync(options, password) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
password string Tesla.com password

openTrunk(options, which, callback) ⇒ object

Open the trunk/frunk

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
which string FRUNK or TRUNK constant
callback nodeBack Node-style callback

openTrunkAsync(options, which) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
which string one of "trunk", "frunk"

wakeUp(options, callback) ⇒ object

Wake up a car that is sleeping

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

wakeUpAsync(options) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

setValetMode(options, onoff, pin, callback) ⇒ object

Turn valet mode on/off

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
onoff boolean true for on, false for off
pin int pin code
callback nodeBack Node-style callback

setValetModeAsync(options, onoff, pin) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
onoff boolean true for on, false for off
pin int pin code

resetValetPin(options, callback) ⇒ object

Reset the valet pin

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
callback nodeBack Node-style callback

resetValetPinAsync(options) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

calendar(options, entry, callback) ⇒ object

Set a calendar entry

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
entry object calendar entry object
callback nodeBack Node-style callback

calendarAsync(options, entry) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
entry object calendar entry object

makeCalendarEntry(eventName, location, startTime, endTime, accountName, phoneName) ⇒ object

Create a calendar entry

Kind: global function
Returns: object - result

Param Type Description
eventName string name of the event
location string location of the event
startTime number Javascript timestamp for start of event
endTime number Javascript timestamp for end of event
accountName string name of the calendar account
phoneName string phone bluetooth name

homelink(options, lat, long, string, callback) ⇒ object

Trigger homelink

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
lat number vehicle GPS latitude
long number vehicle GPS longitude
string string one of the tokens from vehicle JSON
callback nodeBack Node-style callback

homelinkAsync(options, lat, long, string) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
lat number vehicle GPS latitude
long number vehicle GPS longitude
string string one of the tokens from vehicle JSON

startStreaming(options, callback, onDataCb) ⇒ object

Start streaming car data

Kind: global function
Returns: object - result

Param Type Description
options object {username, token, vehicle_id, columns[]}
callback nodeBack Node-style callback
onDataCb nodeBack Node-style callback

nodeBack : function

Node-style callback function

Kind: global typedef

Param Type Description
error function function which receives the error result
data function function which receives the data result

optionsType : object

TeslaJS options parameter

Kind: global typedef
Properties

Name Type Description
authToken string Tesla provided OAuth token
vehicleID string Tesla provided long vehicle id
[carIndex] int index of vehicle within vehicles JSON
You can’t perform that action at this time.