Plugin: Tesla Car integration

Hi,

I created a first release of this Tesla Car plugin. I test it against a Model 3, but it should work for the S and X just as well. You can control many of the same remote options as from the mobile Tesla App.

It is in the Vera App market, and available in the ALTUI App store.

If you want to look at the code and (once done) the documentation look here https://github.com/reneboer/vera-TeslaCar.

Still looking at good functionality to add, so suggestions are welcome. Just as bug reports.

Cheers Rene

6 Likes

Awesome! Looking forward to testing it

Do you think that I could persuade either Tesla or Vera to get me a test machine??

6 Likes

Successfully installed the app and connect to my model s! Seems to functioning well, will update if I see any other issues. Looking forward to have mobile app support for climate and charging etc.

Edit:
Small issue ive found is that the window status is showing ‘All Open’ when all of them are closed!

Hi @Pabla,

Can you check the values of WindowsStatus and WindowsMessage?

Cheers Rene

Hi Ak, you can always ask :smile:

For window message I get “All are open” and this is what I’m getting for window status

Hi @Pabla,

Ok, that is not what I expected. It looks like the windows status is not reported, and that could be true if your car is still on API version 6. At least that is what I get looking at the API doc here https://www.teslaapi.io/vehicles/state-and-settings.

Can you set the log level to debug and see what gets returned in the vehicle_state for api_version and see if fd_window exists?

Cheers Rene

Will it work with the Power Wall battery bank?

Hi @BernieHollaway,

No this plugin is for the Tesla Cars only. However, feel free to take the code and build one as the API is the same. The Tesla API handling is in the TeslaCarApi module. The authentication, loggof and send command you should be able to use as is. You can update the commands mapping table with the power wall commands. More on that you can find here https://www.teslaapi.io/.

Cheers Rene

Hi Rene,

Plugin has been working great for me. May I make a recommendation for the mobile app to use the thermostat device to set the climate temperatures? Also to have some toggles so that I can toggle charging on/off, lock/unlock etc. and for aesthetics purpose each switch have the icons associated with the state the cars in ie next to the lock/unlock toggle instead of having a switch icon have the Tesla unlock icon show. Otherwise great work.

Thanks

Hi Pabla,

This is exactly what I have on my to-do list. This way they will also show as standard devices in the Vera app.

I’m especially looking for the easiest way to unlock the charger cable. They should have included a button on the car or link it to the unlocking of the doors. So clumsy to dive into the car or open the phone app.

Cheers Rene

To unlock the charge port you can press And hold the button on the charger while the cars unlocked to unlock the port. This only does work if the charger you’re using has a button on it to begin with.

Hi Pabla,

Problem is that the cables used in the EU (Mennekes type 2) typically do not have that button. Not even the cable supplied by Tesla! It seems that they do exist, but are not that easy to find.

Cheers Rene

If you have a newer iPhone and a model 3 you can maybe place an NFC tag in the charge port door and use Siri Shortcuts to unlock the charge port when it senses the NFC tag

Hi,

I put V1.4 on the ALTUI app Store (Mios app market is failing to update). Changes include:

  • Added support for child devices for Climate, Locks, Windows, Sunroof, Trunk, Frunk, Charge Port, Charging, Inside temp, Outside temp.
  • Added Vera event triggers.
  • Not checking awake state for each command when sending a series of commands.
  • Some re-writes
  • Fix on auto software install
  • Added Vera triggers in D_TeslaCar1.json

All child devices are based on a standard Vera device type so you can control them from the Vera App. For all On is good. I.e. Locks On is locked, so good. Off is unlocked. Windows On are closed, Off is Vent, etc. The Charging device is a Dimmer so you can set the desired load level. Default is 90%. Min is 50%, max 100%. For the Climate a Heater device is used so you can turn the Heat (climate) on and Off. Note that you can only change the target Inside temp when heating. This is a Vera ‘feature’. The Heater defice does not look or works well on ALTUI. I need to look at that as it is more ALTUI than this plugin I think…

Let me know how it is working for you.

Cheers Rene

2 Likes

Hi Rene,

Updated and everything seems to be working well. May I make a recommendation to change the door lock device type of an actual door lock type? Would make it easier to decipher whether the door are locked or not. Other than that I am very pleased with the plugin thanks!

So I’ve been testing the commands and have run into an issue. If the car is asleep for a while, and I try to unlock the car, the switch will turn off indicating it’s unlocked. What actually happens a minute or two after the car updates status and the command doesn’t go through. Once the status updates and the cars awake then I can unlock the car. This holds true for any other command. Also when the car is asleep too all the switches are turned on regardless of the state.

Hi @Pabla,

Having the state of the child devices change state when you click is by design. Else you do not see any response on the GUI when you click. When you click the, command gets send to your car and after about 15 seconds a status request is send to see what the actual car state is. If the command has failed for what ever reason the switch will go back to the original position indeed. All these evens take their time and are far from real time, thus the GUI and real state can be out of sync for a while. Not much I can do about that. On top of that I am finding the car sometimes does not wake up. The plugin sends up to 5 wake up commands, but if that fails it gives up. I can build in some retry scheme, but I know that is challenging as well. I also see some errors with the communication especially after plugin start up i still have to find a better way to handle.

Thanks for the suggestion on the lock device type. I’ll have a look.

Cheers Rene

Your plugin should be approved Rene. Thank you for the patience.

Best Home Automation shopping experience. Shop at getvera!

© 2020 Vera Control Ltd., All Rights Reserved. Terms of Use | Privacy Policy