Any way for one child app to run another child app?

HSM is an example of an app that uses location events to communicate with other apps, notably with Maker API and RM. One nice thing about this approach is that you can send a Map as data in an event. A recipient app subscribes to the location event. HSM itself both sends location events, and subscribes to them so that RM or Maker API can arm/disarm it, and/or trigger off HSM events.

One minor disadvantage of the child-parent-child approach is that each such message has to load the parent app and the destination app, compared to location event just loading the recipient app. But both have their uses.

This is the line of Maker API that sets HSM status:

sendLocationEvent(name: "hsmSetArm", value: id.toString())

You can also create Location Variables (not to be confused with Hub Variables coming soon, or with RM variables).

createLocationVariable("myLocVar", ["value 1", "value 2"])

After doing that, location.myLocVar holds the most recent value sent in a location event. The location variable will only take on pre-defined values, although sendLocationEvent can send any value.

5 Likes