cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Automatically creating and binding Things by new unbound Remote Things from SDK

miikkae
1-Newbie

Automatically creating and binding Things by new unbound Remote Things from SDK

Hi!

I'm trying to create a service to detect new unbound remote things and creating and binding new things based on them.

I've created a local service with script for detecting unbound remote things and creating them based on a template and it works while I manually use the "Test" button.

Now, I'm wondering how could I call that service from C SDK (later propably with some other SDKs too) ?

I'm guessing to use a service from SDK, it must be a remote service but TWX allows no script to be included in those.

Is it even possible to do this?

There's a twApi_InvokeService function in C SDK, so it seems like service call should be possible, though.

How could I run custom script in remote service?

I've also thought about creating a subscription for this, but it's not working 'cause the thing's unbound at that moment.

It would be quite important to get this working, so we wouldn't have to manually create things to TWX all the time.

1 ACCEPTED SOLUTION

Accepted Solutions

I've now tried to create one constant Thing to run this service from and by subscribing the service on a remote event and firing that event from unbound remote thing but neither seems to be working.

Only working solution seems to be to run an external SDK agent with the constant Thing already existing on TWX and using it to just run the service.

Some permissions are still missing, but I changed that for a moment so that the applicationKey used my administrator account and it worked fine. Naturally, there's the "extra" Thing that's used to run the service on TWX then.

View solution in original post

1 REPLY 1

I've now tried to create one constant Thing to run this service from and by subscribing the service on a remote event and firing that event from unbound remote thing but neither seems to be working.

Only working solution seems to be to run an external SDK agent with the constant Thing already existing on TWX and using it to just run the service.

Some permissions are still missing, but I changed that for a moment so that the applicationKey used my administrator account and it worked fine. Naturally, there's the "extra" Thing that's used to run the service on TWX then.

Top Tags