Connect Node-RED to IFTTT

1,377 views
Skip to first unread message

BhargavGV

unread,
Dec 26, 2017, 12:02:42 PM12/26/17
to Node-RED
Can someone explain how to connect IFTTT to Node-RED? I want to take a command sent from IFTTT and pass it to a shell script. I've tried using nginx (connected to Dataplicity), but that didn't work.

Mark Setrem

unread,
Dec 26, 2017, 12:24:44 PM12/26/17
to Node-RED
Take a look at https://flows.nodered.org there's lots of IFTTT flows listed

BhargavGV

unread,
Dec 26, 2017, 12:53:19 PM12/26/17
to Node-RED
I only found 7, and none of them are what I'm looking for (making IFTTT trigger Node-RED, not the other way around).

Julian Knight

unread,
Dec 26, 2017, 3:53:21 PM12/26/17
to Node-RED
You can trigger a Node-RED flow from an IFTTT webhook using the "Make a web request" action.

But to do that, you have to expose Node-RED to the Internet. If you plan to do that, you should understand the risks and how to mitigate the worst of them.

Personally, I find it a lot more secure and reliable to use a Telegram bot. You can still connect IFTTT to Telegram if you need to but comms between Telegram and Node-RED are reasonably secure without the need to do anything fancy.
Message has been deleted

BhargavGV

unread,
Dec 26, 2017, 6:09:28 PM12/26/17
to Node-RED
How do I do that? (using the Telegram bot)

David Caparrós

unread,
Dec 27, 2017, 9:33:12 AM12/27/17
to Node-RED
Hello Julian

I'm trying to do something similar, I had being success to create a bot and use this token on node red so when a command (text message) is received on the bot node red takes some action.
I have created and applet on IFTT to detect a message from google assitant and only option is to send a private message to IFTT bot.
The goal is to be able to send commands trough google assistant to node red, my attempt is using IFTT & telegram however I'm not able to find how to send the message from IFTT to my own bot so node red receive it.

Any advice?  I keep trying to see if I find the path...


Regards

BhargavGV

unread,
Dec 27, 2017, 10:42:27 AM12/27/17
to Node-RED
I'm trying to do the same thing. Which input node did you use?

David Caparrós

unread,
Dec 27, 2017, 11:25:41 AM12/27/17
to Node-RED
I'm using telegram receiver node however with IFTTT I'm only able to send the text message to a group or to a private chat with IFTTT bot now I don't know how to link this to node red.

I was able to create my own bot and receive the messages from this bot to node red now the trouble is to link IFTTT bot message to send it to my bot.......

I get crazy also trying to use google assitant to recognize the commands and discover it only works if I configure as a primary language english on my phone, otherwise IFTTT does not recognize nothing at all.

Let see if someone can give us a final clue to make it work....

Julian Knight

unread,
Dec 29, 2017, 6:17:33 AM12/29/17
to Node-RED
Probably the easiest way is to link your bot to a group and link the IFTTT bot to the same group. You should be able to get the IFTTT bot to send a msg that your Telegram bot can understand and forward to Node-RED. Not done this myself though.

I'm assuming the flow is:

Alexa -> IFTTT -> Telegram Group -> Telegram Bot -> Node-RED

BhargavGV

unread,
Dec 29, 2017, 10:13:38 AM12/29/17
to Node-RED

I haven't hooked up Telegram to IFTTT yet, but something isn't working. Also, my Bash script (which the last node runs) is supposed to log the command to a text file. However, the text file just says:

