Can I make a virtual device that has an oAuth REST endpoint?

(Jim) #1

So I’ve got this setup I created that has a Raspberry pi attached to a custom board that monitors my smoker while I’m cooking roasts.

I’ve got the pi calling out to a Smarthings smartapp and notifying me of “out of range” temperatures, etc. That said, I can’t really see current temperatures and so forth from the smartapp.

I’d like to create a device type where my raspberry pi could push temperatures, and then in turn my smartapp could read them from the device. Then at least I can look and see the current temperatures from the smoker in the app.

Feasible? I get the impression I can’t have an OAuth REST endpoint in a device?

(Geko) #2

I believe this is true. You need a “service manager” smart app to provide an endpoint and pass the commands down to child devices.

(Alex) #3

It’s possible.

However citing @Jim


So stay tuned.

The IDE used to have an OAuth section in device properties that is now hidden. Device type endpoint is subject to the same polling rate limit as a smart app. They probably can’t handle additional polling, so they hid it, at least for now.

(John S) #4

[quote=“jim_lewallen, post:1, topic:19389”]
[/quote]Sure. Make a generic temp sensor device. Add a method to set the temp. In the method, sendEvent() to set the temperature attribute.

Create a smart app with oauth, create a device using your device type, connect the two, and have your rpi call it with temp readings. Then you’d have a tile for the device, and could use its temp in a monitoring app.

(Jim) #5

Makes sense. It’s a little cyclic; create app to populate device to read in app - but that’s just model limitations for now. At least I’ll get experience creating a device. Thanks for the tip!