Skip to content

Latest commit

 

History

History
2371 lines (1801 loc) · 78.6 KB

DOCS.md

File metadata and controls

2371 lines (1801 loc) · 78.6 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

vinDecode(vehicle)object

Return an object containing properties decoded from the vehicle VIN

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(credentials, callback)object

Login to the server and receive OAuth tokens

loginAsync(credentials)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

vehicleById(options, callback)Vehicle

Return vehicle information on the requested vehicle. Uses options.vehicleID to determine which vehicle to fetch data for.

vehicleByIdAsync(options)Promise

Return vehicle information on the requested vehicle. Uses options.vehicleID to determine which vehicle to fetch data for.

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

maxDefrost(options, onoff)object

Max Defrost

maxDefrostAsync(options, onoff)Promise

Remote steering heater

windowControl(options, command, lat, lon)object

Window control

windowControlAsync(options, command, lat, lon)Promise

Window control

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
setChargingAmps(options, amps, callback)object

Set the charging amps.

setChargingAmpsAsync(options, amps)Promise

Set the charging amps async and return Promise.

setScheduledCharging(options, enable, time, callback)object

Set the scheduled charging time.

setScheduledCharging(options, enable, time)Promise

Set the scheduled charging time async and return Promise.

setScheduledDeparture(options, enable, departure_time, preconditioning_enabled, preconditioning_weekdays_only, off_peak_charging_enabled, off_peak_charging_weekdays_only, end_off_peak_time, callback)object

Set the scheduled departure.

setScheduledDeparture(options, enable, departure_time, preconditioning_enabled, preconditioning_weekdays_only, off_peak_charging_enabled, off_peak_charging_weekdays_only, end_off_peak_time)Promise

Set the scheduled departure async and return 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, callback)object

Remote start the car

remoteStartAsync(options)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
products(options, callback)Array.<products>

Return list of products

productsAsync(options, callback)Promise

Return list of products

solarStatus(options, callback)solarStatus

Return live status from solar installation

solarStatusAsync(options, callback)Promise

Return solar status information

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: wss://streaming.vn.teslamotors.com/streaming/

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

vinDecode(vehicle) ⇒ object

Return an object containing properties decoded from the vehicle VIN

Kind: global function
Returns: object - vehicle properties

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(credentials, callback) ⇒ object

Login to the server and receive OAuth tokens

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

Param Type Description
credentials Object object of Tesla credentials
credentials.username string email address used on Tesla.com
credentials.password string password used on Tesla.command
credentials.mfaPassCode string MFA password
credentials.mfaDeviceName string MFA device name
callback nodeBack Node-style callback

loginAsync(credentials) ⇒ Promise

Login to the server and receive OAuth tokens

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

Param Type Description
credentials Object object of Tesla credentials
credentials.username string email address used on Tesla.com
credentials.password string password used on Tesla.command
credentials.mfaPassCode string MFA password
credentials.mfaDeviceName string MFA device name

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

vehicleById(options, callback) ⇒ Vehicle

Return vehicle information on the requested vehicle. Uses options.vehicleID to determine which vehicle to fetch data for.

Kind: global function
Returns: Vehicle - vehicle JSON data

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

vehicleByIdAsync(options) ⇒ Promise

Return vehicle information on the requested vehicle. Uses options.vehicleID to determine which vehicle to fetch data for.

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)

maxDefrost(options, onoff) ⇒ object

Max Defrost

Kind: global function
Returns: object - result

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

maxDefrostAsync(options, onoff) ⇒ Promise

Remote steering heater

Kind: global function
Returns: Promise - result

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

windowControl(options, command, lat, lon) ⇒ object

Window control

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
command string Allowable values are 'vent' and 'close'
lat number User latitude (can be 0 if not 'close' command)
lon number User longitude (can be 0 if not 'close' command)

windowControlAsync(options, command, lat, lon) ⇒ Promise

Window control

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
command string Allowable values are 'vent' and 'close'
lat number User latitude (can be 0 if not 'close' command)
lon number User longitude (can be 0 if not 'close' command)

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

setChargingAmps(options, amps, callback) ⇒ object

Set the charging amps.

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
amps int charging amps
callback nodeBack Node-style callback

setChargingAmpsAsync(options, amps) ⇒ Promise

Set the charging amps async and return Promise.

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
amps int charging amps

setScheduledCharging(options, enable, time, callback) ⇒ object

Set the scheduled charging time.

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
enable boolean true for on, false for off
time int time in minutes since midnight, 15min step
callback nodeBack Node-style callback

setScheduledCharging(options, enable, time) ⇒ Promise

Set the scheduled charging time async and return Promise.

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
enable boolean true for on, false for off
time int time in minutes since midnight, 15min step

setScheduledDeparture(options, enable, departure_time, preconditioning_enabled, preconditioning_weekdays_only, off_peak_charging_enabled, off_peak_charging_weekdays_only, end_off_peak_time, callback) ⇒ object

Set the scheduled departure.

Kind: global function
Returns: object - result

Param Type Description
options optionsType options object
enable boolean true if (preconditioning_enabled
departure_time int time in minutes since midnight, 15min step
preconditioning_enabled boolean true for on, false for off
preconditioning_weekdays_only boolean true for on, false for off
off_peak_charging_enabled boolean true for on, false for off
off_peak_charging_weekdays_only boolean true for on, false for off
end_off_peak_time int time in minutes since midnight, 15min step
callback nodeBack Node-style callback

setScheduledDeparture(options, enable, departure_time, preconditioning_enabled, preconditioning_weekdays_only, off_peak_charging_enabled, off_peak_charging_weekdays_only, end_off_peak_time) ⇒ Promise

Set the scheduled departure async and return Promise.

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object
enable boolean true if (preconditioning_enabled
departure_time int time in minutes since midnight, 15min step
preconditioning_enabled boolean true for on, false for off
preconditioning_weekdays_only boolean true for on, false for off
off_peak_charging_enabled boolean true for on, false for off
off_peak_charging_weekdays_only boolean true for on, false for off
end_off_peak_time int time in minutes since midnight, 15min step

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, callback) ⇒ object

Remote start the car

Kind: global function
Returns: object - result

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

remoteStartAsync(options) ⇒ Promise

Kind: global function
Returns: Promise - result

Param Type Description
options optionsType options object

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

products(options, callback) ⇒ Array.<products>

Return list of products

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

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

productsAsync(options, callback) ⇒ Promise

Return list of products

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

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

solarStatus(options, callback) ⇒ solarStatus

Return live status from solar installation

Kind: global function
Returns: solarStatus - solarStatus JSON data

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

solarStatusAsync(options, callback) ⇒ Promise

Return solar status information

Kind: global function
Returns: Promise - solar JSON data

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

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