Control and Query your Tesla vehicles (via Tessie.com)

The replacement for my supported Tesla app to control and query your tesla vehicles is now available.

The older direct Tesla implmentation is being mothballed as tesla is getting rid of that API and release the fleet api which will require a company to implement and eventually charge for it.

Therefore there were two options I found to replace it.:

  1. A teslafi integration, I do have a mostly working integration here released in another thread but the fact that the api is more limited.. ie no window/door/trunk/frunk status or control etc. I have stopped development there (it is working if you want to try it) and focused on this TESSIE integration instead.

  2. This integration see http://www.tessie.com. The api is api.tessie.com.
    All prior functionality is the older direct tesla integration is implemented and working and a few new options.

See the older thread for discusion how to get presence working if you do not have homelink

You will have to pay for a account on tessie (4.99 a month or 50 a year). They do have a free 2 week trial if you want to try it first.
That seems to be the way it is going with Tesla as they deprecated the old api to implment this new fleet api and monetize it.

Use my referral code here when siging up for tessie:

Link to Sign up for Tessie giving me a referral - with a free trial month !

After setting up and getting an api key , you need to enter into the app in hubitat and it should find your vehicles(s) and create a device for each (see below).

After setting up your tessie account. the first time you try a command you will get an error with a url in the logs and you will have to execute that url on your phone which has your tesla account .

Now available on Hubitat Package Manager (HPM)

If you manually install the application in Apps Code and the device/car driver in Drivers Code.. This is the same as previously..

There is no setup of token refersh as previous as tessie handles that , you just need to input their token, not a tesla token.

AS I now will be probably maintaining two versions of theae integration one for teslafi and one for tessie donations via paypal are welcome but not required at kahn@lgk.com

Good luck.

https://raw.githubusercontent.com/lgkahn/hubitat/master/tessieVehicle.groovy

7 Likes

FWIW, I think you made a good choice. I've been a TesliFi user for a bit over 4 years, and am transitioning to Tessie. Both TesliFi and Tessie are good services, but unless you need the very detailed analytics TeslaFi offers, Tessie is a bit more polished, practical and less complex from a web service perspective. I love Tessie's ability to import data from other sources including TeslaFi. :slight_smile:

I recently spent a bit of time working with the developer @ Tessie to work through some polling issues with the HomeAssistant integration, and he was quite knowledgeable, and patient, while working through interactions between the HA integration, Tessie's API, and Tesla's API. Good guy.

Btw, I believe that you can remove all the wake() calls. Unlike TeslaFi, with Tessie you do not need to perform an explicit wake() prior to executing commands on a sleeping vehicle. The Tessie API handles this automatically for you. The only real purpose to wake() I've found is if you absolutely need to retrieve current data from an otherwise sleeping vehicle.

The wake calls are all optional. You need to turn that on in the app to use them. See the first slide.

You are correct though. All.
my testing i have wake disabled.

Sorry, I just looked at the code. :slight_smile:

Since they don't have any use or effect, I wasn't sure why they would be in the code.

NP Because it is a leftover from the older version,, and not sure we wont need it in the future or for a specific command..

Probably will eventually clean up and remove them if they really are never going to be needed, but only after many more people test it and i am more comfortable we wont need the option.

like below where only two commands were giving timeout errors.

  • v 1.1 1/14/24 Added:
  • all to seat heater option, and change name of close Trunk to open or close Trunk to be clearer as it is actually a toggle,
  • also added following commands:
  • set Seat Cooling
  • start Defrost
  • stop Defrost
  • remote Start
  • Close Sunroof
  • and list Drivers
  • Obviously not all commands work with all vehicles, for instance many have no 3rd row seats, or steering wheel heater, or cooling seats or auto close trunk etc.
  • v 1.2 1/13/24 For some reason only open frunk trunk worked but was getting a timeout error.. not sure why but had to add new functions to pass in a 30 sec timeout.
    */

Other quirks i noticed trying to turn on climate with hood or trunk open gives fails and gives message as follows:

But trying to turn seat heaters on with something open also does not work, but no error returns it just times out and gives a timeout error no matter how long you set the timeout.. Probably a bug in either teslas or tessie api, but not sure who or even if I should report it..

Regarding the seat heater, does "something else open" mean like a door or trunk? If so, FWIW it works on my vehicles.

Regarding the climate, on my vehicles attempting Start Climate with the trunk open returns an initial error, even using the Tesla app itself. It requires a second step to complete, and I believe it uses a different API entry point. In Tessie's API, I believe the way to override this is to use Climate Keeper Mode instead of Start Climate.

It's worth noting that all of this may be very vehicle dependent. One thing that has been brought home to me is that Tesla's APIs behave differently based on the type and generation of the vehicle. This is a real pita for integrations using the Tesla API directly, or simple pass-through APIs such as TeslaFi appears to be. To me, there is a lot of value in using the Tessie API because it hides/handles some of the complexity.

YMMV

1 Like

Assume you found your answer looking on the web site :slight_smile:

1 Like

Yes... thanks. Signed up with trial to compare the two. :slight_smile:

I have switched over to using only this integration on my car. Both teslafi and older tesla removed so far so good. One note;

The first time you try to a command there will be error message in the logs with a link to tesla to enable commands for your tessie login.

Commands will NOT work till you do this!!!!

1 Like

new version 1.3

  • v 1.3 1/14/24 add current address attribute.
    */

new attribute and code to get address but an option to enable it as it requires an extra query on every refersh...

ie

1 Like

@kahn-hubitat I just signed up for the Tessie trial. Did they already give you a lifetime account for all the Hubitat users you'll be sending their way, or do you have a referral code I can enter to give you the referral?

