Occupancy Flag code

lupinglade

Senior Member
Use the occupancy flag ON and OFF states to run macros, etc.

Code:
79.	//    Occupancy
80.	WHEN House Area OFF
	WHEN House Area DAY
	WHEN House Area DAY INSTANT
	WHEN House Area NIGHT
	WHEN House Area NIGHT DELAY
		AND IF Home Is Occupied Flag OFF
			THEN Home Is Occupied Flag ON
81.	WHEN House Area AWAY
	WHEN House Area VACATION
		AND IF Home Is Occupied Flag ON
			THEN Home Is Occupied Flag OFF
 
I use pretty much the same setup

Just curious why you have the "AND IF" checker statements in there?
It doesn't appear to hurt anything to set the flag over and over to OFF or ON and would save programming lines

IIRC, DAY and NIGHT will already do the checks for DAY INSTANT and NIGHT DELAY so those lines may also not be necessary.


The transition will only occur after the arming delay, so if you have any actions which key on the state of the flag you need to make sure that is taken into account.
 
Just curious why you have the "AND IF" checker statements in there?
It doesn't appear to hurt anything to set the flag over and over to OFF or ON and would save programming lines

This is to prevent it going ON or OFF when the occupancy hasn't actually changed. This way, macros that are meant to ONLY run when occupancy changes won't run in other cases. Its a lot more useful this way.

IIRC, DAY and NIGHT will already do the checks for DAY INSTANT and NIGHT DELAY so those lines may also not be necessary.

This I wasn't aware of. Are you sure? May need to test this.
 
I got it, makes a lot sense! Thanks.

Now that I threw that second point out there, I gotta go track it down my self. :)
As I'm ruminating, I'm remembering that DAY and DAY INSTANT as "WHEN" triggers may be different, but in a status check "AND IF" line they are the same.
Foggy memory and all that - guess this discussion is good to keep me reminded of the controller behavior.
 
Back
Top