Allright, everything’s starting up.
But there’s one more problem. When starting up the interface tells us nothing is configured yet. Luckily this can easily be helped.
Open a terminal and navigate to the location of the “Smartmirrorproject”, and change directory to the “config” folder.
copy the sample file to a regular file using
cp config.js.sample config.js
list the contents of the directory, and you see there’s now a file called config.js.
let’s see the contents. Navigate to the file in atom and click it.
You can see that it’s actually a json file.
Every object (between curly braces) in the “modules” property is a module configured to appear on the mirror. There are a lot of defaults activated. I would like to start by adjusting the weather modules (current weather and forecast).
This module connects through the API of open weather map : http://www.openweathermap.org
You can see that the AppID en LocationID properties are not filled in. We need to do that in order to get the weather for the appropriate location.
First things first : go to the website of open weather map, and register yourself. Fill in the necessary details, and you’ll automatically get a key for the “free” plan. A plan that lets you query the service for a maximum of 60 times per minute. That’s every second… should do, right?
So, now we have the AppID. What about the location?
The API can get the weather for a whole lot of locations in the world. I live in the town of Oudenaarde, Belgium. A god forsaken place with 2 streets and a saloon so to speak. Still, it’s in the list that can be found at this location :
Find the city you want, and copy out the LocationID.
Now, adjust config.js so it looks like this :
Notice how I entered the locationID and AppId.
The service from open weather map, might take a few minutes to start serving you the weather. Just try and save the config.js file, and run the mirror app again.
Tah dah :
Good luck with that!