SmartThings Community

Location event types


Hello all, I am trying to get up to speed on writing smartapps and I am having trouble finding what location events are available. If I go to the documentation it says that you can subscribe to the following location events: mode, position, sunrise, sunset, sunriseTime and sunsetTime. However while looking through other peoples code I find stuff like location.timeZone and location.helloHome.execute/phrases.

I guess I am either mixing up different kinds of “location” or the documentation doesn’t cover all the different types of location events. If there is a thread or a place in the docs that explains this please link it, my searching has not come up with anything.


(Jim Anderson) #2

Hi @prrthd, we recently (like yesterday!) updated those docs to discuss Location events. There are some that are not properly documented in that doc yet.

I’ll make sure any supported events get added there.

(Jim Anderson) #3

See also the Location class reference doc:

timeZone is a property of the location object, as is helloHome. The helloHome property isn’t documented at this time, but timeZone is.

As we look to make bigger changes to our documentation, we will consider making all the event information documented alongside an object’s properties and methods.


I was looking all over the place for the class definitions, Thanks! That will get me moving in the right direction. Any idea why when I used the docs search for timezone no results came up?

How would I go about learning more about the helloHome property, just look through other peoples code?

Thanks again

(Jim Anderson) #5

Our reference documentation does not currently reside in the same repository (ReadTheDocs) as the rest of our documentation. This has the unfortunate side-effect of not being searchable. We will fix that, but it may be a bit since it involves a bit more than meets the eye.

Looking through other people’s code is going to be your best bet for the helloHome property at this time. We will get some more documentation around this in the future, but that won’t fix your question right now.

( co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #6

Any chance of getting a search global function that will scan all open sourced SmartApps and SmartDevice Type Handlers?

I don’t know which SmartApp template to start with to look for a helloHome property; unless you are just referring to this (location.helloHome.getPhrases()), in which case, I guess I’ve found one (SmartApp: Button Controller, and used in my own as well). But are there other properties of location.helloHome?

def phrases = location.helloHome?.getPhrases()*.label
if (phrases) {
           myDebug("Phrase list found: ${phrases}")
           /* NB: Customary to not allow multiple phrases. Complications due to sequencing, etc. */
           input "phrase", "enum", title: "Trigger Hello Home Action", required: false, options: phrases

(Jim Anderson) #7

I sympathize. We are looking at how we can more publically share SmartApps in a searchable form, whether that be in a public github repo or some other form.


Hi @prrthd and @Jim, I know this is an ooold conversation. But I just have the exact same question.
Is the whole list of location events documented by now?

As @prrthd mentioned, one can “subscribe to the following location events: mode, position, sunrise, sunset, sunriseTime and sunsetTime”.
As I read the other SmartAPPs and the event list in the IDE, there are also some other location events, such as DeviceCreated, DeviceUpdated, LocationUpdated.

So, is there a document listing all the location events?


Now it’s even more confusing.
As in this SmartAPP opent2t-smartapp-test,
the SmartAPP subscribes to a location event DeviceCreated with the code:
subscribe(location, “DeviceCreated”, locationEventHandler, [filterEvents: false]).

Then, I test it by subscribe(location, “DeviceCreated”, handler) in my own test SmartAPP.
The handler was never triggered.

Then, in the event list of IDE, is says the source of “DeviceCreated” is “DEVICE”, NOT Location.
So, why does opent2t-smartapp-test subscribe such an event?
does it even work at all?
It’s not working with my test, am I missing somehing?