I'm seeing an issue with the new app or the integration to Tessie. I just got my cars added and there is an issue with handling multiple cars. I have a Model 3 and a Model Y. After adding the app and device driver from your Github and putting in my Tessie token it created two car devices. The names match the names of my two cars.

Other than the Device Label, Device Name and Network Id, everything for the Model Y is a copy of the data for the Model 3, down to the VIN. The other odd thing is that the Model 3 is showing 80% battery in the Tesla and Tessie apps, but it is showing 83% battery in the Hubitat device.

I have Tesla Connect 3.0 installed and everything works normally for both cars in the old app.

try new version and open and go through the app again and hopefully it will fix the vin, then do a refresh on the car with the incorrect data..

  • v 1.4 1/16/24 attempt at fixing incorrect vin for multiple vehicles.
  • openning application and reselecting all the vehicles hopefully will fix the incorrect vin on the child device.
    */

Will do...

For the other issue, here is the debug log. It looks like this may be a Tessie API issue:

dev:000000 16:54:19.962 debug chargeState = [battery:83, batteryRange:189.24, chargingState:Complete, chargeLimit:80, chargeAmps:20, minutes_to_full_charge:0]

dev:0000000 16:54:19.951 debug processData: [state:online, vin:5YJ3E1EA4LFxxxxxx, speed:0, motion:inactive, thermostatMode:off, chargeState:[battery:83, batteryRange:189.24, chargingState:Complete, chargeLimit:80, chargeAmps:20, minutes_to_full_charge:0], driveState:[latitude:xxxxxxxx, longitude:yyyyyyyy, method:wgs, heading:289, lastUpdateTime:Tue Jan 16 16:54:12 EST 2024], vehicleState:[presence:not present, lock:locked, odometer:16192.981263, sentry_mode:Off, front_drivers_window:Closed, front_pass_window:Closed, rear_drivers_window:Closed, rear_pass_window:Closed, valet_mode:Off, tire_pressure_front_left:2.925, tire_pressure_front_right:2.975, tire_pressure_rear_left:2.975, tire_pressure_rear_right:2.975, front_drivers_door:Closed, rear_drivers_door:Closed, front_pass_door:Closed, rear_pass_door:Closed, frunk:Closed, trunk:Closed, user_present:false], climateState:[temperature:29, outside_temperature:25, thermostatSetpoint:69, passengerSetpoint:69, seat_heater_left:0, seat_heater_right:0, seat_heater_rear_left:null, seat_heater_rear_right:null, seat_heater_rear_center:null]]

is that the correct vin for the car with 80 percent versus 83.. becuase the duplicate car issue was the wrong VIN inputted to one of the child devices..

if it is the correct vin then yes that is definately a tessie api issue becasuse that is what it is passing me back.

also are you looking at the right attribute as the battery state is 83 but the charge limit is set to 80?

i have never noticed but it could also be that the battery condition got better after the charge to 80 as i have seen range go up later after a charge if it warms up or something.. and maybe the app does not report that? weird.

Yes, that was the car with the correct VIN, so showing 80 in Tesla/Tessie apps but Tessie API is returning 83%. I'm also seeing that my Model Y is at 69% but Tessie is reporting 71%.

I just had a few neurons connect, and remembered that Teslamate, which is also hitting the Tesla API, sometimes reports two values for the state of charge. Sure enough, right now Teslamate is showing
image
and
image

So I don't think this is an issue with the Tessie API, but rather something about the Tesla API reporting more than one SOC value. The Tesla and Tessie apps show the first value. The Tessie API returns the second per the debug logs.

As for the duplicate VINs... it seems to be fixed. It didn't seem to fix right away, but I edited the Model Y hubitat device, changed the name, label, and network ID, then went into your app and de-selected the Model Y, then went in again and re-selected the Model Y. After doing that, it created a new device with the correct VIN and all the values look correct.

I didn't want to just delete the old device since it's used in a lot of rules. Now I just need to go in and swap the two devices in all the rules. I was disappointed to see that the device swap function under "Settings" doesn't list these devices. I think maybe it doesn't show child devices? There are definitely some other devices missing from that list.

glad it is fixed.. if you go back in logs do you see this message.. should have repaired it in this code?

  def d = getChildDevice(dni)
        if(!d) {
            def vehicleName = state.accountVehicles[dni]
            def vin = state.accountVINs[dni]
            device = addChildDevice("lgkahn", "tessieVehicle", dni, null, [name:"Tesla ${dni}", label:vehicleName])
            log.debug "created device ${device.label} with id ${dni} vin = ${vin}"
            device.initialize()
            device.sendEvent(name:"vin" , value:vin)
        } else {
            log.info "Device for ${d.label} with id ${dni} already exists"
            def cvin = d.currentValue('vin')
            if (cvin != state.accountVINs[dni])  
            {
              log.info "current vin = $cvin"
              log.info "Resetting vin for vehicle setting vin to ${state.accountVINs[dni]}" 
            }
        }

ahh fff d up.. forgot to actual do the set value.. will fix for future use.

! Was missing this line.. thanks for debugging for me lol
d.sendEvent(name:"vin", value: state.accountVINs[dni])

yes replace doesnt handle child devices which is something i have complained about..

i have two devices in some on my tesla rules.. one a dummy device i have disabled so that if i have to redo the car device (which i have done in the past for testing) all my rules are not broken.. ie

referral code added in top of thread:

I'd test long and hard before offering an assertion that there may be an issue with Tessie itself. :slight_smile:

I made such a mistake, and unfortunately it was the basis for my first interaction with the Tessie developer. It took a bit of time to recover. Thankfully he was very patient with me.

2 Likes