Is it possible to call a phone number to trigger an action?


(sbe) #1

I would like to give someone a phone number to call and when they do something will happen. Can this be done?


(Convinced ST will never be unbroken…) #2

Anything can be done. In this case, the first thing I would think about would be a cheap Android phone running Tasker. Then set up a ‘phone ringing’ profile in Tasker that calls a SmartThings endpoint URL.


#3

fortytwo offers a voice gateway that can receive voice calls and issue commands to a REST endpoint such as the Cloud Interface by @MichaelS


#4

In the US, it’s extremely easy to do with IFTTT. They give you a unique phone number to use, and any voicemail left at that phone number will trigger any other event you want from an IFTTT channel. And since ST has an IFTTT channel, done. No extra hardware needed.

If you want to make it more targeted, they also have a text channel where you can use a specific hashtag if you choose.

Before the echo came out, I used the text message method for voice control of SmartThings. I could tell my phone to send a text with a specific hashtag like “hey Siri tell House #Kitchen” ( House being the contact name I use for my IFT TT SMS number) and I had set up an IFTTT recipe that when I received #kitchen Then have SmartThings turn on my kitchen lights. It wasn’t natural language, everything had to be said in exactly the right format, but it worked quite well.

Lag for IFTTT varies from place to place, at my house it’s a pretty standard eight seconds for the text message method, which worked for my use cases.


(sbe) #5

Thanks.

I’m not in the US, and I’m looking for a solution without leaving voice message.

I know several places where I can call a number and it opens a gate for me if I’m on the list. I want to do something like that using IFTTT. I can take care of the limitations, but how do I trigger an IFTTT by incoming call?

I do have a some spare androids. I will install Tasker on one. But what does this mean: “calls a SmartThings endpoint URL”?


#6

I don’t think IFTTT outside the US has the phone channel, so I’m not sure you can do it there. You’ll need to get the details on one of the other options.


(Convinced ST will never be unbroken…) #7

You can set up any device in your SmartThings to be triggered ‘on’, ‘off’, or ‘toggled’ by a simple https URL that Tasker can send…

107.20.127.54/smartthings/exampleOauth.php


(Glen King) #8

I’m doing exactly that via Tasker. I have a music studio. Band members arrive at different times. If I’m in the studio playing, I won’t hear the doorbell. So I have them phone or sms-text my google hangouts number when they have parked. Tasker intercepts the notification using the AutoNotifiction plugin and, via Sharptools, turns on the front door light AND sets off a strobe in the studio. It could easily unlock the front door for them too if I wish.

EDIT: Tasker can get very specific in its contexts, or can be general. In the above scenario, it only does those things if the texts/calls come from specific cell #s… and only on a specific day, within a specific time range.


(Chris Fichter) #9

You could set up a smart tile specifically for contractors or whomever. For an example just have one tile say open garage door and send them the link. And then when they’re done you can go into the settings and revoke it.


(sbe) #10

Thanks very much for the information.

I was able to set up the android and install Tasker.

However, the url example only allows me to turn on and off devices.
It doesn’t allow me to unlock locks or activate a routine via url.
Is there a way to do that?


(Convinced ST will never be unbroken…) #11

Yes. Set up a virtual switch, use the URL to trigger it. Assign a smartapp to the virtual switch that does what you want when the switch is turned on. You can use the momentary tile device type for your virtual switch.


(sbe) #12

I was able to create a momentary button tile virtual switch and access it via url.
I don’t know how to attach it to a routine?


(Convinced ST will never be unbroken…) #13

Here you go…

/**
 *  Routine Execute Button
 *
 *  Copyright 2016 Scottin Pollock
 *
 *
 */
 
definition(
    name: "Routine Execute Button",
    namespace: "scottinpollock",
    author: "Scottin Pollock",
    description: "Execute Routine via Virtual Momentary Tile.",
    category: "My Apps",
    iconUrl: "http://solutionsetcetera.com/stuff/STIcons/SiP.png",
    iconX2Url: "http://solutionsetcetera.com/stuff/STIcons/SiP@2x.png")

preferences {
    page(name: "configure")
}

def configure() {
    dynamicPage(name: "configure", title: "Configure Switch and Routine", install: true, uninstall: true) {
        section("Select your switch") {
            input "theswitch", "capability.switch",required: true
        }

        def actions = location.helloHome?.getPhrases()*.label
        if (actions) {
        	actions.sort()
            section("Routines") {
                log.trace actions
                input "onAction", "enum", title: "Routine to execute when turned on", options: actions, required: true
            }
        }
    }
}

def installed() {
    log.debug "Installed with settings: ${settings}"
    initialize()
}

def updated() {
    log.debug "Updated with settings: ${settings}"
    unsubscribe()
    initialize()
}

def initialize() {
    subscribe(theswitch, "switch.on", onHandler, [filterEvents: false])
}

def onHandler(evt) {
	location.helloHome?.execute(settings.onAction)
}

(sbe) #14

Sorry, still not getting it.
I upload this code via desktop as a smartapp? or device handler? I tried both and couldn’t figure out how to make it work.


(Convinced ST will never be unbroken…) #15

What I posted above is a SmartApp that executes a routine when a momentary button is turned on. Did you install it to the momentary button and configure it?

I just tested it here and it works fine.


(sbe) #16

OK, I was able to configure the smartapp from the simulator screen on the right of the desktop. Now I will try to tie it together with the tasker.


(sbe) #17

In Tasker, I was able to find the incoming call trigger, but not the access url action.

– Found it


(sbe) #18

It’s all working, thank you very much.

I call the number and the routine is executed.


(sbe) #19

Now I’m trying to limit it to a given time window.
How can I do that?


(Convinced ST will never be unbroken…) #20

Set up another Tasker profile, based on time, to turn on/off the ring listening profile.