Skip to content

Flask App to interact with Subaru API using custom Siri shortcuts to unlock & lock your car

Notifications You must be signed in to change notification settings

krushil1/subaruAPI-V1

Repository files navigation

Description

Subaru API built with subarulink package. Current version built in Flask and can lock and unlock your Subaru that is subscribed to the Starlink services.

Credits

Used code from aws-subaru-api repository to convert chrisroedig's repository into a Flask app.

Todo

-Create integration to start engine with climate custom presets.
-Apply a API key to secure the Flask server and use environment variables instead of hard-coding the credentials

Installation

Clone the project

  git clone https:/krushil1/subaruAPI-V1.git

Go to the project directory

  cd subaruAPI-V1

Setup virtual environment

  python3 -m venv env
  source env/bin/activate

Enter your credentials inside the subaru_link_service.py file

    SUBARU_USERNAME=""
    SUBARU_PASSWORD=""
    SUBARU_DEVICE_ID="" # For device_id, use any 10 digit number. Ex: timestamp
    SUBARU_DEVICE_NAME="subarulink"
    SUBARU_VIN=""
    SUBARU_PIN=""

Install the dependencies

  pip install -r requirements.txt

Testing the server locally

  python3 flaskapp.py

Using the server for sending unlock/lock requests

To unlock your Subaru

POST Request
Host: serverURL
Content-Type: application/json

{
  "pin": "XXXX",
  "command": "unlock",
}

To lock your Subaru

POST Request
Host: serverURL
Content-Type: application/json

{
  "pin": "XXXX",
  "command": "lock",
}

Deploying the Flask server

Create an account on Vercel for deploying it to a live server!

About

Flask App to interact with Subaru API using custom Siri shortcuts to unlock & lock your car

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages