Giter Site home page Giter Site logo

teslacal's Introduction

teslacal

Have events in your Google Calendar execute commands on your Tesla car.

(c) 2016 by Lourens Rozema

Description

This is a python program that checks your Google Calendar for events and once the time passes an event it will execute the corresponding command on your Tesla car. This allows amongst others to turning on the airconditioning before departing based on your calendar.

Installation

  1. Download the repository zip file and uncompress it.
  2. Download and install https://github.com/gglockner/teslajson
  3. Go to https://developers.google.com/google-apps/calendar/quickstart/python and execute step 1, afterwards put the downloaded file as client_secret.json in the same directory as teslacal.py. Also install google-api-python-client according to step 2: pip install --upgrade google-api-python-client
  4. Finally create the file teslacal.cfg see below for details.
  5. And then start adding events in your Google calendar.

Configuration

[tesla]
username = [email protected]
password = abc123
vin = YOURVINNUMBER

[google]
calendarId = primary

[email]
smtp = localhost
from = [email protected]
to = [email protected]

You have to specify your Tesla account login for connecting to your car. The VIN number is optional, if not specified the first car will be chosen.

When a command is succesfully executed the script will send you an e-mail about it. If you don't want e-mail then remove the email section.

Events

The following events are supported:

  • Tesla honk horn
  • Tesla flash lights
  • Tesla airco
  • Tesla start airco
  • Tesla stop airco
  • Tesla charge
  • Tesla start charging
  • Tesla stop charging

The event text should be in the summary of the event. Repeated events are not yet supported. Make sure that the duration of the event is longer then the interval of your cronjob.

Cronjob

Finally have the script run from cron. The more often the cronjob executes the more accurate the events execution time will match the event start time. I suggest 5 minutes would be nice.

*/5 * * * * your-user cd ~/teslacal && python teslacal.py > /dev/null

teslacal's People

Contributors

lrozema avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.