how can a thing Enable it's own subscription via a service
Hi,
I have a thingshape that has 2 subscriptions.
- a DataChange subscription to one of its own properties
- a subscription to the timer event of a separate timer thing. By default this subscription is disabled.
I would like to enable the second subscription from within the first. I have tried to use the service EnableSubscription
var subParams = {
propertyName: undefined /* STRING */,
thingName: "RemoteTimerThing" /* THINGNAME */,
eventName: "Timer" /* STRING */
};
me.EnableSubscription(subParams);
This fails as it says it 'Cannot Update A Subscription That Does Not Exist'. Originally I thought it was a permissions issue and so changed the permissions, but it still failed. I have also tried running this service directly from within the composer (as an administrator) using the Test button and it also fails. Now I'm thinking it isn't a permissions issue at all, but maybe there is something wrong with my service call above.
If I manually enable the service via the checkbox it all works fine.
Does anyone know how to enable a thing's own subscription from within it's one of it's own services?
Thanks,
K

