Hello David,
I approach this a little different. I use variables and timers. We have an away button that when pressed starts a timer for 2 hrs and sets away variable to ‘1’. When 2 hrs expires it resets itself to 24 hrs and when that expires it moves the away variable to ‘2’. The reset happens again on a 24hrs basis with the away variable counting up to ‘5’, then the reset stops. When a door opens, if the away variable is >0 then it moves it to zero, ‘0’ means we are home. From there, I have a bunch of things happen at all stages. Works great, never an issue and I like it because the system knows that we have been away for certain periods of time, for water shutoff, mockupancy, blinds control, HVAC setback, other timers, etc.