Unsubscribe not working?

Not too sure what’s going on, but whenever a device event I subscribe to fires, it fires the event more than once. It’s not the code, I broke it down to just one line of code that subscribes and it still sends more than one event and unsubscribes on before it subscribes.

What I have noticed is this

  • The first time I run the code, it works as expected and only sends one event
  • If after I update my code, hit save then publish for me again, another event is sent. So now two events per subscription

This leads me to believe that unsubscribe is not working. Or When I update my smarttapp’s code, is there something I should do on my phone? I tried removing the smarttapp instead of updating it in the smartthings app. Has anyone else had this issue?

What’s your flow for creating, publishing, and updated a smarttapp’s code that will be published for me?

If you would like to see what your app is actually subscripted to:
graph.api.smarthtings.com > My locations > List Smartapps > (Select your smartapp) > Scroll down till you see “Event Subscriptions”

With out a link to your code, determining why your code behaves the way it does is near impossible.

2 Likes

thanks @sidjohn1, that was helpful. I did what you suggested and my app is installed multiple times. Each installation subscribing to events, which explains it. After uninstalling all the extra instances, all was well. Any idea how this would happen?