Search code examples
smartthings

Do SmartApps run remotely even when all interactions are local?


I am trying to have my SmartApp talk to my local REST server at my company. This REST server is not externally accessible. In an attempt to narrow down the issue, I have created a groovy program that interacts with the REST server. I have executed this on my own computer and coworkers' computers and they are all able to access the REST server as expected. When I try to access the REST server from my SmartApp (using the SmartThings httpGet() function), I only get ConnectionTimeoutExceptions. Is my SmartApp executing from an external perspective?


Solution

  • From the smartthings documentation, all apps except Smart Home Monitor and Smart Lights run remotely (https://support.smartthings.com/hc/en-us/articles/209979766-Local-processing).

    Smart Home Monitor and Smart Lights are the only SmartApps with local processing capabilities at this time. We are working on additional local SmartApp options.

    That's why you cannot access your local server from your smart app.

    But what you can do is going the other way. Instead of having your SmartApp make call on your local server you can make your local server make call on your smartApp (by using WebServices SmartApp).

    Perhaps it does not fit your need but you can image the following workflow:

    1. Your local server do a call every minutes on your SmartApp on GET /needs.
    2. Your SmartApp return the what it need.
    3. Your local server send the need with a query POST /result

    You can image a better flow but it is just a sample.