First person home events


#1

I am sure this has been discussed a few times already as I cannot possibly be the first person to wonder how to do this but even searching the posts I cannot seem to find a solution to my issue.

What I have is a few pistons that triggers stuff on people arriving home.

As an example I have a piston that changes the SHM status to disarmed when presence sensors arrive.

What happens is this piston runs every time anyone returns home, when it really should only run when the first person arrives home.

Also if a few of us arrive home at the same time, it runs multiple times

The other example is that when everyone leaves home the heating is set to an away setting, and when the first person arrives back home it is set back to its default people at home state.

However the same thing happens with this, it runs every time anyone arrives home.

The issue I have here is that lets say the wife returns home first, and the default state is set, then before I get home, she makes some changes to the heating because maybe its a little cold and she wants it a bit warmer, the moment I return home, the heating is set back to its default state, which cancels out the manual changes she has made.

How can I stop pistons running every time someone arrives home and only run when the first person arrives, or if multiple people arrive at once, only run the once?

I hope this all makes sense. I have tried the setting execute on condition change only, which works for a few other (very different) pistons - such as turn a light on when Lux drops below a certain level, setting this option prevents it running every time the lux changes and is still below the set level. That doesn’t seem to work (from what I can tell) for the two scenarios I have mentioned above.

Any guidance on settings or conditions that I can add to my pistons to get around this rather annoying “feature” :slight_smile:

edit - I am going to try and create a switch that is set to on whenever anyone is in the house and only execute when it is off, and set it to off when everyone leaves.


#2

First thing that comes to mind is to set a variable or flip a virtual switch that you can reference as a condition in your arrival/departure pistons. If the variable is true or switch is on, then the piston should stop execution.

And of course you’ll need some logic to set the variable or switch to its original state when the conditions are right.


#3

This is what I have just implemented, It sprung to mind straight after I wrote the post and I went in and edited it to say that was what I was going to try.

I have done what testing I can without physically leaving the house (everyone) for now, only time will tell if what I have done is a robust solution.

thanks for your input, lets hope its more robust than my previous solution :slight_smile:


#4

hi @Rizlah
when you trust your security with smarthome systems please make sure you have a couple of failsafe pistons in place…


#5

yeah I have made sure I have belts and braces in place, have a few different pistons that enable and disable, I also have a pin coded manual mechanism to disable the alarm should I need to.


#6

I use SHM’s status as a indicator if someone is already home or not and I use this piston to set SHM’s status when everyone has left the house and when the first person arrives. I know you said you may have fixed your problem but I have used this many times and it has worked no matter if one person at a time leaves or everyone leaves/arrives all at once. So thought i’d share with everyone watching this post

I put all my presence sensors into a device global variable in this case its called @PresenceSensors

The trigger, line 37 (changes to) is set to any of the sensors in the global variable and the conduction, line 39 (is) is set to all of the sensors in the global variable

With this piston you can tell in any piston when someone is home based on the status of SHM, because when the last person leaves the house SHM will switch to Armed/Away mode.


#7

@Rizlah do you use modes like home and away?

I can post up my piston if it’ll help.


#8

It’s ok. I got it all working about 10 minutes after I posted this. Thanks though.