Skip to content

Latest commit

 

History

History
84 lines (61 loc) · 1.74 KB

README.md

File metadata and controls

84 lines (61 loc) · 1.74 KB

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://github.com/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!