OwnTracks Virtual Device problem

@lpakula, I just installed the OwnTracks software on my hub and on my iPhone. I am trying to use the virtual device as a trigger in Rule Machine. However, the device seems to report either "Departed" or "Arrived", but the interface in Rule Machine only lets me select between "arrive" and "leave":
image

What am I doing wrong?

What is your Hubitat version? According to the documentation it should be ["present", "not present"], but I'm seeing the same as you on the latest Beta version.

Sounds like a bug on the Hubitat side.

The raw attribute value changes to "present" and "not present" map to the human-friendly "arrive(s)" or "leave(s)" text in the UI when selecting trigger events.

However, there is no built-in OwnTracks driver, so what event/attribute names and values you actually need to deal with will depend on whatever third-party code you are using. Sharing that information will help someone see exactly what you mean -- but without knowing that, I suspect this is indeed what you want, unless the driver is using custom attributes for some reason.

2 Likes

I selected "Custom Attribute" when setting up a trigger and then selected "Presence", where I was given the choices of "Present" and "Not Present". I haven't tried it yet to see if it will work.

@lpakula, OwnTracks supports iBeacons as a source of a region. Does that work with this software?

What you've done ultimately does the same thing as the selections in your first screenshot, per the explanation above:

So, while this should work, it's a bit more clicking to get to the same end.

If the device supports this attribute (event name) with these values, it should work. I can't imagine it wouldn't since this is pretty standard (unless it's usurped them for some other purpose). But the only way to know for sure is to look at the device detail page yourself to see what values you find under "Current States" (or history on the "Events" tab there) or to provide a link to the third-party code you're using so someone can either look at it or maybe already happen to know.

I believe that is all handled phone side? iBeacons are a BLE type device but never have played with them, so I cannot tell you how that works with OwnTracks.

Triggers are events, not states. "Present" and "Not Present" are States and not events. "Arriving" and "Departing" are events.

Events require an instantaneous action whereas states are literally states of being. If you can use "IS" before the word and it makes sense, then it is a condition. ("is present" vs "is arrived")

Not sure what the hang up in the verbiage is for you. But "Arrived" and "Departed" are shorthand for "Becomes Present" and "Becomes Not Present" which are the proper events to be used for triggers.

Note the three triggers below:

For a switch, it turns on (action)
For a default presence, it arrives
And, using the custom attribute, it reports present.

Depending on how OwntTracks reports (not sure what the reporting frequency is), this could be problematic. For instance, if it reports in the current status every minute, it will "report" present when the device "arrives" and then again every minute after that, causing your rule to trigger everytime it reports present. If this is used to unlock a door, or send notifications, it may have unintended consequences.

On the other hand, you can only "arrive" if you are not already there. So, using arrives will only report when the status changes from "not present" to "present" and is the usual desired use case for presence reporting.

If you are wanting to use the "Present" / "Not Present", my suggestion would be to use the presence device reports "changed" as a trigger and then use a conditional expression to handle "present" or "not present"