MMM-IFTTT - If-This-Then-That Maker Notifications



  • This is my first module so don’t expect too much :p

    This enables realtime notifications from IFTTT to your MagicMirror install, via a JSON POST endpoint of the mirror. Full instructions in the project:

    github/jc21/MMM-IFTTT

    Technically, this module could be used for any webhook service such as Zapier too.



  • @jc21 Hi, I a fan of IFTTT and I trying to include your module on my project.

    The process isn’t working very well :-), and I decided to seek some help here.

    The problem, after installing the module like you prescribed, is that I can’t connect to the Pi (with MM) on port 8080.

    I tried, for testing purposes, the following commands on the terminal of the Pi itself:

    curl -X POST -H "Content-Type: application/json" -d '{"message": "Your pizza is ready!"}' "http://192.168.1.103:8080/IFTTT"

    or

    curl -X POST -H "Content-Type: application/json" -d '{"message": "Your pizza is ready!"}' "http://127.0.0.1:8080/IFTTT"

    with the same result:

    curl: (7) Failed to connect to 192.168.1.103 port 8080: Connection refused
    

    Trying from another ip (local or external) gives the same error.

    Am I forgetting something?


    Note from admin: Please use Markdown on code snippets for easier reading!



  • When you are running MagicMirror do you see these lines in the console output?

    All module helpers loaded.
    Starting server op port 8080 ...
    Server started ...
    


  • @jc21 I made an update to the Git modules, and now I getting those lines on my console. Everything is working 100%, thanks :-).



  • Update: Added support for my new MMM-Sounds module. Notification integration instructions are in the updated MMM-IFTTT readme.


  • Module Developer

    Great idea but am clueless on how IFTTT works… your example looks like a facebook notification which is pretty cool… but as far as getting that to work… LOL



  • Hi, since last update of MMM-IFTTT I am getting this error, when I make a notification to the MM:

    TypeError: Cannot read property 'debug' of undefined<br />    at Class.log (/home/pi/MagicMirror/modules/MMM-IFTTT/node_helper.js:116:54)<br />    at expressApp.post (/home/pi/MagicMirror/modules/MMM-IFTTT/node_helper.js:57:18)<br />    at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)<br />    at next (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:131:13)<br />    at Route.dispatch (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:112:3)<br />    at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)<br />    at /home/pi/MagicMirror/node_modules/express/lib/router/index.js:277:22<br />    at Function.process_params (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:330:12)<br />    at next (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:271:10)<br />    at urlencodedParser (/home/pi/MagicMirror/modules/MMM-IFTTT/node_modules/body-parser/lib/types/urlencoded.js:82:7)
    

    I already installed everything from the beginning twice, and updated all but without luck. Any ideias?


    Note from admin: Please use Markdown on code snippets for easier reading!



  • @paulocarrasco That was my bad. The module has been fixed now, do a git pull inside the module dir.



  • @jc21 Thanks for your quick reply. As you mentioned I made a ‘pull’ of MMM-IFTTT new version. Unfortunately It still giving the same error for me. All te rest appears that is working. Also the server is listening fine on port 8080.

    For testing purposes I have this minimalistic config.js

    ´´´
    //* Magic Mirror Config Sample

    var config = {
    port: 8080,

    language: 'en',
    timeFormat: 24,
    units: 'metric',
    
    modules: [
    	{
    		module: 'alert',
    	},
    
    	{
    		module: 'clock',
    		position: 'top_left'
    	},
    
    	{
      module: 'MMM-PIR-Sensor',
    		config: {
    	        		sensorGpio: 4,// See 'Configuration options' for more information.
    			      }
    	},
    
    	{
    	  module: 'MMM-IFTTT',
    	  position: 'lower_third',
    	  config: {
    						}
    	},
    ]
    

    };

    /*************** DO NOT EDIT THE LINE BELOW ***************/
    if (typeof module !== ‘undefined’) {module.exports = config;}

    ´´´

    This is the command I enter, followed by the error:

    ´´´
    MBP:~ paulocarrasco$ curl -X POST -H “Content-Type: application/json” -d ‘{“message”: “Your pizza is ready!”}’ “http://192.168.1.69:8080/IFTTT

    TypeError: Cannot read property ‘debug’ of undefined
       at Class.log (/home/pi/MagicMirror/modules/MMM-IFTTT/node_helper.js:116:54)
       at expressApp.post (/home/pi/MagicMirror/modules/MMM-IFTTT/node_helper.js:57:18)
       at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)
       at next (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:131:13)
       at Route.dispatch (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:112:3)
       at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)
       at /home/pi/MagicMirror/node_modules/express/lib/router/index.js:277:22
       at Function.process_params (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:330:12)
       at next (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:271:10)
       at urlencodedParser (/home/pi/MagicMirror/modules/MMM-IFTTT/node_modules/body-parser/lib/types/urlencoded.js:82:7)

    ´´´

    I hope this helps finding the error, because as I am a IFTTT fan your IFTTT module has main importance for me ;-).



  • @paulocarrasco Pull again now.

    Made the noob mistake of not testing, I wasn’t near my mirror at the time. All good now.


Log in to reply
 

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.