Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

TeslaPi: Security Alarm Integration Project w/ Tesla API and RaspBerry Pi

This site may earn commission on affiliate links.
I was getting familiar with the Tesla API even before my car was delivered. I just finished my first project: TeslaPi. The project can be downloaded here on GitHub.

Here is a video demo.

It is a very basic security alarm integration that uses an outdoor motion sensor and RaspBerry Pi to trigger the headlights and horn on my Model 3. The monitoring time is configurable and there are alarm escalation levels that are also configurable. The code is written in Python.

It is more a proof of concept at this point, so I do not recommend it for any production security systems. It certainly can be tested and improved further to be production ready though. It is also easy to customize and add additional alarm actions.

I think that it will work with all Tesla Models being that they use the same API.
 
All of the API commands for retrieving data and settings are defined here.
State And Settings

All of the API commends that take some type of action are defined here.
Commands

As far as I know, that is everything that is available. If someone knows different, please post.

I was hoping a RPI could do the logging directly from the canbus/diag port.
Something like ScanMyTesla but then on an RPI.
And copy the collected data every x hours or once a day through a LTE connection on the RPI.
 
I was hoping a RPI could do the logging directly from the canbus/diag port.
Something like ScanMyTesla but then on an RPI.
And copy the collected data every x hours or once a day through a LTE connection on the RPI.

Robert,

I wonder how the developers of those applications are doing that. Maybe there is additional API access available via special requests or partnerships with Tesla. If you find out anything, please post it.

Thanks!