Skip to content

Tesla Binding ​

This binding integrates Tesla Electrical Vehicles. The integration happens through the Tesla FleetAPI.

Supported Things ​

All current Tesla models are supported by this binding. Access is established through a Tesla account as a bridge.

Thing TypeDescription
accountThe account provides access to the vehicles.
modelsA Tesla Model S
model3A Tesla Model 3
modelxA Tesla Model X
modelyA Tesla Model Y

Tesla

Auto Discovery ​

The account cannot be automatically discovered, but has to be created manually.

Once an account is configured, it is queried for associated vehicles and an Inbox entry is created for each of them.

Note: Vehicles that are asleep are discovered and put into the Inbox, but their model cannot be determined. As an effect, their channels are missing until the vehicle wakes up and can be fully queried. A vehicle can be manually woken up by opening the Tesla app and checking the vehicle status in there.

Bridge Configuration ​

The account bridge requires an OAuth2 refresh token as the only parameter refreshToken.

There are a few 3rd party tools available that have specialized on getting hold of refresh tokens for the Tesla API. Please note that we in general consider it dangerous to enter your credentials into some 3rd party app - you will have to trust the author not to send or store those credentials anywhere.

When using one of such apps, simply copy and paste the received refresh token into the account configuration.

Thing Configuration Parameters ​

The vehicle Thing requires the vehicle's VIN as a configuration parameter vin.

Additionally, the follow optional parameters may be defined.

Parameter NameLabelDefault ValueDescription
valetpinValet PINfalsePIN to use when enabling Valet Mode
allowWakeupForCommandsAllow Wake-Up For CommandsfalseWake up the vehicle to send commands. May cause vehicle to stay awake

For further flexibility and experimentation, the following advanced parameters may also be set.

Parameter NameLabelDefault ValueDescription
allowWakeupAllow Wake-UpfalseAllows waking up the vehicle to retrieve data. See caution below
enableEventsEnable EventsfalseEnable the event stream for the vehicle. See note below
inactivityInactivity Interval5The inactivity period in minutes after which the binding stops for 20 minutes to let the car sleep
useDriveStateUse Drive State for InactivityfalseUse the drive state instead of location to determine vehicle inactivity
useAdvancedStatesForPollingUse Console Modes and Occupancy for InactivityfalseUse these states to help continue the fast polling of the API

allowWakeup should be used with caution as this determines whether openHAB is allowed to wake up the vehicle in order to retrieve data from it. This setting is not recommended as it will result in a significant vampire drain (i.e. energy consumption although the vehicle is parking).

enableEvents captures and processes data in near real-time for key variables by enabling events streamed by the Tesla back-end system.

inactivity setting is ignored and will always be five minutes if homelink is available (car is at home)

Channels ​

All vehicles support a huge number of channels - the following list shows the standard ones:

Channel IDItem TypeLabelDescription
autoconditioningSwitchAuto ConditioningTurns on auto-conditioning (a/c or heating)
batterylevelNumberBattery LevelState of the battery in %
chargingstateStringCharging State“Starting”, “Complete”, “Charging”, “Disconnected”, “Stopped”, “NoPower”
chargeportSwitchCharge PortOpen the Charge Port (ON) or indicates the state of the Charge Port (ON/OFF if Open/Closed)
climateSwitchClimateClimate status indicator
doorlockSwitchDoor LockLock or unlock the car
insidetempNumber:TemperatureInside TemperatureIndicates the inside temperature of the vehicle
locationLocationLocationThe actual position of the vehicle
odometerNumber:LengthOdometerOdometer of the vehicle
speedNumber:SpeedSpeedVehicle speed

Additionally, these advanced channels are available (not all are available on all vehicle types, e.g., the sunroof):

