TMC is an independent, primarily volunteer organization that relies on ad revenue to cover its operating costs. Please consider whitelisting TMC on your ad blocker and becoming a Supporting Member. For more info: Support TMC

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

Discussion in 'Technical' started by primo, Jun 28, 2019.

  1. primo

    primo Member

    Joined:
    Jun 18, 2019
    Messages:
    18
    Location:
    Florida
    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.
     
    • Like x 2
    • Helpful x 1
  2. gmtom1

    gmtom1 Member

    Joined:
    Apr 25, 2013
    Messages:
    959
    Location:
    Honolulu, HI
    Is there any way to setup a raspberry pi with the Tesla API to do a DIY teslafi-type server/ data logger?
     
  3. primo

    primo Member

    Joined:
    Jun 18, 2019
    Messages:
    18
    Location:
    Florida
    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.
     
  4. robertvg

    robertvg Extremely Well-Known Member

    Joined:
    Jul 3, 2015
    Messages:
    4,591
    Location:
    Amsterdam, Netherlands
    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.
     
  5. primo

    primo Member

    Joined:
    Jun 18, 2019
    Messages:
    18
    Location:
    Florida
    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!
     

Share This Page

  • About Us

    Formed in 2006, Tesla Motors Club (TMC) was the first independent online Tesla community. Today it remains the largest and most dynamic community of Tesla enthusiasts. Learn more.
  • Do you value your experience at TMC? Consider becoming a Supporting Member of Tesla Motors Club. As a thank you for your contribution, you'll get nearly no ads in the Community and Groups sections. Additional perks are available depending on the level of contribution. Please visit the Account Upgrades page for more details.


    SUPPORT TMC