Do I need 2 instances of webCoRE to use 2 different IFTTT accounts?


#1

I’ve got the need to use 2 different IFTTT accounts, 1 for myself and 1 for my wife. I need to split it up because I’d like to use SMS triggers from either of our phones and IFTTT won’t allow that on 1 account.
Questions; do I need to set up a separate instance of webCoRE in order to link up with a separate IFTTT account? Can both instances be running together? Any problems with both accounts trying to use the same devices? Can variables be shared or will I have to use a simulated switch of some kind?


Passing setup values from Smartthings app to WebCore
Set variable times from outside WebCore
#2

Maybe you don’t have to use 2 instances depending on what you’re trying to do? What does the SMS trigger do?


#3

It’s to program the coffee maker to run in the morning. I send an SMS to my IFTTT number with a time, that time gets passed to webcore via webhooks, and I use that $arg.time from the SMS message to tell my smart switch when to turn on tomorrow morning. Once it’s set, webcore sends back to IFTTT via webhooks again and IFTTT will respond to me via SMS that the coffee maker is set.
So,
IFTTT receives SMS, passes to webcore, sets time on smart switch, set variable “coffebotarmed=true”, passes back to IFTTT, responds to SMS

In practice it looks like:
Send SMS with the text “6:45”, wait 5 seconds, receive SMS that says “Coffeebot is set to run at 6:45 tomorrow morning”

I’d like for my wife’s phone to be able to do the same.


#4

Hmm so it’s ifttt is sending back info via SMS with confirmation. Why not just have the piston SMS you or the wife directly the armed confirmation.

The way I see it in my head. You have the webhook to call the webcore external url. The url will then have the time and the sender payload so it will know who to text back.

$args.time and $args.sender

http://externalurl/?time=645&sender=wife

If $args.sender == ‘wife’
send SMS confirmation to wife
If $args.sender == ‘robinogi’
send SMS confirmation to send

Something like that…


#5

That’s a good thought, actually! This might seem silly, but I was hoping to have the reply come from the same number I send it to, tidier that way. Good solution, though!


#6

Ya, that’s catch :grinning:


#7

Wait a sec; that sounds interesting but I don’t know how to set that up! I presume I’d make a separate IFTTT acct for my wife, and set up to send a webhooks call with those details. How would that look at IFTTT?


#8

Good question, I’m on phone at the moment and I’m no good at putting pistons together on small keyboard. Let me see if I can muck something together.


#9

I’m useless on the phone, screen caps are a pain. Yes, you’ll have to get account for the wife so she can trigger SMS. The only thing that will change in the webcall is the time because you can hard code the sender=wife part.


#10

I don’t get where I put the http://externalurl/?time=645&sender=wife part

The URL I put in the “Make a Web Request” section is the one that webCoRE tells me to use;
https://graph-na02-useast1.api.smartthings.com/....../ifttt/coffeebot

DO I append /?time=645&sender=wife to that? I want “time” to be determined by the message content.


#12

I keep trying but I can’t figure out how to send the “sender=wife” from IFTTT. It seems to me that it should send it if I put { "time" : "{{Message}}" , "sender" : "<<wife>>" } in the “body” section of the IFTTT applet. Help!


#13

Never mind! Got it! I don’t need the < or >, and I had an extra “$” in my “$args.$sender”. Changed it to “$args.sender” and all is well!


#14

Good deal you figured it out. Just got home.


#15

For posterity (and in case it can help someone else), here’s what I ended up with;


I ended up duplicating the IFTTT portion on a separate IFTTT account linked to my wife’s cell number, and replaced the “sender: robin” part with her name. Works great!


#16

UPDATE: made it more redundant (handles upper/lower case requests) as well as error handling.

This one was fun!


#17

All that is missing is a cool sound effect when there is an error…

https://www.youtube.com/watch?v=7qnd-hdmgfk (4 seconds)


#18

Ha ha. I’ll have to work on that!