0

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?

Shadoninja
  • 1,276
  • 1
  • 12
  • 22

1 Answers1

1

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.

Julien Bachmann
  • 753
  • 8
  • 18
  • That is what I ended up doing. I had to learn how to implement OAuth2 to do it that way which was a giant pain in the butt, but I understand that the internet of things needs to have respectable security if it is ever going to become widely accepted. I have marked your answer as the correct answer because I basically did what you are suggesting. – Shadoninja May 02 '17 at 19:37