Presence sensing via variable. Need efficiency help


#1

This is my presence piston, what I do is set a global variable @totalHome to home if anyone is home, and away if ALL are away.

It works well I am just a fan of efficiency, and this piston is FAR from efficient. Any help?

And also while we’re at it, I have seen some pistons that disregard when a phone’s presence goes to away for a couple of mins and then returns (usually iphones). We don’t have this problem as far as I know but I’d like to shield myself from those errors as well?

Oh, and for clarity, we have 4 presence sensors, that’s 2 phones, and 2 life360s. I want to keep it this way until I am 100% certain the life360 solution works alone. the smart things presence isn’t very reliable on my wife’s phone.

One thing you will notice is I made a new variable, so if my wife forgets her phone at home when we go out (happens often enough that I needed to make this), I can hit the routine Forgot Phone on my phone, and from then on it sets @forgotPhone to true, and thus for the time being disregards her phone, which puts the totalHome at away since my phone is away.


#2

this should do the same thing:


#3

Wonderful! I made a small change to allow for either of us to forget phones, see if this is still correct


#4

This way either of us can forget our phones


#5

understood. yeah, that looks right. just run it and see if it works :slight_smile:


#6

So far so good. I will try when we go out of the house today to see how it’s working. and also will try a forgoten phone