witnessmenow / arduino-ifttt-maker

Arduino library for raising IFTTT maker service trigger
GNU General Public License v2.0
82 stars 18 forks source link

How to pass Values to the IFTT recipe #4

Open AlexLPD opened 6 years ago

AlexLPD commented 6 years ago

Hi, thanks for the library, It already sends the alert mail as intent, I can see how to pass some data?

In this case my temperature reading, lets say I want to send a higger than normal value I can trigger the event, yet how to send the actual temperature to the recipe?

Thanks a lot. -Alex.

witnessmenow commented 6 years ago

Hi @AlexLPD

the trigger even method requires the event name but then optionaly you can pass up to 3 strings of data to send to the recipe

ifttt.triggerEvent(EVENT_NAME, "data1", "data2", "data3"));

Some details on how to use the additional data points in your recipe can be found here

https://www.youtube.com/watch?v=yFiKDabYJ1I&t=1m12s

AlexLPD commented 6 years ago

Hi, and thanks for you fast response, In deed I saw on the description of the library.

So I will send "data1", but how the IFTT read it? I have to assing a value as the "ingridients"?

IFTT: Ingridients > high_temp

ESP8266 If( temp > 30) send.IFFTT().

sendIFTTT(){ high_temperature = float to string (temperature)

ifttt.triggerEvent(EVENT_NAME, "high_temperature"); ???

Somethingh like this? Thanks a lot.

-Alex.

witnessmenow commented 6 years ago

In that case it would he highTemperature without quotes.

That videos shows me using it , its something like {{data1}} or something

On 7 Mar 2018 7:41 pm, "AlexLPD" notifications@github.com wrote:

Hi, and thanks for you fast response, In deed I saw on the description of the library.

So I will send "data1", but how the IFTT read it? I have to assing a value as the "ingridients"?

IFTT: Ingridients > high_temp

ESP8266 If( temp > 30) send.IFFTT().

sendIFTTT(){ high_temperature = float to string (temperature)

ifttt.triggerEvent(EVENT_NAME, "high_temperature"); ???

Somethingh like this? Thanks a lot.

-Alex.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/witnessmenow/arduino-ifttt-maker/issues/4#issuecomment-371259666, or mute the thread https://github.com/notifications/unsubscribe-auth/ABfXwg7-6GHdbs1sZL0eljI1DIDCxZ-jks5tcDfwgaJpZM4SeGjl .

AlexLPD commented 6 years ago

Im sorry Brian, I went to your video several times and watched and I cant relate the idea. Also I search for a more in deep example on the youtube channel and I can find anything.

I went to my code and convert the float T in to string and is ready to go, still dont have any clue how to send it in the e-mail.

I tried this:

`//triggerEvent takes an Event Name and then you can optional pass in up to 3 extra Strings
//buffer is a string with the converted float

if(ifttt.triggerEvent(EVENT_NAME, ssid, {{value1 : buffer}}))
     {
        Serial.println("Email, send correctly ");
     }
     else
        {
          Serial.println("Email failed !!!");
        }`

But it just tell me "E mail failed". 

I guees the data, cant be passed. and therefore is not sendig the data.

Is there an concrete example on this? Thanks a lot.

-Alex.

loransAlabood commented 6 years ago

Hi Folks,

I know this might not be the place to ask this question but anyone here has an idea how to receive info from IFTTT devices such as IFTTT motion sensors or IFTTT lights?

jellewie commented 4 years ago

does this help @AlexLPD

jellewie commented 4 years ago

does this help @AlexLPD ? `String EVENT_NAME = "Test"; //This is the text you have put in the text box {event} (at the maker_webhooks) String value1 = "The text in value1"; //Text to send to IFTTT int SomeValue = 12; String value2 = String(SomeValue); //Convert a int to a string, and pass this to IFTTT

if (ifttt.triggerEvent(EVENT_NAME, value1, value2)) {//triggerEvent takes an Event Name and then you can optional pass in up to 3 extra Strings Serial.println("Successfully sent"); } else{ Serial.println("Failed!"); }`

in your case variable is called "high_temperature". To send the text high_temperature send "high_temperature" To send the variable (and thus value) of high_temperature send high_temperature

you seem to want the value to be send to IFTTT, so use that.

For now

1) I think adding 'ifttt.triggerEvent(EVENT_NAME, "data1", "data2", "data3"));' to the docs/readme would be nice. I missed it to. 2) I think this ticket can be closed, and @AlexLPD has it's answer

jellewie commented 4 years ago

Hi Folks,

I know this might not be the place to ask this question but anyone here has an idea how to receive info from IFTTT devices such as IFTTT motion sensors or IFTTT lights?

They probably use proprietary stuff. So you can only use them from IFTTT. Create an event in IFTTT that does a web request back to your ESP, and use that as input. although this has quite a big delay in my opinion.