MMM-RemoteCompliments is a module for the open source MagicMirror² platform.
MMM-RemoteCompliments provides seamless integration with Google Drive™ to display compliments and images from Drive on the MagicMirror² interface.
A full demo of the module can be found at: https://www.youtube.com/watch?v=cEcp47C1jPw
- Navigate to the MagicMirror/modules directory.
- Enter
git clone https://github.com/mitchelltmarino/MMM-RemoteCompliments.git
- Follow the setup instructions located in the Drive directory.
- Restart MagicMirror.
To use this module, add the following configuration block to the modules array in the config/config.js
file:
var config = {
modules: [
{
module: "MMM-RemoteCompliments",
header: "MMM-RemoteCompliments",
config: {
// See below for configurable options
}
}
]
}
The following properties can be configured in the config/config.js
file:
Option | Description |
---|---|
header |
The default header of the module. A value is required to enable changing of the header from Google Drive. This value is REQUIRED to enable changing of the header value via Google Drive. Type: String Default Value: "MMM-RemoteCompliments" |
fadeSpeed |
The speed of the update animation. (Milliseconds) Type: int Possible Values: 0 - 5000 Default Value: 4000 (4 seconds) |
fetchInterval |
The interval at which fetches from Google Drive should occur. (Milliseconds) Type: int Possible Values: 0 - 5000 Default Value: 4000 (4 seconds) |
The majority of configurations for MMM-RemoteCompliments done via Google Drive, in the configuration
spreadsheet. This way the module configurations can be easily modified at any time, without a direct connection to the mirror.
The configurations options available are broken down by sections. The default value is used if the value is invalid or left empty.
Function | Description |
---|---|
Scheduled Compliments |
Whether to display scheduled compliments. Type: Boolean Possible Values: true or false Default Value: false |
Current Compliments |
Whether to display current compliments. Type: Boolean Possible Values: true or false Default Value: false |
Random Compliments |
Whether to display random compliments. Type: Boolean Possible Values: true or false Default Value: false |
Images |
Whether to display images. Type: Boolean Possible Values: true or false Default Value: false |
Variable | Description |
---|---|
Morning Start Time |
The time in hours (24 hour format), after which the time of day is considered the morning. Type: int Possible Values: 0 - 24 Default Value: 3 |
Morning End Time |
The time in hours (24 hour format), after which the time of day is no longer considered the morning. Type: int Possible Values: 0 - 24 Default Value: 12 |
Afternoon Start Time |
The time in hours (24 hour format), after which the time of day is considered the afternoon. Type: int Possible Values: 0 - 24 Default Value: 12 |
Afternoon End Time |
The time in hours (24 hour format), after which the time of day is no longer considered the afternoon. Type: int Possible Values: 0 - 24 Default Value: 17 |
Variable | Description |
---|---|
Random Compliments |
The number of minutes and seconds after which the random compliment displayed should change. Type: int Possible Values: Any number greater than 0. Default Value: 30 minutes 0 seconds |
Images |
The number of minutes and seconds after which the image displayed should change. Type: int Possible Values: Any number greater than 0. Default Value: 0 minutes 30 seconds |
Variable | Description |
---|---|
Header Content |
The content of the module header. Type: String Default Value: "" |
Image Max Width |
The maximum width of the image displayed. (Pixels) Type: int Default Value: 500 |
Image Max Height |
The maximum height of the image displayed. (Pixels) Type: int Default Value: 500 |
Append Period |
Whether to append a period to the end of the compliment (if the compliment does not end with a symbol already). Type: Boolean Possible Values: true or false Default Value: false |
After the module is setup you will find a file hierarchy setup on your Google Drive like so:
Smart Mirror - Remote Compliments
└─── Scheduled Compliments
└─── Current Compliment
└─── Random Compliments
└─── Configuration
└─── images
Once the files are created on your Google Drive, you can rename them however you like, and move the files wherever you want. The modules keeps track of the files by using their unique file IDs. The following table gives a breakdown of each file and folder:
File / Folder Name | Description |
---|---|
Scheduled Compliment |
Type: Spreadsheet This spreadsheet allows for compliments to be scheduled to appear on certain dates, and between intervals of time with to-the-minute precision. Specify Start Date , Start Time , End Date , End Time and Compliment to have a compliment appear on the mirror between any given interval! Please visit scheduling compliments to learn more. |
Current Compliment |
Type: Document This document should contain current compliment to display on the mirror. The contents of this document will display on the mirror, if any content is present. |
Random Compliments |
Type: Document This document should contain a JSON representation of random compliments to display based on time of day, or current weather. Each attribute should be an array of strings. Check out the compliments module configuration for more information, as the MMM-RemoteCompliments implementation for random compliments was essentially built on top of that. Possible values for time of day: morning , afternoon , evening , and anytime . Possible values for current weather: day_sunny , day_cloudy , cloudy , cloudy_windy , showers , rain , thunderstorm , snow , fog , night_clear , night_cloudy , night_showers , night_rain , night_thunderstorm , night_snow , and night_alt_cloudy_windy . |
Configuration |
Type: Spreadsheet This spreadsheet contains many different configuration options for MMM-RemoteCompliments. The majority of configurations are done in this spreadsheet. Visit Google Drive configuration options to learn more about the contents of this spreadsheet. |
Images |
Type: Folder Any images present in this folder will appear on the mirror. If there is only one image, then that image will display statically on the mirror. If there is multiple images, however, the module will rotate through the images based on the update interval specified for images in the configuration file. |
Note that for compliments, there is a priority mechanism which chooses which type of compliment to display in the case that multiple compliment types are present. The priority is as follows:
- Scheduled Compliments > Current Compliment > Random Compliments
The scheduled compliments spreadsheet allows for compliments to appear between given date and time intervals.
Option | Description |
---|---|
Start Date |
The start date of the compliment. |
Start Time |
The start time of the compliment. |
End Date |
The end date of the compliment. |
End Time |
The end time of the compliment. |
Compliment |
The compliment to display. |
Compliments offers a generous amount of formatting and input options.
-
YYYY-MM-DD
- This is the ISO 8601 standard.
- Example: 1997-02-28
-
Month Day, Year
- Works for short form of month as well. (Example: Feb)
- Example: February 28, 1997
-
Month Day
- In this case, the module assumes the current year.
- Example: February 28 --> February 28, 2018 (Assuming 2018 is the current year)
-
HH:MM XM
- Examples:
- 5:30 AM
- 5:30 PM
- 10:00 AM
- 10:00 PM
- Examples:
-
HH:MM (Military Time)
- Examples:
- 8:00 (8:00 AM)
- 20:00 (8:00 PM)
- Examples:
-
If only
start date
is specified, the compliment will be displayed for that entire day. -
If only
start date
andstart time
are specified, the compliment will be displayed from thestart time
until 12:00 AM the next day. -
If only
start date
,start time
, andend time
are specified, the compliment will be displayed between the given time interval for that day.
Google Drive is a trademark of Google Inc. Use of this trademark is subject to Google Permissions.