[object

Does anyone know how to fix either issue?

BhargavGV

unread,
Dec 29, 2017, 10:22:34 AM12/29/17
to Node-RED
By the way, I couldn't trigger the bot from a group.


On Friday, December 29, 2017 at 6:17:33 AM UTC-5, Julian Knight wrote:

Dave C-J

unread,
Dec 29, 2017, 10:45:49 AM12/29/17
to node...@googlegroups.com
Maybe use a file out node instead (or just a debug node)
--
Sent from phone.

BhargavGV

unread,
Dec 29, 2017, 10:51:56 AM12/29/17
to Node-RED
That might work for debugging purposes, but my end goal requires passing the command to the Bash script.

steve rickus

unread,
Dec 29, 2017, 11:24:20 AM12/29/17
to Node-RED
Without seeing the source of your bash script, I can only speculate... but it looks to me like the msg.payload is a javascript object (with content?), or maybe an array of objects. So when it gets serialized into a string and passed as an arg to your bash script, it looks like "[object"... try wiring in a debug node, show us the fully expanded object, and we can suggest ways to get the input you need for the script.
--
Steve

BhargavGV

unread,
Dec 29, 2017, 11:42:38 AM12/29/17
to Node-RED
The debug node says this:
"[object Object]"
I've also got a template node (that the debug node is connected to) that looks like this:

I think there might be more than one problem, because my Telegram sender node keeps saying: "msg.payload.content is empty"

Nick O'Leary

unread,
Dec 29, 2017, 1:11:15 PM12/29/17
to node...@googlegroups.com

Do not use the template node ahead of the debug node - that's what is rendering your object as the text [object]. Attach the debug node alongside the template node to see what the actual object is.


--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/fe3ba462-5f20-4c25-b882-49ec5ef98f1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

BhargavGV

unread,
Dec 29, 2017, 1:23:33 PM12/29/17
to Node-RED
Now the debug node works properly. I think I can delete the template node.

BhargavGV

unread,
Dec 29, 2017, 1:28:20 PM12/29/17
to Node-RED
I've realized the real problem with my flow. The Telegram command passes the text after the command (like on in /tv on), not the command itself. I wanted to pass the command into the Bash script, so I just need to make a separate flow for on and off and hard-code the exec node to run the command. I'll post a screenshot once I'm done with it.

BhargavGV

unread,
Dec 29, 2017, 1:37:29 PM12/29/17
to Node-RED

I got it working! I haven't done the off part yet, but it's almost identical to the on part.

David Caparrós

unread,
Dec 29, 2017, 3:11:38 PM12/29/17
to Node-RED
Hello BhargavGV,

How you finally did it? 

From IFTTT i was able to send a command but only to the IFTTT bot private channel or to a group conversation however from the node-red telegram module I was not able to capture this as was only working capturing the text received by my own telegram bot and not from a group conversation.

I see also the telegram node you use is different than the one I have tested, maybe you have a different one with more capabilities.

Regards

BhargavGV

unread,
Dec 29, 2017, 4:38:32 PM12/29/17
to Node-RED
By "I finally got it working", I meant I got the Telegram part working, but not the IFTTT part. I'm having the same problems as you with the whole "group" thing.

BhargavGV

unread,
Dec 29, 2017, 4:43:21 PM12/29/17
to Node-RED
I just realized that maybe I should use another Telegram command node with the command /on@<bot username>, so I tried that. It worked! So, the last thing I need to do is the IFTTT part.

Julian Knight

unread,
Dec 29, 2017, 4:50:09 PM12/29/17
to Node-RED
Yes, that's because your bot already "knows" what the command is. You can actually use commands without the command node as well which may give you closer to what you want.

BhargavGV

unread,
Dec 29, 2017, 4:53:14 PM12/29/17
to Node-RED
Like I already mentioned, I decided to make a flow for both on and off, instead of trying to pass the command.

BhargavGV

unread,
Dec 29, 2017, 4:54:50 PM12/29/17
to Node-RED
I'm using the Telegram command node, which listens for a specific command, unlike the receiver node you're using, which passes on every message sent to it.


On Friday, December 29, 2017 at 3:11:38 PM UTC-5, David Caparrós wrote:

BhargavGV

unread,
Dec 29, 2017, 4:56:01 PM12/29/17
to Node-RED
Correction: I meant subflow, not flow.

BhargavGV

unread,
Dec 29, 2017, 5:19:00 PM12/29/17
to Node-RED

Martin Houda

unread,
Jan 28, 2018, 6:07:16 PM1/28/18
to Node-RED
The real problem is that the Telegram (node-red)Bot dont see the messages from the IFTT bot :-/

Why doesn't my bot see messages from other bots?
Bots talking to each other could potentially get stuck in unwelcome loops. To avoid this, we decided that bots will not be able to see messages from other bots regardless of mode.


Dne úterý 26. prosince 2017 21:53:21 UTC+1 Julian Knight napsal(a):
Reply all
Reply to author
Forward
0 new messages