teslalexa

0.1.1 • Public • Published

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](http://pastebin.com/fX6ejAHd)
- TESLA_CLIENT_SECRET
  1. Under Role, Create a new role from a template. Name it TeslaControl and choose the Simple Microservice permission.
  2. Create the function and grab the ARN from the top right of the screen.
  3. Head over to the IAM section of the AWS Console and go to Roles.
  4. Select the TeslaControl role and click on the policy that starts with AWSLambdaMicroserviceExecutionRole-.
  5. 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
```
  1. 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.
  2. On the Test tab, it should be enabled for testing on your account.
  3. Grab the ID at the top of the page (starts with amzn1.ask.skill).
  4. Head back to the AWS Lambda function you created and add a new APP_ID environment variable with the Skill ID you just copied.
  5. Back in the terminal console, run npm run lambda to publish the code to your Lambda function.
  6. 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.
  7. Also run "Tell my car to get vehicle" to make sure it can find your vehicle.

Readme

Keywords

none

Package Sidebar

Install

npm i teslalexa

Weekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • timdorr