Any way to get locationId in CONFIGURATION Lifecycle phase?


(Yoni Rabinovitch) #1

Per the SmartApps API the configurationData associated with a CONFIGURATION lifecycle event does NOT include the locationId of the app being configured.
So is there currently any way my (webhook) SmartApp can know the locationId during the CONFIGURATION lifecycle phase?
If not, would SmartThings be willing to consider adding the locationId to the configurationData?


(Jim Anderson) #2

You are correct, the CONFIGURATION lifecycle does not send the locationId. Can you describe the use case for needing the Location ID during this lifecycle?


(Yoni Rabinovitch) #3

For example, if I want to connect with a 3rd party service that needs the lat/lng coordinates of the location. So actually what I would really want is the Location object and not just the Id.


(Jim Anderson) #4

And you need this during CONFIGURATION lifecycle, so you can do something with this information during Config? Can you elaborate on that? (since you do get the locationId on INSTALL)


(Yoni Rabinovitch) #5

I need it during CONFIGURATION, because that is the phase in which the user registers and OAuths with the 3rd party service. The third party service requires the location info as part of its registration flow.


(Jim Anderson) #6

Thanks for the info @yoni_rabinovitch.

Using location information during configuration hasn’t been a use case we’ve encountered yet, so your information helps. That said, I’m curious what service and information it requires as part of its OAuth flow? If you’d rather not discuss publicly, you can let me know in a PM.

Sending the locationId is one thing, but because the CONFIGURATION phase happens before user authorization, there’s not an associated token on the request to your SmartApp, which means getting detailed information about the Location during this phase would be difficult (thus, having the locationId isn’t that useful). Sending detailed information about the Location on all CONFIGURATION requests, for every Automation, is something that wouldn’t be done without ensuring its a common use case.