Forward action

I'm trying to use the forward action example script to do a http get request (for starting a Home assistant automation).

I have two buttons:

function handleBrainData(brainEvent) {

  console.log('Brain Action', brainEvent);

 

  if (brainEvent.action === 'launch' && brainEvent.recipe === 'Welterusten') {

    console.log(' >>> Welterusten ');

  }

 

  if (brainEvent.action === 'launch' && brainEvent.recipe === 'Goedemorgen') {

    console.log(' >>> Goedemorgen');

  }

}

Reply
1reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • I've found it;

     

    {
        var request = require("request");
        request("https://maker.ifttt.com/trigger/device_on/with/key/yourkey", function(error, response, body) {
          console.log(body);
    Reply Like
reply to topic
Like Follow