Channel IDItem TypeLabelDescription
destinationnameStringRoute destinationName of the destination
destinationlocationLocationRoute locationLocation of the destination
distancetoarrivalNumber:LengthDistance to arrivalDistance to drive to the destination (in miles)
minutestoarrivalNumber:TimeMinutes to arrivalMinutes to drive to the destination
trafficminutesdelayNumber:TimeTraffic delayMinutes of delay due to traffic
autoparkstateStringAutopark StateUndocumented / To be defined
autoparkstyleStringAutopark StyleUndocumented / To be defined
batterycurrentNumber:ElectricCurrentBattery CurrentCurrent (Ampere) floating into (+) or out (-) of the battery
batteryheaterSwitchBattery HeaterIndicates if the battery heater is switched on
batteryheaternopowerSwitchBattery Heater PowerIndicates if there is enough power to use the battery heater
batteryrangeNumber:LengthBattery RangeRange of the battery
calendarenabledSwitchCalendar EnabledIndicates if access to a remote calendar is enabled
centerdisplayNumberCentral Display StateIndicates the state of the central display, see the Unofficial Tesla API documentation
centerrearseatheaterSwitchCenter Rear Seat HeaterIndicates if the center rear seat heater is switched on
chargeSwitchChargeStart (ON) or stop (OFF) charging
chargecableStringCharge CableUndocumented / To be defined
chargecurrentNumber:ElectricCurrentCharge CurrentCurrent (Ampere) requested from the charger
chargeenablerequestSwitchCharge Enable RequestUndocumented / To be defined
chargeenergyaddedNumber:EnergyCharge Energy AddedEnergy added, in kWh, during the last charging session
chargelimitDimmerCharge LimitLimit charging of the vehicle to the given %
chargelimitmaximumDimmerCharge Limit MaximumMaximum charging limit of the vehicle, as %
chargelimitminimumDimmerCharge Limit MinimumMinimum charging limit of the vehicle, as %
chargelimitsocstandardDimmerCharge Limit SOC StandardStandard charging limit of the vehicle, in %
chargeidealdistanceaddedNumber:LengthIdeal Charge Distance AddedIdeal range added during the last charging session
chargemaxcurrentNumber:ElectricCurrentCharge Max CurrentMaximum current (Ampere) that can be requested from the charger
chargerateddistanceaddedNumber:LengthRated Charge Distance AddedRated range added during the last charging session
chargerateNumber:SpeedCharge RateDistance per hour charging rate
chargestartingrangeStringCharge Starting RangeUndocumented / To be defined
chargestartingsocStringCharge Starting SOCUndocumented / To be defined
chargetomaxSwitchCharge To Max RangeIndicates if charging to the maximum range is enabled
chargercurrentNumber:ElectricCurrentCharge CurrentCurrent (Ampere) actually being drawn from the charger
chargerphasesNumberCharger PhasesIndicates the number of phases (1 to 3) used for charging
chargermaxcurrentNumber:ElectricCurrentCharger Maximum CurrentMaximum current (Ampere) that can be delivered by the charger
chargerpowerNumberCharger PowerPower actually delivered by the charger
chargervoltageNumber:ElectricPotentialCharger VoltageVoltage (V) actually presented by the charger
chargingampsNumber:ElectricCurrentSet Charging AmpsCurrent (Ampere) to use for charging
driverfrontdoorContactDriver Front DoorIndicates if the front door at the driver's side is open
driverfrontwindowContactDriver Front WindowIndicates if the front window at the driver's side is open
driverreardoorContactDriver Rear DoorIndicates if the rear door at the driver's side is open
driverrearwindowContactDriver Rear WindowIndicates if the rear window at the driver's side is open
drivertempNumber:TemperatureDriver TemperatureIndicates the auto conditioning temperature set at the driver's side
eventstampDateTimeEvent TimestampTimestamp of the last event received from the Tesla streaming service
estimatedbatteryrangeNumber:LengthEstimated Battery RangeEstimated battery range
estimatedrangeNumberEstimated RangeEstimated range of the vehicle
fanNumberFanIndicates the speed (0-7) of the fan
flashlightsSwitchFlash LightsFlash the lights of the car (when ON is received)
frontdefrosterSwitchFront DefrosterIndicates if the front defroster is enabled
fronttrunkSwitchFront TrunkIndicates if the front trunk is opened, or open the front trunk when ON is received
gpstimestampDateTimeGPS Time StampTime stamp of the most recent GPS location of the vehicle
headingNumberHeadingIndicates the (compass) heading of the car, in 0-360 degrees
headingestimationNumberEstimated HeadingEstimated (compass) heading of the car, in 0 to 360 degrees
honkhornSwitchHonk the HornHonk the horn of the vehicle, when ON is received
homelinkSwitchHomelink NearbyIndicates if the Home Link is nearby
idealbatteryrangeNumber:LengthIdeal Battery RangeIndicates the Battery Range
lefttempdirectionNumberLeft Temperature DirectionNot documented / To be defined
lastautoparkerrorStringLast Autopark ErrorNot documented / To be defined
locationLocationLocationThe actual position of the vehicle
leftseatheaterSwitchLeft Seat HeaterIndicates if the left seat heater is switched on
leftrearseatheaterSwitchLeft Rear Seat HeaterIndicates if the left rear seat heater is switched on
leftrearbackseatheaterNumberLeft Rear Backseat HeaterIndicates the level (0, 1, 2, or 3) of the left rear backseat heater
managedchargingSwitchManaged ChargingIndicates if managed charging is active
managedchargingcancelledSwitchManaged Charging CancelledIndicates if managed charging is cancelled by the user
managedchargingstartStringManaged Charging Start TimeNot documented / To be defined
maxchargesNumberMax ChargesIndicates the number of consecutive "Max Range Charges" performed by the vehicle
minavailabletempNumber:TemperatureMinimum TemperatureIndicates the minimal inside temperature of the vehicle
maxavailabletempNumber:TemperatureMaximum TemperatureIndicates the maximum inside temperature of the vehicle
minutestofullchargeNumber:TimeMinutes To Full ChargeNumber of minutes to fully charge the battery
mobileenabledSwitchMobile EnabledIndicates whether the vehicle can be remotely controlled
notenoughpowerSwitchNot Enough PowerIndicates if not enough power (ON) is available to heat the vehicle
notificationsenabledSwitchNotifications EnabledNot documented / To be defined
notificationssupportedSwitchNotifications SupportedNot documented / To be defined
outsidetempNumber:TemperatureOutside TemperatureIndicates the outside temperature of the vehicle
parsedcalendarSwitchParsed Calendar SupportedNot documented / To be defined
passengertempNumberPassenger TemperatureIndicates the auto conditioning temperature set at the passenger's side
passengerfrontdoorContactPassenger Front DoorIndicates if the front door at the passenger's side is opened
passengerfrontwindowContactPassenger Front WindowIndicates if the front window at the passenger's side is open
passengerreardoorContactPassenger Rear DoorIndicates if the rear door at the passenger's side is opened
passengerrearwindowContactPassenger Rear WindowIndicates if the rear window at the passenger's side is open
powerNumberPowerNet kW flowing in (+) or out (-) of the battery
preconditioningSwitchPreconditioningIndicates if preconditioning is activated
rangeNumberRangeVehicle range - Not documented / To be defined
reardefrosterSwitchRear DefrosterIndicates if the rear defroster is enabled
remotestartenabledSwitchRemote StartNot documented / To be defined
reartrunkSwitchRear TrunkIndicates if the rear trunk is opened, or open/close the rear trunk when ON/OFF is received
remotestartSwitchRemote StartNot documented / To be defined
remotestartsupportedSwitchRemote Start SupportedNot documented / To be defined
rightseatheaterSwitchRight Seat HeaterIndicates if the right seat heater is switched on
rightrearseatheaterSwitchRight Rear Seat HeaterIndicates if the right rear seat heater is switched on
rightrearbackseatheaterNumberRight Rear Backseat HeaterIndicates the level (0, 1, 2, or 3) of the right rear backseat heater
righttempdirectionNumberRight Temperature DirectionNot documented / To be defined
scheduledchargingpendingSwitchScheduled Charging PendingIndicates if a scheduled charging session is still pending
scheduledchargingstartDateTimeScheduled Charging StartIndicates when the scheduled charging session will start, in yyyy-MM-dd'T'HH:mm:ss format
sentrymodeSwitchSentry ModeActivates or deactivates sentry mode
sentrymodeavailableSwitchSentry Mode AvailableIndicates whether sentry mode is currently available
shareStringShareSend an address to the vehicle's navigation system. Accepts: plain text addresses (e.g., "Eiffel Tower, Paris" or "Main St 1, 12345 Berlin"), Google Maps links, or coordinates (latitude,longitude)
shiftstateStringShift StateIndicates the state of the transmission, “P”, “D”, “R”, or “N”
sidemirrorheatersSwitchSide Mirror HeatersIndicates if the side mirror heaters are switched on
smartpreconditioningSwitchSmart PreconditioningIndicates if smart preconditioning is switched on
softwareupdateavailableSwitchUpdate AvailableCar software or map update available, automatically generated on non-empty "update version"
softwareupdatestatusStringUpdate StatusCar software or map update status, e.g. "downloading_wifi_wait", "installing"
softwareupdateversionStringUpdate VersionCar software or map version to update to, e.g. "2023.32.9", "EU-2023.32-14783" for map updates, or empty
socNumberState of ChargeState of Charge, in %
stateStringState“online”, “asleep”, “waking”
steeringwheelheaterSwitchSteering Wheel HeaterTurns On/Off the steering wheel heater
sunroofstateStringSunroof StateValid states are “unknown”, “open”, “closed”, “vent”, “comfort”. Accepts commands "close" and "vent".
sunroofDimmerSunroofIndicates the opening state of the sunroof (0% closed, 100% fully open)
temperatureNumber:TemperatureTemperatureSet the temperature of the autoconditioning system. The temperature for the driver and passenger will be synced.
timetofullchargeNumberTime To Full ChargeNumber of hours to fully charge the battery
tirepressurefrontleftNumber:PressureTire Pressure Front LeftPressure of the front left tire
tirepressurefrontrightNumber:PressureTire Pressure Front RightPressure of the front right tire
tirepressurerearleftNumber:PressureTire Pressure Rear LeftPressure of the rear left tire
tirepressurerearrightNumber:PressureTire Pressure Rear RightPressure of the rear right tire
tirepressurewarningSwitchTire Pressure WarningIndicates if the vehicle reports a pressure warning for any tire
tripchargingSwitchTrip ChargingNot documented / To be defined
usablebatterylevelNumberUsable Battery LevelIndicates the % of battery that can be used for vehicle functions like driving
userchargeenablerequestStringUser Charge Enable RequestNot documented / To be defined
userpresentSwitchUser PresentIndicates if a person is present in the vehicle
valetmodeSwitchValet ModeEnable or disable Valet Mode
valetpinSwitchValet PIN RequiredIndicates if a PIN code is required to disable valet mode
wakeupSwitchWake UpWake up the vehicle from a (deep) sleep
wiperbladeheaterSwitchWiperblade HeaterIndicates if the wiperblade heater is switched on

