Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Bernard Golden
Published © MIT

Dash IoT Button Tutorial

This tutorial extends Drew Alden's project with modified Lambda code to address errors that began showing up while running Drew's code.

IntermediateProtip1 hour4,409
Dash IoT Button Tutorial

Things used in this project

Hardware components

AWS IoT Button
Amazon Web Services AWS IoT Button
×1

Software apps and online services

AWS Lambda
Amazon Web Services AWS Lambda

Story

Read more

Code

AWS IoT Lambda Code

snippets
This code is copied into your Lambda function
var https = require('https');

var IFTTTkey = "jD6ITdNn7bgYQc_4A6raLzGZ-lY-D3OnDhJYqdn-WjR";


//this is called when the AWS Button is pressed and event data is passed as well
exports.handler = function(event, context) {
    console.log("Received AWS Button event: " + event.clickType + ". Firing IFTTT Maker Trigger...");
    var request = https.get('https://maker.ifttt.com/trigger/' + 'AWS-'+ event.clickType + '/with/key/' + IFTTTkey, function(response){
        console.log(response);
        
    })

};

Credits

Bernard Golden
1 project • 4 followers
Cloud and hacking
Contact

Comments

Please log in or sign up to comment.