Skip to content

timdorr/teslalexa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Teslalexa npm

Control your Tesla from Alexa. Uses the Tesla JSON API.

Prerequisites

Install

Yes, I know this is huge. I'm looking to automate this more in the future. PRs to help are appreciated!

  1. Go to the Releases tab and download the zip or tar.gz of the latest release.
  2. Unzip to somewhere and open up a terminal console in that location.
  3. Run npm install to obtain any dependencies.
  4. In AWS, create a function in Lambda:
  5. Choose the Blank Function blueprint.
  6. Select Alexa Skills Kit as your trigger.
  7. Name the function TeslaControl and make sure the Runtime is Node 4.3.
  8. Leave the code section alone.
  9. Set the following Environment Variables: - TESLA_EMAIL - Your tesla.com email address - TESLA_PASS - Your tesla.com password - TESLA_VIN - The VIN of the vehicle you want to control - TESLA_CLIENT_ID - You can get these two here - TESLA_CLIENT_SECRET
  10. Under Role, Create a new role from a template. Name it TeslaControl and choose the Simple Microservice permission.
  11. Create the function and grab the ARN from the top right of the screen.
  12. Head over to the IAM section of the AWS Console and go to Roles.
  13. Select the TeslaControl role and click on the policy that starts with AWSLambdaMicroserviceExecutionRole-.
  14. Edit the policy and change the Action section it so it reads:
"Action": [
    "dynamodb:*"
]
  1. Validate the policy to be sure it's right and Save it.
  2. In the Amazon Developers Console, create a new Alexa skill:
  3. The Skill Type is Custom Interaction Model, you can name it whatever you want, and the Invocation Name should be "my car" ("my Tesla" will also work. I wouldn't recommend "my Model S")
  4. In the Interaction Model tab, copy the contents of intents.json into the Intent Schema, and utterances.txt into the Sample Utterances box.
  5. Create two Custom Slot Types: - LOCK_UNLOCK lock unlock - START_STOP start stop
  6. On the Configuration tab, choose the AWS Lambda ARN as Service Endpoint Type, region of North America, and enter the ARN from the AWS Lamda function you created.
  7. On the Test tab, it should be enabled for testing on your account.
  8. Grab the ID at the top of the page (starts with amzn1.ask.skill).
  9. Head back to the AWS Lambda function you created and add a new APP_ID environment variable with the Skill ID you just copied.
  10. Back in the terminal console, run npm run lambda to publish the code to your Lambda function.
  11. Back in the Amazon Developer Console, you should be able to test with an utterance of "Tell my car to log in" and get back some code that says something about being logged in.
  12. Also run "Tell my car to get vehicle" to make sure it can find your vehicle.

About

Control your Tesla with Alexa

Resources

License

Stars

Watchers

Forks

Packages

No packages published