Receive Pushed Events for Devices

Hi, @David_Valencia
Did you create a subscription to such events?

In this tutorial, you can see how you can subscribe to a single device’s contactSensor event (open/close sensor) but there are other types of subscriptions as mentioned in the documentation posted by Bruce above.
In the Core-SDK you can see the functions you can call from the SmartApp SDK to create them: smartthings-core-sdk/src/endpoint/subscriptions.ts at main · SmartThingsCommunity/smartthings-core-sdk · GitHub

To validate which subscriptions were created by your SmartApp (and their configuration), you can call the endpoint https://api.smartthings.com/v1/installedapps/{installedAppId}/subscriptions using the installedAppId that you can see in the logs of your SmartApp. Also, the token for the request’s authorization can be the current one of the SmartApp (included in the logs) or your Personal Access Token.

Remember there’s a limit of 20 subscriptions per installed app so, if you want to receive the notification of events of more than 20 devices for the same capability, you can use a capability subscription instead.

2 Likes