Max number of "subscribedEventHandler"?

I made smartapps using SDKs to record the measured values by my sensors

the problem is that I noticed that some capabilites are not subscribed.
also, when the not-subscribed-capabilites are selected alone, they work well.

I reviewed my code and found that not-subscribed-capabilites are located in lower part of code.
So i doubted there is maximum allowed number of Handler(or Subscription) in smartapps.
for my case maximum number seems 7.

In document, it is written that “There can be multiple subscribed device event handlers in one app”
but may be there is a limitation in number.

Is anyone knows that limitation of event handler or subscription?
or any suggestion to fix this problem is needed.
Thank You !

my code is like below, with 19 subscribedEventHandler

    .updated(async ctx => {
      await ctx.api.subscriptions.delete()

      await ctx.api.subscriptions.subscribeToDevices(

      await ctx.api.subscriptions.subscribeToDevices(


    .subscribedEventHandler('batteryEventHandler', async (ctx, data) => {
      {my action}

    .subscribedEventHandler('signalEventHandler', async (ctx, data) => {
      {my action}

Welcome to the SmartThings Community, @hyungmin!
Here’s the info about Subscription limits in SmartApps:

It’s 20 subscriptions per installed app.

Can you describe what you mean by “not-subscribed-capabilites”?
There are other subscription types, for example, to avoid creating one per device, you can create a Capability subscription which would help you get the events of every device in your location that uses it.
In the API reference, you can see the scopes needed for each type of subscription, and this is the function in the Core SDK.

Also, you can check if the subscriptions were created by making a request to the API:{installedAppId}/subscriptions

Is there a specific reason for you to use await?
Using something like below should help you create the subscriptions correctly:

.updated(async (context, updateData) => {
        await context.api.subscriptions.unsubscribeAll();
        return Promise.all([
            context.api.subscriptions.subscribeToDevices(context.config.driver, 'switch', 'switch.on', 'onDeviceEventHandler'),
            context.api.subscriptions.subscribeToDevices(context.config.driver, 'switch', '', 'offDeviceEventHandler')

As an additional note, is this SmartApp for personal use? Remember that up to now, they cannot be published in the ST app catalog, each user would have to register it in their Developer Workspace.

I have a slightly similar use case and went for subscribing to capabilities rather than devices.

Might help?

Hi naylyz
thank you for answer and kind suggestions !

“not-subscribed-capabilites” was unclear words
that meant subscriptions those were unavailble due to limitation.

It is little confusing that we have both options that subscribes device or capability, :joy:
since “subscribeToDevices” also use capability as parameter rather than deviceId

by the way, capability subscription looks more extensive and useful for my case
I will try that way soon, and will fix the codes as your suggestion :smile:
Thank you !

Hi Davec.
thank you for sharing your experience :+1:
I should try that way !

Just as a reference, it takes both the device selected in the “page setting” and the capability name as parameters, for example:

 context.api.subscriptions.subscribeToDevices(context.config.light, 'switch', 'switch.on', 'onDeviceEventHandler')

//For the subscription to work we must have set a setting with the ID "light":

Then, this function gets the corresponding info from the config entry.

Thanks for all comment
I changed SmartApp code to use “subscribeToCapability”

For anyone who wanna try this,
you should remind that you need permission configuration to subscribe to capability.
otherwise SmarApp won’t make subscription and you will see 403 forbidden error when create subscription via API

my code is

    .appId(" {find at workspace} ")

    .updated(async ctx => {
      await ctx.api.subscriptions.unsubscribeAll();
      return Promise.all([

if bad configuration, smartapp will show errormessage ‘network is bad blah blah…’