Display the list which sends notifications to user


(Sony Rao) #1


I’m creating an app that sends texts to phone numbers the user enters in the preferences stage. Currently my app is only able to add to the “phone” list, I want to create a page where the user can see the numbers they have entered and have a check box next to each number to include or not include it at the time.

Here is what I have so far:
preferences {

page(name: "phone number", title: "Notify Contacts", install:false, uninstall:false, nextPage:"Motion"){
    section("Send Notifications?") {
       input ("phone", "phone", title: "Warn with text message", description: "Phone Number", multiple: true, required: false)
       log.debug "phone number was taken"
page(name:"Motion", title: "Where to Monitor", uninstall: true, install: true){
    	input "sensors", "capability.motionSensor", required: true, title: "Which Room?", multiple: true


def motionSensorHandler(evt) {
log.debug "recipients configured: $recipients"
def message = "Movement was detected in the ${sensors.displayName}!"
sendSms(phone, message)

Any help is much appreciated! Thanks!