Trying to understand STAYS


#1

I have this piston where if all are gone for at least 15 minutes the thermostat will go into ECO mode, but I think I’m using the STAYS incorrectly. I don’t want the piston to run unless the house has been empty for at least 15 minutes, but what happens if 2 have been gone for hours, then the last one leaves? I see the piston seems to re-run, which I’m assuming another 15 minutes has gone by. This is why I decided to use the “everyonesGone” variable as a switch to try and prevent this.

It feels like I’m not doing this right. I want the piston to only run once, but after the last person has left for at least 15 minutes. Just in case they return before hand, I don’t want to go into ECO in that situation.

Would love some advice on this. :slight_smile:


#2

This is how mine is configured:

image

I still feel like yours would work, but you’re seeing the piston run more than once just because it’s receiving events from the presence sensors. Because it’s subscribed to them, it has to run just to see if the conditions have changed.

Francis leaves - Piston runs (doesn’t get past the if statement)
Kiana leaves - Piston runs (doesn’t get past the if statement)
Rachel leaves - Piston runs (doesn’t get past the if statement)
10 minutes pass - Piston runs (doesn’t get past the if statement)
Rachel arrives - Piston runs (doesn’t get past the if statement)
Rachel leaves again - Piston runs (doesn’t get past the if statement)
15 minutes pass - Piston runs (actions performed)


#3

You should avoid referencing devices in global variables… it slows the piston down a lot as the devices won’t be saved in the storage app… therefore, webCoRE has to keep spinning up to check the global variables.

This is fixed if the same devices are referenced elsewhere in the same piston, even without any actions against them, but then you may as well just skip the global variable use anyway.

To achieve your goal I would:

IF ALL of x y or z’s presence are away
THEN
wait x minutes
do departure stuff
ELSE
(TEP condition state change only)
do arrival stuff

I’ve never been a big fan of ‘stays’


#4

Actually the reason for the global variable for people is I’ve been testing the webCore presence sensor instead of ST’s presence. I’ve been having issues with webCoREs, so it’s easier to set the globals to point to whatever presence sensor is more reliable. Right now it seems ST’s works every time, but WC’s seems to be intermittent… ergo unreliable… for now. I’ve been testing back and forth, so changing the presence sensors in every one of the affected pistons would be a big pain. I wish webCore had a FIND/REPLACE feature for editing.


#5

So I made the changes you suggested, then we all went out to the in-laws for dinner. They’re at least 4.5Km from my house (no chance of false presence). Looked like all worked out, but then the piston ran 3 times (thinking someone left home). It confirmed we left (15 minutes later) at 7:35. It ran again at 7:50, 8:20, and 9:02, but worked the arrival correctly when we returned at 10:05.

Currently my wife and I are on the ST presence sensor, and Kiana is on the webCoRE sensor.

Ugh!


#6

I wonder if I should change:

If {thePeoples}'s presence is not present

TO

If {thePeoples}'s presence changes to not present

???


#7

For webCoRE Presence that might be needed… sorry… I’m used to handling arrival sensors and ST mobile sensor that only Crete events for arrival and departure.

Might also work to just turn TEP for the first part to ‘condition state change only’.

WebCoRE Presence updates and creates events constantly.