https://github.com/alanzchen/mymazda-relay
Mazda Connected Service API wrapper based on pymazda and Flask.
https://github.com/alanzchen/mymazda-relay
mazda
Last synced: 6 months ago
JSON representation
Mazda Connected Service API wrapper based on pymazda and Flask.
- Host: GitHub
- URL: https://github.com/alanzchen/mymazda-relay
- Owner: alanzchen
- License: mit
- Created: 2021-12-21T21:07:10.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-28T20:03:36.000Z (over 3 years ago)
- Last Synced: 2023-04-04T20:43:08.661Z (over 3 years ago)
- Topics: mazda
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 11
- Watchers: 4
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mazda Connected Service Relay
Mazda Connected Service API wrapper based on pymazda and Flask.
# Deployment
Docker can be used to deploy the project locally, simply do `docker-compose up -d`.
This installs the requirements and launchs the flask server behind a `gunicorn` reverse proxy running on port 5001 in a docker container.
# Usage
Make `POST` calls to `https://mymazda.herokuapp.com/{endpoint}`, where `endpoint` could be something like `startEngine`. To make a valid request, you will need to attach a JSON payload with the following fields:
```json
{
"username": your_mazda_email,
"password": your_mazda_password,
"vid": internal_vehicle_id,
"region": your_region
}
```
- `vid`: To obtain the `vid` for your vehicle, you can first make a `POST` call to `https://mymazda.herokuapp.com/vehicles` with just the `username` and `password` as the JSON payload. After getting a list of vehicles, find `id` associated with it. It will be the `vid` of your future API requests.
- `region`: If you are living in the US, you can omit this field or fill in `MNAO`. Otherwise, it should be `MME` for EU, and `MJO` for Japan.
Below are some examples of API usage. To see a full list of API endpoints, see `app.py`.
## Example: Start / Stop Engine
`POST` the above JSON to `https://mymazda.herokuapp.com/startEngine` or `https://mymazda.herokuapp.com/stopEngine` to start / stop the engine.
## Example: Send navigation destination to infortainment
Send the following JSON to `https://mymazda.herokuapp.com/sendPOI`. Note that you need the navigation SD card for it to work.
```json
{
"username": your_mazda_email,
"password": your_mazda_password,
"vid": internal_vehicle_id,
"longitude": longitude_float,
"latitude": latitude_float,
"name": name
}
```
# iOS Shortcuts Example
- [Send Apple Maps location to your vehicle](https://www.icloud.com/shortcuts/3e6b090e5b3c43968710d5daf6be3fa0)
- [Start Engine](https://www.icloud.com/shortcuts/3950a9c831cb4f4eb4122863cfe8fa9b)