aws-lambdaiotalexa-skills-kitiftttamazon-echo

Create a toggle between two actions in IFTTT


I have a simple device (Nordic Thingy 52) with a push button which can trigger the Maker Webhooks service in order to pass an event (button_press), which I am currently using to then trigger the Smart Life service's "Turn Off" or "Turn On" action.

The problem is that, since I can only pass the one event (button_press), I have to choose whether that event triggers either "Turn Off" or "Turn On". But what I want is to add some logic to say, "If the previous request was to turn off the Smart Life device, make the next one turn on the smart life device."

Wasn't sure how to do this. An AWS Lambda function? Chaining some other preexisting service? A filter that utilizes local storage or somehow handles state logic?

Any pointers for where to start searching would be appreciated.

enter image description here


Solution

  • I figured out a way to do this with a service called apilio.

    Process:

    Head to apilio.io and register for an account.