Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aduyng/tesla-client

A NodeJS application to report my Tesla status
https://github.com/aduyng/tesla-client

firebase firebase-database nodejs tesla-api

Last synced: 22 days ago
JSON representation

A NodeJS application to report my Tesla status

Awesome Lists containing this project

README

        

# tesla-client
A collection of Firebase Cloud functions to report the car status using Tesla Unofficial API

I set up this repo with my Raspberry Pi as a cronjob to report the status of the vehicle very 30 minutes.

## Installation
(Replace `/home/pi/tesla-client` to your installation folder)
1. Clone this repository
```bash
git clone https://github.com/aduyng/tesla-client.git /home/pi/tesla-client
```
1. Install dependencies
```bash
cd /home/pi/tesla-client
[sudo] npm install forever --global
npm install --production
```
1. Follow the instruction here: https://firebase.google.com/docs/admin/setup to set up your firebase project and obtain the parameters for `initializeApp()`. Download the service account JSON file and save it to `/home/pi/tesla-client/private/firebase-service-account-key.json`
1. Enter environment variables in `/home/pi/tesla-client/.env`
```bash
TESLA_CLIENT_ID=
TESLA_CLIENT_SECRET=
TESLA_ACCOUNT_USERNAME=
TESLA_ACCOUNT_PASSWORD=
FIREBASE_API_KEY=
FIREBASE_AUTH_DOMAIN=
FIREBASE_DATABASE_URL=
FIREBASE_PROJECT_ID=
FIREBASE_STORAGE_BUCKET=
FIREBASE_MESSAGING_SENDER_ID=
FIREBASE_APP_ID=
GOOGLE_APPLICATION_CREDENTIALS=/home/pi/tesla-client/private/firebase-service-account-key.json
CRON_SCHEDULE="*/5 * * * *"
```
1. Start with `forever`
```bash
forever start /home/pi/tesla-client/forever.json
```

## Development
Run `npm run dev` to start the development