Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
name: "SMS Tile",
namespace: "actiontiles",
author: "Thingterfaces LP",
description: "Send SMS when button is pressed.",
category: "Convenience",
iconUrl: "",
iconX2Url: "",
iconX3Url: "")
preferences {
section("When this momentary button is pressed...") {
input "button", "capability.momentary", title: "Which button?", required: true
section("Send SMS to...") {
input "message", "text", title: "Message (max 140 characters)", required: true
input "phone1", "phone", title: "Phone Number 1", required: false
input "phone2", "phone", title: "Phone Number 2", required: false
input "phone3", "phone", title: "Phone Number 3", required: false
input "phone4", "phone", title: "Phone Number 4", required: false
input "phone5", "phone", title: "Phone Number 5", required: false
def installed() {
log.debug "Installed with settings: ${settings}"
def updated() {
log.debug "Updated with settings: ${settings}"
def initialize() {
subscribe(app, pushHandler)
subscribe(button, "momentary.pushed", pushHandler)
def pushHandler(evt) {
(1..5).each{ n ->
def phone = settings["phone$n"]
if (phone) {
log.debug "Sending SMS to $phone"
sendSms(phone, message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.