Background
When I wake up in the morning I want to know three things. The weather, how much gas is in my car, and the time it takes to get to work.
I have an Amazon Echo so most of this information can be queried with my voice. But that requires three separate requests. I wanted this information to be glanceable.
I thought about buying an LED panel and connecting it to a Raspberry Pi. Luckily, a company named LaMetric created a connected clock that allows you to display information on an LED panel. So I ordered a LaMertic Time. Two days later it arrived (Thanks Amazon Prime!) and I began implementing my idea.

The Data
- The Automatic Pro is a device that connects to your car's computer. It can get all sorts of diagnostic information. Like gas! (Certain cars only)

So how do you get data from the Automatic? They provide a REST API.
https://api.automatic.com/vehicles/
{
"_metadata": {
"count": 1,
"next": null,
"previous": null
},
"results": [
{
....
"fuel_level_percent": 60.54,
"battery_voltage": 12.4,
"active_dtcs": [
{
"code": "B0078",
"created_at": "2015-09-29T23:55:46.123Z",
"description": "Third Row Right Seatbelt Pretensioner Deployment Control"
}
]
}
]
}2. Google Distance Matrix is an API that tells you how far it takes to get from point A to B. Like work and home.
https://developers.google.com/maps/documentation/distance-matrix/
https://maps.googleapis.com/maps/api/distancematrix/json?origins=75+9th+Ave+New+York,+NY&destinations=Bridgewater+Commons,+Commons+Way,+Bridgewater,+NJ|The+Mall+At+Short+Hills,+Morris+Turnpike,+Short+Hills,+NJ|Monmouth+Mall,+Eatontown,+NJ|Westfield+Garden+State+Plaza,+Garden+State+Plaza+Boulevard,+Paramus,+NJ|Newport+Centre+Mall,+Jersey+City,+NJ&departure_time=1541202457&traffic_model=best_guess&key=
{
"destination_addresses" : [
"Commons Way, Bridgewater, NJ 08807, USA",
"Morris Turnpike, Short Hills, NJ 07078, USA",
"Monmouth Mall, Eatontown, NJ 07724, USA",
"Garden State Plaza Blvd, Paramus, NJ 07652, USA",
"Newport Centre Mall, Jersey City, NJ 07302, USA"
],
"origin_addresses" : [ "75 Ninth Ave, New York, NY 10011, USA" ],
"rows" : [
{
"elements" : [
{
"distance" : {
"text" : "68.8 km",
"value" : 68781
},
"duration" : {
"text" : "56 mins",
"value" : 3334
},
"duration_in_traffic" : {
"text" : "1 hour 1 min",
"value" : 3687
},
"status" : "OK"
},
]
}
],
"status" : "OK"
}Now we need to do some pre work.
Pre work
- Create a developer account with Automatic and create an application.

2. Click the OAuth Authorize URL. Enter the information for the Automatic account connected to your car.

3. Grab the code from the URL after logging in

4. Run the following command with the code you just saved.
curl -X POST https://accounts.automatic.com/oauth/access_token \
-d "client_id=[YOUR_CLIENT_ID_SHOWN_IN_STEP_1]" \
-d "client_secret=[YOUR_CLIENT_SECRET_SHOWN_IN_STEP_1]" \
-d "code=[YOUR_CODE_FROM_STEP_3]" \
-d "grant_type=authorization_code"5. Save the access_token from the response
{"access_token": "PrBfQ1sp534wDaaU7tbBTVObqj83QUekVemnEsXs", "expires_in": 31535999, "scope": "scope:vehicle:events", "refresh_token": "3ddcc6ec0cb968a10fb235ecf90f534244d2b759", "token_type": "Bearer" }6. Get a distance matrix API key.
Now we have everything needed to run the code.
The Code
This part assumes you have a linux machine running NodeJS. The code is roughly 50 lines and is pretty simple. It creates a RESTFul endpoint using Express, that fetches data from the services discussed earlier and returns JSON.
Checking out the code:
git clone https://github.com/parisbutterfield/morning-info.git
cd morning-info/
npm installBefore running the service modify server.js and substitute the required information (api keys, tokens, addresses). Then run:
node server.jsThe host where you're running the code must be publicly accessible. Type in http://<hostname>/ and you should see something like this:

Creating the LaMetric App and Installing
LaMetric has a simple development interface for their clock. You provide a REST API that contains an array of frames to be displayed for your app. Each frame contains an image and text.





LaMetric's development process has a low barrier to entry. Coding this project from start to finish me took less than two hours. I have the code running on a Raspberry Pi 3. If you don't have an Automatic or want to see different data, fork my code and use it as a basis for your integration.