https://github.com/brantburnett/teslaodometermonitor
Super simple Lambda function which checks your Tesla's odometer and sends and SNS notification if it is over a threshold. Designed to help you remember to rotate your tires.
https://github.com/brantburnett/teslaodometermonitor
Last synced: 3 months ago
JSON representation
Super simple Lambda function which checks your Tesla's odometer and sends and SNS notification if it is over a threshold. Designed to help you remember to rotate your tires.
- Host: GitHub
- URL: https://github.com/brantburnett/teslaodometermonitor
- Owner: brantburnett
- Created: 2021-08-15T18:36:58.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-15T18:38:14.000Z (almost 4 years ago)
- Last Synced: 2025-01-14T10:17:25.097Z (5 months ago)
- Language: JavaScript
- Size: 19.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Telsa Odometer Monitor
Super simple Lambda function which checks your Tesla's odometer and sends and SNS
notification if it is over a threshold. Designed to help you remember to rotate
your tires.## Configuration
Configuration is entirely by environment variable.
| ENV VAR | Description |
| ------- | ----------- |
| REFRESH_TOKEN | OAuth refresh token for your Tesla |
| VEHICLE_ID | Vehicle ID ("id" attribute from `https://owner-api.teslamotors.com/api/1/vehicles`) |
| TARGET_ODOMETER | Alerts at this odometer value or greater |
| SNS_TOPIC | ARN of the SNS topic to notify |## Deployment
The deployment is VERY manual. It is expected that the following conditions are met:
1. Lambda function is deployed with a role which has access to publish to the SNS topic
2. Lambda function has a timeout around 15s
3. Lambda function has the requirement environment variables above
4. Lambda function is configured to be triggered by Amazon EventBridge on a scheduleExample CRON schedule to check and notify every Sunday:
`cron(0 16 ? * SUN *)`
### Packaging
```sh
npm install # If node_modules isn't present
zip -r function.zip *
aws lambda update-function-code --function-name telsaOdometerMonitor --zip-file fileb://function.zip --profile brant --region us-east-1
```