npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

teslalexa

v0.1.1

Published

Control a Tesla from Alexa

Downloads

7

Readme

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.