Example ​

demo.Things:

dsl
Bridge tesla:account:myaccount "My Tesla Account" [ refreshToken="xxxx" ] {
    model3 mycar "My favorite car" [ vin="5YJSA7H25FFP53736"]
}

demo.items:

```java

DateTime            TeslaEventstamp             {channel="account:model3:myaccount:mycar:eventstamp"}
String              TeslaState                  {channel="account:model3:myaccount:mycar:state"}
Number              TeslaSpeed                  {channel="account:model3:myaccount:mycar:speed"}
String              TeslaShiftState             {channel="account:model3:myaccount:mycar:shiftstate"}
Number:Length       TeslaOdometer               {channel="account:model3:myaccount:mycar:odometer", unit="km"}
Number              TeslaRange                  {channel="account:model3:myaccount:mycar:range"}

Number              TeslaBatteryLevel           {channel="account:model3:myaccount:mycar:batterylevel"}
Number              TeslaPower                  {channel="account:model3:myaccount:mycar:power"}
Number              TeslaBatteryCurrent         {channel="account:model3:myaccount:mycar:batterycurrent"}
Number:Length       TeslaBatteryRange           {channel="account:model3:myaccount:mycar:batteryrange", unit="km"}
Number:Length       TeslaEstBatteryRange        {channel="account:model3:myaccount:mycar:estimatedbatteryrange", unit="km"}
Number:Length       TeslaIdealBatteryRange      {channel="account:model3:myaccount:mycar:idealbatteryrange", unit="km"}
Number              TeslaUsableBatteryLevel     {channel="account:model3:myaccount:mycar:usablebatterylevel"}
Switch              TeslaPreconditioning        {channel="account:model3:myaccount:mycar:preconditioning"}

Switch              TeslaCharge                 {channel="account:model3:myaccount:mycar:charge"}
Switch              TeslaChargeToMax            {channel="account:model3:myaccount:mycar:chargetomax"}

Dimmer              TeslaChargeLimit            {channel="account:model3:myaccount:mycar:chargelimit"}
Number              TeslaChargeRate             {channel="account:model3:myaccount:mycar:chargerate"}
String              TeslaChargingState          {channel="account:model3:myaccount:mycar:chargingstate"}
Number              TeslaChargerPower           {channel="account:model3:myaccount:mycar:chargerpower"}
Number              TeslaTimeToFullCharge       {channel="account:model3:myaccount:mycar:timetofullcharge"}
Number              TeslaMaxCharges             {channel="account:model3:myaccount:mycar:maxcharges"}

Number              TeslaChargerVoltage         {channel="account:model3:myaccount:mycar:chargervoltage"}
Number              TeslaChargerPower           {channel="account:model3:myaccount:mycar:chargerpower"}
Number              TeslaChargerCurrent         {channel="account:model3:myaccount:mycar:chargercurrent"}

DateTime            TeslaScheduledChargingStart {channel="account:model3:myaccount:mycar:scheduledchargingstart"}
Dimmer              TeslaSoC                    {channel="account:model3:myaccount:mycar:soc"}

Switch              TeslaDoorLock               {channel="account:model3:myaccount:mycar:doorlock"}
Switch              TeslaHorn                   {channel="account:model3:myaccount:mycar:honkhorn"}
Switch              TeslaStart                  {channel="account:model3:myaccount:mycar:remotestart"}
Switch              TeslaSentry                 {channel="account:model3:myaccount:mycar:sentrymode"}
Switch              TeslaLights                 {channel="account:model3:myaccount:mycar:flashlights"}
Switch              TeslaValet                  {channel="account:model3:myaccount:mycar:valetmode"}

Switch              TeslaWakeup                 {channel="account:model3:myaccount:mycar:wakeup"}

Switch              TeslaBatteryHeater          {channel="account:model3:myaccount:mycar:batteryheater"}
Switch              TeslaFrontDefrost           {channel="account:model3:myaccount:mycar:frontdefroster"}
Switch              TeslaRearDefrost            {channel="account:model3:myaccount:mycar:reardefroster"}
Switch              TeslaLeftSeatHeater         {channel="account:model3:myaccount:mycar:leftseatheater"}
Switch              TeslaRightSeatHeater        {channel="account:model3:myaccount:mycar:rightseatheater"}

Switch              TeslaHomelink               {channel="account:model3:myaccount:mycar:homelink"}
Location            TeslaLocation               {channel="account:model3:myaccount:mycar:location"}
Number              TeslaHeading                {channel="account:model3:myaccount:mycar:heading"}
DateTime            TeslaLocationTime           {channel="account:model3:myaccount:mycar:gpstimestamp"}

Switch              TeslaAutoconditioning       {channel="account:model3:myaccount:mycar:autoconditioning"}
Number:Temperature  TeslaTemperature            {channel="account:model3:myaccount:mycar:temperature"}
Number:Temperature  TeslaTemperatureCombined    {channel="account:model3:myaccount:mycar:combinedtemp"}
Number:Temperature  TeslaInsideTemperature      {channel="account:model3:myaccount:mycar:insidetemp"}
Number:Temperature  TeslaOutsideTemperature     {channel="account:model3:myaccount:mycar:outsidetemp"}

String              TeslaDestinationName        {channel="account:model3:myaccount:mycar:destinationname"}
Location            TeslaDestinationLocation    {channel="account:model3:myaccount:mycar:destinationlocation"}
Number:Time         TeslaMinutesToArrival       {channel="account:model3:myaccount:mycar:minutestoarrival", unit="min"}
Number:Length       TeslaDistanceToArrival      {channel="account:model3:myaccount:mycar:distancetoarrival"}

demo.sitemap:

dsl
sitemap main label="Main"
{
    Text item=TeslaUsableBatteryLevel label="Car" icon="tesla" valuecolor=[<=20="red",>60="green"]
    {
        Frame
        {
            Text item=TeslaEventstamp icon="time"
            Text item=TeslaState label="State [%s]" icon=""
            Text item=TeslaHomelink label="Homelink Available[%s]" icon=""
            Text item=TeslaDistance
            Text item=TeslaSpeed label="Speed [%.1f]"
            Text item=TeslaShiftState label="Shift State [%s]" icon=""
            Text item=nTeslaShiftState
            Text item=TeslaOdometer label="Odometer [%.1f %unit%]"
            Text item=TeslaRange
        }
        Frame
        {
            Switch item=TeslaAutoconditioning label="Enable Heat or AC"
            Setpoint item=TeslaTemperature step=0.5 minValue=65 maxValue=78 label="Auto Conditioning Temperature [%.1f %unit%]"
            Text item=TeslaInsideTemperature label="Inside Temperature [%.1f %unit%]" valuecolor=[<=32="blue",>95="red"]
            Text item=TeslaOutsideTemperature label="Outside Temperature [%.1f %unit%]" valuecolor=[<=32="blue",>95="red"]
        }
        Frame
        {
            Text item=TeslaBatteryLevel
            Text item=TeslaUsableBatteryLevel
            Text item=TeslaPower
            Text item=TeslaBatteryCurrent label="Current [%.1f]"
            Text item=TeslaBatteryRange label="Battery Range [%.1f %unit%]"
            Text item=TeslaEstBatteryRange label="Battery Est Range [%.1f %unit%]"
            Text item=TeslaIdealBatteryRange label="Battery Ideal Range [%.1f %unit%]"
        }
        Frame
        {
            Switch item=TeslaCharge label="Charge"
            Slider item=TeslaChargeLimit label="Charge Limit [%.1f]"
            Text item=TeslaChargingState label="Charging State [%s]" icon=""
            Text item=TeslaTimeToFullCharge label="Time To Full Charge [%.1f hours]"
            Text item=TeslaPreconditioning label="Preconditioning [%s]" icon=""
            Text item=TeslaChargeRate label="Charge Rate [%d miles/hr]"
            Text item=TeslaScheduledChargingStart icon="time"
            Text item=TeslaChargerVoltage label="Charge Voltage [%.1f V]"
            Text item=TeslaChargerPower label="Charge Power [%.1f kW]"
            Text item=TeslaChargerCurrent label="Charge Current [%.1f A]"
            Text item=TeslaChargeToMax label="Charge To Max [%s]" icon=""
            Text item=TeslaMaxCharges label="Consec Max Charge[%d]"
        }
        Frame
        {
            Switch item=TeslaWakeup label="Wakeup the Car"
        }
        Frame
        {
            Switch item=TeslaDoorLock label="Doorlock"
            Switch item=TeslaHorn label="Horn"
            Switch item=TeslaLights label="Lights"
            Switch item=TeslaStart label="Remote Start"
            Switch item=TeslaValet label="Valet Mode"
            Switch item=TeslaSentry label="Sentry Mode"

            Switch item=TeslaBatteryHeater label="Battery Heater"
            Switch item=TeslaFrontDefrost label="Defrost Front"
            Switch item=TeslaRearDefrost label="Defrost Rear"
            Switch item=TeslaLeftSeatHeater label="Seat Heat Left"
            Switch item=TeslaRightSeatHeater label="Seat Heat Right"
        }
        Frame
        {
            Mapview item=TeslaLocation height=10
        }
        Frame
        {
            Default item=TeslaDestinationName
            Default item=TeslaMinutesToArrival
            Default item=TeslaDistanceToArrival
            Mapview item=TeslaDestinationLocation height=10
        }
    }
}

demo.rule (for graphing online status in sitemap above)

rules
rule "Tesla State Changed"
    when
    Item TeslaState changed

    then
        if (previousState == NULL) return;
        switch (TeslaState.state) {
            case "online" : {
                nTeslaState.postUpdate(1)
            }
            case "asleep" : {
                nTeslaState.postUpdate(0)
            }
            case "offline" : {
                nTeslaState.postUpdate(-0.5)
            }
            case "waking" : {
                nTeslaState.postUpdate(0.5)
            }
            case "unknown" : {
                nTeslaState.postUpdate(-1)
            }

        }
end