Configure the smart-mirror

The smart-mirror relies on a configuration file to determine what data to display.

You'll need to create a config.js file in the root of your smart-mirror directory. Also in this directory is a configuration template called config.example.js. Copy the template and save it as config.js.

cp config.example.js config.js

Then fill out config.js. See below for links to get service keys and example values for config properties. You will have to obtain keys for Forcast.io, YouTube, SoundCloud. If you're using Fitbit you'll need a key for that as well. If you're using Hue Lights with this project you'll need to know the IP address of your Hue Hub and a username. Typically this is one of the areas things go awry. Please go through this slowly, and thoroughly. Please make sure there are commas between each section. Any issues or questions please join us on gitter chat.

It is required that you train your own personal model for the keyword. By training your own model, you increase the samples available so a universal model can be created. Also, this solves many of the issues where the keyword is not detected.

Index

Language

The following languages are fully supported:

  • "en-US" - English
  • "de-DE" - German
  • "es-ES" - Spanish
  • "fr-FR" - French
  • "ko-KO" - Korean

Specific locals can also be specified, for instance "es-AR" or "es-BO". For more details about supported speech detection languages see this StackOverflow post.

Speech

The speech config object has the following properties:

  • projectId - The project ID from your Cloud Platform Project
  • keyFilename - The location of your JSON keyfile for
  • keyword - The text of the keyword that you are using to trigger the mirror. This should be "Smart Mirror". Additional Keywords can be entered by creating an array for example ["Smart Mirror", "Snowboy"]. If you specify multiple keywords you MUST specify multiple models.
  • model - The filename for your model (should not include spaces). Additional models can be entered by creating an array for example ["smart_mirror.pmdl", "snowboy.pmdl"]. If you specify multiple models you MUST specify multiple Keywords.
  • sensitivity - Sensitivity for the keyword spotter. If you are getting too many false positives or are having trouble detecting you can change this value.

Layout

You can set these values to be "main" (recommended) or "icesnow".

Greeting

greeting can either be an array of greetings to randomly select from OR it can be an object that specifies multiple arrays to choose from based on the time of day.

Disable Greeting

You can disable the greeting by setting it to an array with an empty string:

greeting: [""]
Randomly Selected Greeting
greeting : ["Hi, sexy!", "Hey There!", "Looking Awesome!"]
Randomly Selected Greeting Based On The Time Of Day
greeting : {
    night:    ["Goodnight", "Time to sleep"],
    morning:  ["Good Morning"],
    midday:   ["Good Afternoon"],
    evening:  ["Good evening"]
}

Forecast

You'll need a forecast.io developer key, which you can obtain from: https://developer.forecast.io

After Creating an account you can find your key at the bottom of the page. In your config it should look something like this:

forecast : {
    key : "vy2u1t34bo123bu41234yduv1234tb", // Your forecast.io api key
    units : "auto" // See forecast.io documentation if you are getting the wrong units
}

It should be ok to leave the units set as auto because the units that are used are determined by your location. If you would like to use other units you can look the forecast.io documentation for more info.

Geolocation

This is an optional setting and is only for people who are having issues with the smart-mirror's built in geolocation. You can override your latitude and longitude by specifying the following:

geoPosition: {
    latitude: 78.23423423,
    longitude: 13.123124142
}

Hue

You'll need two things to set up your Philips Hue configuration, an ip and a username. You can find the instructions for this on the Philips Hue Documentation site in the Getting Started section (unfortunately you need to create an account to view this info).

Optionally you can create groups (using the API for Philips Hue app) that you can control from the mirror by name. By default group 0 will control all the lights.

hue : {
    ip : "192.168.1.1",
    uername : "",
    groups : [{
        id : 0,
        name : "all"
    }, {
        id : 1,
        name : "bedroom"
    }, {
        id : 2,
        name : "kitchen"
    }]
}

Calendar

You can have the mirror display your iCal's from Google Calendar, Outlook, iCloud, and more by adding them to the icals array.

There are two other properties:

  • maxResults: Maximum number of upcoming calender events to display.
  • maxDays: Maximum number of days to look into the future when listing upcoming events.
calendar: {
    icals : ["https://calendar.google.com/calendar/ical/SOMESTUFF/basic.ics",
"https://outlook.office365.com/owa/calendar/SOMESTUFF/reachcalendar.ics"],
    maxResults: 9, 
    maxDays: 365 
}

Giphy

If you want to display gifs on your mirror you can do that too! In the Giphy Beta API the key is fixed:

giphy: {
    key : "dc6zaTOxFJmzC"
}

YouTube

You can find instructions for getting YouTube API Keys here: https://developers.google.com/youtube/v3/getting-started#before-you-start

youtube: {
    key : "vy2u1t34bo123bu41234yduv1234tb"
}

SoundCloud

SoundCloud API keys can be obtained from your app profile (this requires an account): http://soundcloud.com/you/apps

soundcloud: {
    key : "vy2u1t34bo123bu41234yduv1234tb"
}

Traffic

Using your key from the Bing Maps Portal you can specify an array of trips and a reload_interval (how often should the mirror refresh trip data, in minutes).

A trip has the following properties:

  • mode - Mode of transportation. One of
    • "Driving" - By Car
    • "Transit" - By public transportation
    • "Walking" - Walking
  • origin - The address for the start of your trip
  • destination - The address for the destination of your trip
  • name - Human readable name for the destination
traffic: {
  key : "9kjn22lk25h0qergp34v0u9n2352437823b76823498243245",
  reload_interval : 5,
  trips : [{
    mode : "Walking",
    origin : "56 Leamington Street, Sheffield, S10 1LW",
    destination : "Claremount Cres, Sheffield, S10 2TA",
    name : "uni"
  },
  {
    mode : "Transit",
    origin : "128 24th Ave E, Seattle",
    destination : "700 Bellevue Way NE, Bellevue",
    name : "work"
  },
  {
    mode : "Driving",
    origin : "138 24th Ave E, Seattle", 
    destination : "700 Bellevue Way NE, Bellevue",
    name : "work"
  }]
}

If any of your trips aren't showing up it's likely because Bing Maps can't find the address you specified. Using a full postal address should fix this issue.

Now that you've configured everything you're ready to run your Smart-Mirror for the first time.

Next Step: First Time Running Smart Mirror

results matching ""

    No results matching ""