I’m looking at developing an SmartApps and EventHub integration. I essentially want to be able to pass event information from Smartthings (via a SmartApp) to an Azure EventHub.It would be ideal to have this ‘event-driven’, so every time something happens, a message is sent.
This is all good and well, for posting directly to an EventHub, but if this is to be a publicly available app, I don’t want my EventHub available to the public.
So what I’m suggesting is a few design concept ideas. Could anyone provide feedback?
-Stream data from SmartApp to EventHub, using HTTP POST. This would be fine, except for controlling access to this. I’ve heard talk of being able to publish a SmartApp, but control who has access to it? ie a secret link? Also, I need to add some data that is specific to each SmartThings ‘site’, so this approach might be problematic
-Stream data from SmartApp to proxy (in house), which will then monitor incoming streams, and only forward accepted streams to the EventHub. Could potentially have unwanted users streaming data to this proxy though, and it also exposes an endpoint. However, this does allow me to append data onto the incoming streams, as I pointed out in the first point.
-Create an endpoint within a SmartApp, as per this. The downside of this is that I would have to poll the data at a regular interval, instead of having a real-time stream, but it would be safer. As I would be polling from my side, I would be able to add this extra ‘site’ data that I mentioned, which is good.
Does anyone have any comments on the above or other suggestions?
Big thanks in advance, power to the forums!