A workflow for interacting with a Tesla vehicle via the unofficial Tesla JSON API
- Alfred 3
- Alfred 3 Powerpack (paid upgrade — it's worth it!)
- Download the latest github release and open it with Alfred
- This workflow auto-updates to the latest release by checking the repository once daily and prompting the user to install the update.
- You can also force update with magic argument:
tesla workflow:update
- The keywords for Tesla Alfred Workflow are:
tesla
andtesla-activate
tesla-activate
to set one of your Tesla vehicles as the active one to use with this workflowtesla
to interact with the active vehicle
After changing the source files and/or snippet files, you'll need to export the project as a .alfred3workflow file.
I've included in this repository a modified gist from here to build and export the workflow (workflow-build.py). It includes dependencies that you'll need to install. Here's a recommended workflow:
virtualenv ~/.envs/workflow-build
creates a virtual environment so you can install the dependencies in their own sandboxsource ~/.envs/workflow-build/bin/activate
activates the virtual environmentcd tesla-alfred-workflow
moves you to the repo directorypip install -r requirements.txt
installs the dependencies in this sandbox (leaving your global/system python alone)python workflow-build.py -o output_dir .
exports the current repo directory as a .alfred3workflow file, excluding the following patterns:
EXCLUDE PATTERNS |
---|
*.pyc |
*.log |
.DS_Store |
*.acorn |
*.swp |
*.sublime-project |
*.sublime-workflow |
*.git |
*.dist-info |
*.egg-info |
*.gif |
README.md |
workflow-build.py |
requirements.txt |
*.idea |
You can add more patterns in the workflow-build.py file to exclude new file types that you don't want packaged in the zip file.
- Handle Unauthorized api response to prompt user to try resetting Tesla credentials.
- Update teslajson library to support polling API commands, resolves issue where sending API command raises ContinuePollingException
- Initial release