Subscribe to Ring Doorbell button push?


(Rjison) #1

I want to subscribe to the Ring Doorbell being pushed. I’m not having any luck, I noticed that there could be more than one button with a “Button”, but I see no documentation on how to specify button 1. The Ring doorbell only has one button, and if it is pressed, I wanted to call ringDetectedHandler

Any help would be greatly appreciated.

subscribe(ringbutton, “button.pushed”, ringDetectedHandler)


(Martin Verbeek) #2

assuming that ringbutton has been selected as an input in the smartapp as the ring device and ringDetectedHandler is not a private function (common mistake by myself :-)) you can just specify “button” as the event. if you do evt.value is pushed, actually it will only be called when it is pushed …tested it, works fine…

subscribe(ringbutton, “button”, handlerPush)

void handlerPush(evt) {

    log.info evt.value   // == pushed

}

(Rjison) #3

Martin,

Thank you sir! I was trying to subscribe to button.pushed, but that never fired. When I use the test button, subscribing to “button” never fired either.

How did you know to subscribe to “button”? Is that documented anywhere? I’m finding programming SmartThings to be near impossible without asking for help.

Anyway, thank you very much. My program is now complete!


(Martin Verbeek) #4

you subscribe to a device capability, these are most of the time described in the documentation, but you can also look at the real device events in the IDE…


(Rjison) #5

That’s what I need, how do I look at the real device events in the IDE??


(Martin Verbeek) #6

Click on my devices and list events.


(Rjison) #7

Thank you, I didn’t think of looking there. :sunglasses: That’s a wealth of information!