Where Do You Stand On Presence?

Same here, plus a second wifi presence using @snell Unifi netwrk drivers (plus the same setup for my wife). Ive just started to track these so i can determine which ones respond more quickly for arrival & departure

However i also use a tracker i have in my car, which sends me a message when i leave/enter the geofence. Gut feel says it's faster and more reliable than any of the others. I just need to figure out how to get it to feed HE. Tasker will be my first port of call

I believe both options work pretty well. I chose the MakerAPI based Homebridge integration as it does not require any custom code on my Hubitat hub. It’s been running very well for a couple of years now. I actually run HomeBridge on my always-on Windows 10 “home server” PC. This PC also runs InfluxDB, Grafana, NodeRED, Plex Media Server, and Channels DVR.

Cool. Thanks for the direction. I have an always on pc running Plex as well but I was considering using my Synology DS220+ for Homebridge. Now maybe not :wink:

I won’t hijack this thread any further.

1 Like

I left and came home three times today.

Over the last 24 hour Life360 shows 1% of battery usage.
Locative does not show on the list. I am sold.

2 Likes

I have struggled with this for a couple years. My significant other resists all "tracking apps," doesn't drive (Queens born and bred), and therefore never carries keys or a fob. Wifi presence sensors with an iPhone are not always reliable - they give off a lot of false negatives, but never a false positive. I use 4 separate methods, all wifi based: Unifi presence, iPhone wifi presence, Hubitat Presence Ping, and Hubitat Ping. I basically ping the crap out of our phones continuously and if they all fail for 10 minutes I determine we've departed. Any positive result is considered valid and any negative result is validated with an Alexa warning. "No presence detected. Alarm will arm itself in 60 seconds. Say 'Alexa Abort' to stop countdown."

All this activity drives the hub generates excessive events and load so I actually use a separate hub just for this and my other wifi integrations.

1 Like

