Code Request for "Is This Person Here?"


(Iotdit) #1

I apologize if it’s here somewhere, but I cannot find it - I need a code snippet to test if a particular person is present…
I am working on a scenario to automate my office turning on when I am home on a workday at certain hours…
I found code to search if anybody is home, but not how to identify a particular person and do the test for their presence.
Any pointers?


(Im Brian) #2

This does that, minus the time constraint: https://github.com/imbrianj/safe_watch/blob/master/safe_watch.groovy

When you configure the app, just select the one person.


(Iotdit) #3

ImBrian, Thank you, that helped me.
Since I have found this works for one person: if (person.currentPresence == “present”)