Newbie question - Metadata


#1

Thanks for all the posters here and int he other parts of the forum.

I was able to get my hub and 8 eco links, smart sensor and fortress alarm up and running in about 15 minutes. Very happy

Now, the wife asked why only I get SMS’s and not her. I shrugged.
Then I say this

Which led me to missing MetaDatam and back to the smart things custom apps which I know nothing about except the FAQ.

Is there a walk through on how to add the information I need for this app?


(Ron S) #2

Custom app is the solution…

Check the documentation and if you are new to groovy, check this basic example:

http://docs.smartthings.com/en/latest/smartapp-developers-guide/example-bon-voyage.html

Basic snippet…
blah…blah…

   preferences {
    	section( "Notifications" ) {
    		input "pushbullets", "device.pushbullet", title: "Pushbullet Device(s)", multiple: true, required: false
    		input "sendPushMessage", "enum", title: "Send a push notification?", metadata:[values:["Yes","No"]], required:false
    		input "phone", "phone", title: "Enter Phone#?", required: false
    		input "phone1", "phone", title: "Enter Second Phone#?", required: false
    	}
    }
def notifyUser(msg){
	if (phone){
	  sendSms( phone, msg );
	}
	if (phone1){
	  sendSms( phone1, msg );
	} 
	if (sendPushMessage != "No") {
		sendPush( msg );
	}	
	def title = "Home Mode Manager: ${app.label}"
    pushbullets.each() {it ->
        it.push(title, msg)
    }
	log.debug (msg);
}

#3

Oh boy. What did I get myself into here.

I’ll have to give the basic example a read before your code. Although I understand the storing of responses in variables and using those in the main code, i’ve got a lot of work to do.

I should have just told the wife it can’t be done :slight_smile:


(Ron S) #4

Most of the wives, girlfriends, boyfriends, husbands, partners etc. hate receiving these texts. Shouldn’t you be counting yourself to be lucky that she wants these notifications? :wink:


(Keith Croshaw) #5

If you know a programming language it’s easy and addictive. The simulator in the IDE helps a lot.