Recieving push data from the cloud instead of polling?


(Tmp R) #1

I want to create a DTH for a cloud-connected device (Photon). but I want to be able to handle events in real-time instead of waiting for ST to poll the cloud service.

I already have an intermediate cloud service setup, so I need some kind of end-point in the ST API to accept a HTTP POST for example, then trigger an even in my device handler on receipt of data.

So the particle publishes “switch:on” my service receives this event and calls http://api.smarthings.com/somewebhook [switch:on] then ST instantly updates the state of the device to on and triggers any associated actions.

I can’t find any info in the documentation about doing this but it seems a common scenario.


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #2

Your use case is actually trivial.

A web service SmartApp can generate an “access token” to share with your pushing service and that can then contact the Endpoints defined in your SmartApp and mapped to methods).

http://docs.smartthings.com/en/latest/smartapp-web-services-developers-guide/overview.html

If you have a budget for consulting, please feel encouraged to contact me for further assistance.