[RELEASE] Presence Plus - Creates a combined presence device

It’s a new “feature” to disable tracking of the device. On the iPhone its under Settings|WiFi click on the connection information and turn off Private IP

2 Likes

@lewis.heidrick YOU ARE EXACTLY RIGHT and I never would have figured this out if you hadn't posted that! This community is so awesome. It wasn't even a dedicated thread to the question about the wifi functionality! I initially selected your post as solution, but I think technically since this was about the combined presence in general it isn't the solution to that. However, you just made my day and I really appreciate it!

@thebearmay thank you also. I'm on Android, but if anyone searches they may find this thread and will see the solution for either scenario if they can't get the wifi static IP configured.

1 Like

Can you add the ability to use contact sensors as presence sensors, please? I use a pressure sensor mat wired to an EcoLink zwave contact sensor that I would like to use with your app.

I created a dinky little app to let me combine contact sensors into presence devices. Feel free to use any code/logic if you want to incorporate it.

https://raw.githubusercontent.com/heidrickla/Hubitat/main/Apps/Combined%20Contact%20Sensors%20to%20Presence%20Device/Combined%20Contact%20Sensors%20to%20Presence%20Device.groovy

Give this version a try. It's not fully tested so let me know how you make out. :wink:

1.0.8 - 03/13/21 - Added Contacts as a Presence option

1 Like

Not sure where to ask this question of Location Tracker User Driver but it's throwing an error.
I have it installed along with Presence Plus.

2021-03-19 13:03:00.798 errorjava.lang.NullPointerException: Cannot get property 'latitude' on null object on line 355 (generatePresenceEvent)

This has nothing to do with Presence Plus. Please post this over on Life360 with States. Along with a real debug log (not just one line) and a screenshot of how you have the app setup.

Thanks

Will do. Sorry for the miss-post. You have so much going on code wise.
I noticed I had Location Tracker installed as a driver for my presence and Presence Plus loaded but I didn't add the app yet. I think I was going to multiple sensors at one point but got distracted.
I've backed out to simple Life360 with States to avoid all this confusion.
Cheers!

1 Like

Everything looks to be working great.

1 Like

I'm just transitioning to this app to see if it can give me better presence detection. My first instinct was to configure present if 2 out of the 4 presence sensors say I'm present and to configure "not present" if 2 out of the 4 presence sensors say I'm "not present". What has real-world experience suggested about the best setting here in terms of a majority vote for presence sensors?

I'm setting it up that way and will see if it pans out, but I would certainly appreciate any insight from others who have tinkered enough with this setting to know what works best. Might save me from some (additional) grief from the wife...

EDIT: Hmm. If I have 4 sensors, and use 2 sensors for both present and not present, perhaps that will cause ping-pongs...

Ran into an issue upon install. Devices are created, but they have no state. Log shows null pointers.

Quick look at the code suggests the pCount2 variable isn't getting set. Strange because it seems like ArrPresenceSensors2 || ArrConPresenceSensors2 should evaluate to true given my settings. Perhaps you can track down the issue being more familiar with the code.

New version on GitHub...

1.0.9 - 04/03/21 - Fixed error

1 Like

Still having issues, I'm afraid. Different null pointer exception. Although on its face it might be because the devices have still not populated with any state. Not getting any state at all, no presence, nothing.


I believe my nullPointer exception errors are attributable to the fact that I forgot to select the output sensor. Sent you a pull request to make that input field required.

With the ability to use ping on the hub now, could you possibly add a ping option for detecting presence? Kind of like the old iPhone Wifi Presence driver but with ping instead of an HTTP endpoint check.

hubitat.helper.NetworkUtils.PingData pingData = hubitat.helper.NetworkUtils.ping(ipAddress, numPings.toInteger())

if (pingData.packetLoss < 100) 
        updateAttr("presence","present")
    else 
        updateAttr("presence","not present")
1 Like

I've added it to the list. (I actually wrote it down so I don't forget! :wink:)

1 Like

Just wanted to update, I've added this to the app BUT there seems to be some issues with it. It only works with the C7 hub. I was pulling my hair out trying to figure out what I was doing wrong (my development hub is a C5), just couldn't get it to work. So I came back to the forums and did some searching, sure enough, a lot of people can't get it to work on their C5's. I then loaded PP on to my C7 hub and BINGO, worked right away!

So, I'm going to go forward and put the final touches on it but the option will only be available to C7 users. Hopefully this is addressed with the next release.

1 Like

New version... Tons of new code, Please make sure to check all of your existing child apps.

1.1.0 - 06/24/21 - Added IP Ping option, Added Motion to options, Reversed how Contacts work, upgraded device creation and logging options

1 Like

Having trouble with the app setting the correct presence. The app sets presence to Present even when ALL presence sensors report Not Present. Here’s the log:




I input “2” for the number of sensors needed to change to present or not present

I'll be looking into this. The thing that jumps out in your log is the "theArrNum: null". Needs to be a number for the app to work. ie. theArrNum: 1

Try recreating the child app.

Thanks

Thanks. Definitely throwing off my smart home!

I recreated the child app but get the exact same result:

1 Like