How to add a subscription programmatically?
I want to subcribe values from other things, but the target things are created programmatically and the quantity is large. It will take too much time to create subscriptions mannually, so I want to add subscriptions programmatically too.
My script is like this:
var params = {
propertyName: "sourceProperty",
thingName: "sourceThing",
eventName: "DataChange",
serviceName: "DynamicSubscriptionTest"
}
Things["TargetThing"].AddDynamicSubscription(params);
But it looks like doing nothing. No subscription was added. Nothing happened. I added restart thing function, but it didn't work too.
So, how to use AddDynamicSubscription function? Or is there any other method to realize my intention?

