Problem with Local Variable for contact status

I need help with a Rule or even a better way to accomplish this.

Need: When I go to arm HSM, there are times a door or a window is open. Because of the way HSM works, I don't get a notification of this until after I attempt to arm HSM - often minutes later. To avoid this, I would like to have a single dashboard tile (right next to the HSM tile) showing if any window/door contact is open.

Setup:
I created the following rule - Rule Name - Open Sensor
Select Trigger Events
Door - Back, Door - Garage, Door - Front, Window - Dining Room - 1, Window - Dining Room - 2, Window - Dining Room - 3, Window - Breakfast - 1, Window - Breakfast - 2, Window - Spare Bath, Window - Office 2, Window - Office 1, Window - Office 3, Window - Office 4, Window - Laundry Room 1, Window - Spare Bedroom 1, Window - Spare Bedroom 2, Window - Laundry Room 2, Door - Garage Car, Door - Master Outside any changed
Select Actions to Run
IF (Door - Back, Door - Garage, Door - Front, Window - Dining Room - 1, Window - Dining Room - 2, Window - Dining Room - 3, Window - Breakfast - 1, Window - Breakfast - 2, Window - Spare Bath, Window - Office 2, Window - Office 1, Window - Office 3, Window - Office 4, Window - Laundry Room 1, Window - Spare Bedroom 1, Window - Spare Bedroom 2, Window - Laundry Room 2, Door - Garage Car, Door - Master Outside any open(F) [FALSE]) THEN
Set Open Sensor to true
ELSE
Set Open Sensor to false
END-IF

A local variable is setup as follows
|Open Sensor|Boolean|Contact Sensor|false

The Device - Rule Machine Connectors - Open Sensor is automatically setup

Here is my issue
If I have all contacts currently closed, the log entries appear to reflect the process working. The local variable is set to false. If I open anything, the process correctly sets the local variable to true. Unfortunately once it is set to true - it will never reset to false.

Log Entries
app:3022020-07-24 12:50:18.586 pm infoAction: END-IF

app:3022020-07-24 12:50:18.527 pm infoAction: Set Open Sensor to false

app:3022020-07-24 12:50:18.519 pm infoAction: ELSE (do actions)

app:3022020-07-24 12:50:18.513 pm infoAction: Set Open Sensor to true (skipped)

app:3022020-07-24 12:50:18.484 pm infoAction: IF (Door - Back, Door - Garage, Door - Front, Window - Dining Room - 1, Window - Dining Room - 2, Window - Dining Room - 3, Window - Breakfast - 1, Window - Breakfast - 2, Window - Spare Bath, Window - Office 2, Window - Office 1, Window - Office 3, Window - Office 4, Window - Laundry Room 1, Window - Spare Bedroom 1, Window - Spare Bedroom 2, Window - Laundry Room 2, Door - Garage Car, Door - Master Outside any open(F) [FALSE]) THEN (skipping)

I then manually open the device via the edit
app:3022020-07-24 12:51:09.808 pm infoOpen Sensor: Open Sensor variable set to true by connector

dev:2622020-07-24 12:51:09.554 pm infoOpen Sensor was opened

I now run the action again
app:3022020-07-24 12:51:44.637 pm infoAction: END-IF

dev:2622020-07-24 12:51:44.622 pm infoOpen Sensor was opened

app:3022020-07-24 12:51:44.553 pm infoAction: Set Open Sensor to false

app:3022020-07-24 12:51:44.547 pm infoAction: ELSE (do actions)

app:3022020-07-24 12:51:44.544 pm infoAction: Set Open Sensor to true (skipped)

app:3022020-07-24 12:51:44.533 pm infoAction: IF (Door - Back, Door - Garage, Door - Front, Window - Dining Room - 1, Window - Dining Room - 2, Window - Dining Room - 3, Window - Breakfast - 1, Window - Breakfast - 2, Window - Spare Bath, Window - Office 2, Window - Office 1, Window - Office 3, Window - Office 4, Window - Laundry Room 1, Window - Spare Bedroom 1, Window - Spare Bedroom 2, Window - Laundry Room 2, Door - Garage Car, Door - Master Outside any open(F) [FALSE]) THEN (skipping)

Notice
The device is still set to open - even though the rule set it to false (12:51:44.553), the device was Opened 12:51:44.622

If you are looking for a simple way to do this, I would recommend the Average All app from @Cobra. Available at http://cobra-apps.co.uk/

1 Like

Until this is resolved, I have followed the advice of another post

Create a Virtual Device named "Living Room Windows", use the Virtual switch driver

Then Create a trigger,(in rule machine) select which windows you want assigned with the actions becoming true based upon the sensors designated triggered.