First and foremost the official app is terrible for presence and geo fencing and should not be relied upon at all.
With that out of the way, I'm using a combination of 3 things, The app (for the few times a day it is actually correct, even a broken clock is correct twice a day), @bptworld 's Life 360 Tracker, @Johndc7 's Improved Mobile presence (for android) and those all bound into @dman2306 's Presence Monitor (though with @dman2306 leaving the community im looking to replace that with @bptworld 's Presence Plus).
This set up has been rock solid and dead accurate for several months, usually with little to no delay on arrival, primarily because my Wi-Fi is strong enough we join it about 6 or 7 houses away, so by the time I actually walk in the door I'm already marked present. From what I can see, there is only a few minutes at best delay on departure. The only thing I would add, if I knew how to do it, would be to use my Fing account as part of the mix (they even have an API, I just have no clue how to set it up).

This inspired me to play around with Locative and using Cloud End Point as an RM trigger for the first time. So far, I am getting the trigger when I enter/leave the geofence. However, what I'm not understanding is how to handle multiple geofences (e.g., "Home", "Work", "School") and having those the ID of the geofence available in RM.

Do I need to use Request Designer in Locative to include that data or does it send it by default? How do I extract that data in an RM conditional or action?

1 Like

I not familiar enough with Locative to know what request designer is, but I just added a second location for work in Locative and then you can specify separate cloud endpoint triggers for a separate set of RMs. I think this would be the easiest way of handling it.

1 Like

Again, I'm new to this app also so I might not be making sense. Request Designer allows you to modify the payload sent with the webhook. However, even with the free version, the payload can include a label for the geofence such as "Work".

So I guess my question (of anyone) is how you access the payload in the webhook that triggered the action .. similar to the way one might use $device in a rule.

That's where the phones came in and the topic that shall not be named.

Combined presence sensor. For instance.... We had fobs on our keychains and our phones. If 3 out of 4 were gone (2 phones and a fob) we were gone because one of us was driving and we would leave the other set of keys at home but both of us would always have our phones. Combined presence can be used with any presence sensor. Nowadays I primarily drive us so the 3 out 4 rule still works. But when either my truck sensor or either one of our phones or my wife's fob is in range the presence changes and unlocks the door.

2 Likes

Same here! I'm still using the script written by @frits which predates Brian's script (all based on the original Domoticz presence detection script). Being BLE I also needed pi zeros at each end and middle of the house to reliably detect the beacons no matter where they are.

I'd be interested in how you interfaced your beacons to node-red, at the moment I have multiple BLE devices defined in HE due to the 3 receivers and it would be great to be able to simplify the setup by moving it to NR.

My only gripe/wish with these things are that the beacon transmissions are unencrypted. I doubt any of my neighbours have the tech capability to read and spoof my beacons but this is an inherent weakness. I believe the firmware on them can be reprogrammed with an encryption scheme but this is unfortunately outside my level of expertise.

Still just using Owntracks on Android and it is absolutely perfect for me. Love it.

1 Like

In the script, I just looked for the hubitat endpoint and updated to point to an http in node:

For the script I modified, it just looked like this:

# Change your IP and Port here :
#URL_HUBITAT = 'http://192.168.1.xx/apps/api/414/location/?user=PARAM_NAME&location=PARAM_IDX&cmd=PARAM_CMD&access_toke$
URL_HUBITAT = 'http://<yourIPhere>:1880/tile/?pi=LivingRoom&user=PARAM_NAME&location=PARAM_IDX&cmd=PARAM_CMD'

I then feed that into a function node with the following code (ignore Unifi portions):

var tName;
var tDevice;
var tAction;

//set tName based on topic
if (msg.topic == "Tile") {
    tName = msg.req.query.user;
    tDevice = msg.req.query.pi;
    if (msg.req.query.cmd == "HOME") {
        tAction = "CONNECTED";
    } else if (msg.req.query.cmd = "AWAY") {
        tAction = "DISCONNECTED";
    }
}
if (msg.topic == "Unifi") {
    tName = global.get("wifiDevices", "file")[msg.payload.data[0].user];
    tDevice = msg.payload.data[0].user;
    if (msg.payload.data[0].key == "EVT_WU_Connected") {
        tAction = "CONNECTED";
    } else if (msg.payload.data[0].key = "EVT_WU_Disconnected") {
        tAction = "DISCONNECTED";
    }
    //console.log(tName + " - " + tDevice + " - " + msg.payload.data[0].key);
}
if (msg.topic == "UnifiBackup") {
    tName = msg.payload.user;
    tDevice = msg.payload.device;
    tAction = msg.payload.value;
}

//define global name and initialize
var varName = "tile" + tName;
if (global.get(varName,"file") === undefined) {
    global.set(varName,[],"file");
}

//pull global into working variable
var tArray = global.get(varName,"file");

//determine presence based on topic
if (tAction == "CONNECTED") {
    let pos = tArray.indexOf(tDevice);
    if (pos == -1) {
        let newLength = tArray.push(tDevice);
    }
} else if (tAction == "DISCONNECTED") {
    let pos = tArray.indexOf(tDevice);
    if (pos >= 0) {
        let removedValue = tArray.splice(pos, 1);
    }
}

//re-file array into global
global.set(varName,tArray,"file");

//define new output message
var newMsg = {}

//populate new message
newMsg.topic = msg.topic;
newMsg.payload = {};
newMsg.payload.user = tName;
newMsg.payload.action = tAction;
newMsg.payload.modality = msg.topic;
if (tArray.length == 0) {
    newMsg.payload.value = "AWAY";
    newMsg.command = "departed";
} else {
    newMsg.payload.value = "HOME";
    newMsg.command = "arrived";
}

return newMsg;

That newMsg payload can then be sent to virtual presence devices in Hubitat via MakerAPI. You don't really need to do that unless you utilize presence devices in Rule Machine though.

1 Like

Nice - I will give that a go. At the moment there are quite a few events being generated by the various beacons (and x3 due to the added receivers) so offloading all this to node red and simply reporting the final presence state to HE will cut this down quite a bit.

That's all I use is the ST and AA mod.
If I have the wife put the sensor in her purse so if we leave together the house always sees both of us leave.

Is this 'Locative' an app that's only available in certain regions perhaps? I can't find it on the UK on the App Store.

Edit: Found it. Stupid App Store! Searching 'Locative' it doesn't show up. I had to type in the developer instead in the search "Bearologics' and it's the first result.

2 Likes

Others to consider (they both work well and I believe use similar methods as Locative):

Geofency

Owntracks

2 Likes

I don't suppose there's a guide anywhere on how to setup Locative with Hubitat for presence? I've installed the app and set up the geofence but have no idea what to enter for the 'Webhook on arrival' and 'Webhook on departure'. I've never done anything with http get or post as yet :confused:

1 Like

Would you not make use of Maker API? Using the URL's it sets up to adjust a virtual presence sensor?