Generic Presence Detection

Hi,

I’m working on my presence detection a bit more. I’ve had success getting my miniNut Bluetooth device to work with the brilliant Bluetooth binding

and both my wife and I have a nut each on our car fob. Now the issue is that sometimes we go out together in one car, (a chore all married couples have to do from time to time ;-)), so my OH presence doesn’t flip to away.

What I’ve done is add the presence of both our iphones via:

Again, this in isolation works great.

So, my question is on the logic of this…I’ve had a slightly modified version of rlkoshak’s great presence detection script on this thread running but I want to update it so that:

If, and only if, both my miniNut and iPhone are present then I am home
If, and only if, both my wifes miniNut and iPhone are present then she is home
If a guest has a guest miniNut present then guest is present.

In each case if nothing is detected then no one is home…

So, the 3rd part is easy, I’m just wondering how easy it would be to code the if and only if part of the first two???