It should be easier to find out which car maintenance services you should be doing and when. (The EPA Blog - Car Maintenance is a Must! By Lina Younes ) Our current global warming situation depends on us to be responsible for our vehicles. As cars begin to transition from offline machines into IoT devices of the future, the way we approach maintenance on our vehicles should be smarter too.

What it does

This application leverages SMARTCAR's Restful API service to track your cars lifecycle. I am able to use the odometer information to calculate when and what your next preventative maintenance service should be. Right now, there are two categories: oil change and tire change. We can then use this accumulation of data to create an Amazon Alexa Custom Skill that will assist you in maintenance reminders and information so you don't have to read any more maintenance manuals!

How I built it

Flask application was set up using the documentation on the SMARTCAR's API website. Once the user is authenticated and matched up with their smart vehicle, the Flask program pulls the make, model, and odometer information of the vehicle and saves it into a JSON object for storage.

We can then use that JSON with Amazon Alexa to be read into useful updates to give us a heads up on maintaining the vehicle. I used the Python SDK provided by Alexa Development tools to create an Amazon Alexa Custom Skill to read that car information, and provide useful maintenance alerts regarding your smart vehicle, and help recommend where we can receive that maintenance. I created one Intent with two possible utterances: when is my next {serviceType}, where serviceType is a slot type that could be oil service or tire service.

Challenges I ran into

Setting up the communication between a running Flask application and the Amazon Alexa Lambda functions. Should have used Flask-Ask from the beginning. I was running two separate processes and I needed them not only to be able to speak to each other, but hold the dependencies required in one place. Flask Ask handles this by using HTTPS protocols with a tool called ngrok which uses one command for an instant, secure URL to your localhost server.

Accomplishments that I'm proud of

I used a piece of hardware at a hackathon! I was able to get both applications up running independently.
I discovered 3 different ways to submit input to an Alexa custom skill: Lambda functions, HTTPS web services, and Flask-Ask, which makes session management easy. I built my first python backend using Flask. I built my first Amazon Alexa Skill!

What I learned

How to set up a Flask application. How to use a RESTful API. How to create an Amazon Alexa Skill, and the different kinds of skills available.

What's next for SmartCar Alexa Assistant

I would like to add in more Alexa Intents for different services types, as well as an intent for a general overview of car health. This overview would include the oil you are using and what is recommended, fuel additive recommendations, current gas mileage, and third-party connections information sharing. I would also like to add functionality to create a log of services that could be used when users go to sell there vehicle.

Built With

Share this project: