Changing Message Text


(T Usere) #1

I’m not really a programmer, so forgive me if these questions seem simple, but I couldn’t figure them out.

I would like to change the “Notify Me When” app so that it will tell me which of my multis caused the alert.

I thought I did it by changing the sendPush to sendPush(evt.name + evt.value), but evt.name calls every multi  “contact” instead of the actual name. Contact.name doesn’t work either.

I also couldn’t figure out how to put a space in between the 2…+ " " + didn’t work

Lastly (for now), is there a way to rename the virtual contact? I thought it was working because the virtual contact was called contact, but then realized it wasn’t when they all showed up that way.

Thanks.

 

 


(Bob Florian) #2

You can send a message including the device name with something like:

sendPush( “$evt.linkText is now $evt.value”)

There is no way to explicitly name the virtual contact, but its name is derived from the preferences variable name, so if you change the preference:

input “contact”, “capability.contactSensor”, title: “Contact Opens”, required: false, multiple: true

to:

input “myContacts”, “capability.contactSensor”, title: “Contact Opens”, required: false, multiple: true

Then the virtual contact sensor name will be “myContacts”

 


(T Usere) #3

Thanks. Hopefully that will work - though it took me some time to realize that when I copied and pasted, the quotes pasted as curly quotes and were causing an error.

Unfortunately (for this purpose), I am using SmartThings at a second home so I now just have to wait until one of the doors opens. Luckily, someone is supposed to do some work in the house today and will be opening/closing the doors.

As I said, I have very little programming experience, but how would one know that linkText is a valid input? I don’t see any examples of it in the documentation and don’t see any library of the potential choices.


(T Usere) #4

Looks like it worked!  Thanks again.


(Bob Florian) #5

You’re welcome!  And you are correct in that the Event object properties are not currently documented. We’ll correct that.