Get CPR certified in 30 minutes at CPR Test Center.
Echo & Alexa Forums

Direct IFTTT Integration

0 Members and 1 Guest are viewing this topic.

monty617

Direct IFTTT Integration
« on: August 18, 2015, 11:19:43 am »
EDIT - Initial post no longer relevant since the same can be accomplished much easier with SmartThings virtual switch.

-------------------------------------------------------------------

Hey guys, I had an idea for direct IFTTT integration rather than the cumbersome options Amazon provides. I noticed someone on Github (mefogle) had a similar idea so I made some customizations to allow direct voice commands sent to the IFTTT maker channel. This allows you to say something like "Alexa, tell my house to turn on the TV" or "Alexa, tell my house to turn on the lights" which would pass "turnonthetv" and "turnonthelights" to IFTTT Maker channel respectively which you can then pass to whatever channels you wanted.

I do still use the Hue Bridge for simple lighting commands as that flows better, but having the entire IFTTT channel library at your fingertips with simple commands is working out pretty well for everything else. All you have to do is plop the code in AWS Lambda or your own server and you're off to the races. I hope someone finds this useful.

Github Code:
https://github.com/monty617/AtoIFTTT

Thanks go out to mefogle @ Github for the initial code.
« Last Edit: August 25, 2015, 01:27:59 pm by monty617 »

sidynele

Re: Direct IFTTT Integration
« Reply #1 on: August 19, 2015, 09:09:36 am »
Hey monty617,

Thanks a lot for this! I am attempting to walk through your instructions on Github but I'm running into issues hosting the code out in Lambda. Are you using Lambda or are you running it from your own server?

Mine is erroring on this line:
Code: [Select]
       if (event.session.application.applicationId !== "YOUR_AMAZON_APP_ID_HERE") {
             context.fail("Invalid Application ID");
         }

Error response:
Code: [Select]
{
  "errorMessage": "Invalid Application ID"
}

Where do we find the Amazon app id? I don't see that listed in the instructions as a variable that has to be set as unique.

Thanks!

monty617

Re: Direct IFTTT Integration
« Reply #2 on: August 19, 2015, 09:30:43 am »
Sorry, the instructions assume some previous knowledge creating ASK skills. Did you get that error testing with Lambda or your Echo itself? You can find your app ID when you create the skill on Amazon's developer portal (https://developer.amazon.com/public/solutions/devices/echo). I would suggest looking through their documentation on setting up a skill as they run through it step-by-step.

https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit

Hope that helps.

sidynele

Re: Direct IFTTT Integration
« Reply #3 on: August 19, 2015, 01:04:18 pm »
Appreciate the links. Was simple enough to find the Application ID, I just glanced right over it initially. I was getting the error when testing through Lambda, now I'm getting the desired output when throwing the Alexa Start Session example at it.

monty617

Re: Direct IFTTT Integration
« Reply #4 on: August 19, 2015, 02:54:13 pm »
Glad to hear. Hope it works well for you.

monty617

Re: Direct IFTTT Integration
« Reply #5 on: August 25, 2015, 01:02:11 pm »
Well, looks like no real reason for this now. Amazon announced direct integration with SmartThings recently and even without a hub you can now tie a virtual switch directly to IFTTT. Can now use the native "turn on" Echo functions to launch anything on IFTTT.