MagicMirror Module for IFTTT Maker Web Based Notifications
This module is intended to display immediate notifications of events from If-This-Then-That channels. Notifications will show for a default of 60 seconds before disappearing. There is no on-screen history of events.
Clone the module and npm install:
cd ~/MagicMirror/modules
git clone https://github.com/jc21/MMM-IFTTT.git
cd MMM-IFTTT
npm install
Add the module config to ~/MagicMirror/config/config.js
modules: [
{
module: 'MMM-IFTTT',
position: 'lower_third',
config: {
}
}
]
Option | Type | Default | Description |
---|---|---|---|
displaySeconds |
Integer | 60 |
Number of seconds to show a notification for |
fadeSpeed |
Integer | 3000 |
Milliseconds fade transition speed |
size |
String | large |
Text size, options are: small, medium, large, xlarge |
For this module to work, you will need to get dirty with your router, specifically with Port Forwarding.
I'm not going to go into detail here, there are plenty of Google results on the topic.
You will need to forward any port you nominate, to the local IP of your Magic Mirror on port 8080.
You will also need to set up a dynamic DNS hostname for your home network, I'm a Duckdns fan personally. Atlernatively you could look into a http forward solution like ngrok.
Log in to IFTTT and create a new recipe. You can essentially choose any channel you want for the Trigger but for the Action channel you must select Maker.
There is only one Action, "Make a web request".
Action fields explained:
Field | Description | Example |
---|---|---|
URL | Notification endpoint | http://yourhouse.duckdns.org:8080/IFTTT |
Method | HTTP Method, MUST be POST | POST |
Content Type | How the data is sent | application/json |
Body | The notification content, explained below |
|
The notification body JSON MUST contain the message
item. If it doesn't, the endpoint will return a 400 error.
All of the configuration options can also be passed with the JSON, which will override the config for
that recipe only.
The <<<{{From}}>>>
in the example above is a IFTTT wildcard field that you select in the Body section
of the action. You can create any message you like that incorporates any wildcard. Stay away from fields that may
contain HTML or links, they won't display well. These fields should be surrounded in <<<
and >>>
strings in
order for the field to be escaped properly.
This module will send out notifications to other supported modules, if those options are included in the notification JSON. The supported modules are:
IFTTT Module will automatically tell the Pir Sensor module to wakeup the monitor when a notification is received. No addition setup is required.
This additional module can display light sequences using a LED strip. An example of a notification that includes PiLights sequence:
{
"message": "<<<{{From}}>>> tagged you in a Photo",
"displaySeconds": 45,
"size": "large",
"pilights": "blue-pulse"
}
Or with iterations:
{
"message": "<<<{{From}}>>> tagged you in a Photo",
"displaySeconds": 45,
"size": "large",
"pilights": {
"sequence": "blue-pulse",
"iterations": 2
}
}
This additional module can play audio sounds if your mirror supports it. An example of a notification that would play a Sound:
{
"message": "<<<{{From}}>>> tagged you in a Photo",
"displaySeconds": 45,
"size": "large",
"sound": "wobble.wav"
}
Or with a delay:
{
"message": "<<<{{From}}>>> tagged you in a Photo",
"displaySeconds": 45,
"size": "large",
"sound": {
"sound": "wobble.wav",
"delay": 1000
}
}
You may want to use the delay approach to manually align the sound you're using with the light sequence, or to time the wakeup of the screen as well.
curl -X POST -H "Content-Type: application/json" \
-d '{"message": "Your pizza is ready!"}' \
"http://yourhouse.duckdns.org:8080/IFTTT"