Smart App Subscription Question

If I have a preference for some contacts. Then I have another preference for some contacts also. And there is a duplicate in both preferences. Then in the subscriptions I have a separate subscription for the 2 different preferences. If one of the duplicate contacts triggers the subscriptions will both subscriptions get executed?

Hope that made sense.

If I understand your question correctly…

If you have two inputs for contacts then you will need two subscriptions
The subscription statement will point to a method handler which should be different.

subscribe (contact1, ‘contact’, methodHandler1)
subscribe (contact2, ‘contact’, methodHandler2)

This way, any event for the input ‘contact1’ would only execute methodHandler1

Not Exactly.
Input(contact1, multiple: true…
Input(contact2, multiple: true…

In contact1 I have say sensor1, sensor2, sensor3.
In contact2 I have say sensor4, sensor2, sensor5

So sensor 2 is in both.

subscribe(contact1, ‘contact’, handler1)
subscribe(contact2, ‘contact’, handler2)

If sensor2 triggers will both subscriptions get called?

I would expect them to… it would be easy enough to confirm
Just use a couple of simulated contact sensors and some logging for the ide

1 Like

Sometimes the brain overlooks the simplest things. I took your advice and did a test. Works fine. Thanks for the hint.