When using the ignore options for a sensor, there is the ability to specify a day and time frame. This time frame can start on one day and end on the next. For example, from 8PM for 720 minutes would be from 8PM to 8AM the next morning.
You could think of this as starting a timer when the sensor is created, with the time being the difference between the current time and the ignore end time. If the sensor still exists and in alarm at that point, an event will be raised. If the condition is resolved before the timer goes off, nothing happens.
Thus the following are all valid use cases of long time period alarms:
- 6PM for 840 minutes (6pm to 8AM)
- 10PM for 1440 minutes (10pm to 10pm)
The ignore time frame should not span more than 2 days. As an example using 8PM for 2400 minutes will not produce the result expected since it spans 3 different days. It will work as expected and set the ignore timer correctly for any sensors condition on day1 and day2. The unexpected behavior is with sensors created on day 3. These will not be ignored because the "look back" window is only the prior day. That is, when the sensor is created, only an ignore for the current day and the prior day are considered and it will not look back 2 days.
Creating sensors for multiple days (such as over a weekend)
Create several overlapping time frames over the 3 days. The first (day 1) should cover the entire period. For example, if starting on Friday until 8am Monday, this is 3480 minutes (120+1440+1440+480). Thus an event that starts at 11pm on Friday will trigger at 8am Monday (if still in alarm).
For simplicity, start the second day at midnight and capture the entire time until Monday morning of 3360 minutes (1440+1440+480). As noted, above, this one could be created starting at a later time and the look back processing would find the correct one, but this makes it more apparent that it covers the entire day(s).
Finally for the 3rd day, create a similar interval of 1920 (1440+480) which covers the final day and isn't covered by the look back rule. Again, starting at midnight makes it apparent, the entire day is covered.
For more complex ignore windows, a Schedule Policy is an option.