Help with rules


I’ve been trying to figure out how to make the below (simple) scenario too work, but I am not getting it through.

Fridge sensor is left open for XX minutes, trigger a push notification - I got this working.
Now I need another notification when the fridge door is closed (when this happens) - this is the part I am not good enough lol.

I have been playing with if/or triggers etc but can’t get it to work. I either have the “closed” notification right after the “open” or the “closed” never gets pushed.

Thanks for your support,

HI @George_Vassilakis, you will need to create a virtual switch from SmartThings or Hubitat and create two rules for your scenario. (We are planning to introduce a “variable” feature to rule engine later, but for now you can just use the virtual switch.)

Rule 1

  • Trigger: door left open for x minutes
  • Flow: send open notification, and turn the virtual switch on

Rule 2

  • Trigger: door changes to closed
  • Flow: if the virtual switch is on, then send closed notification and turn the virtual switch off, else do nothing. (So it will only send the closed notification if the virtual switch has been turned on from rule 1, and reset it back to off in this case.)
1 Like

I’m new here and not sure this is the best or even the proper way to accomplish what you want but it does work.

Create two triggers, one for sensor opening and one for sensor closing.

Create two flow if conditions any, 1st, sensor has stayed open for 5 minutes with notification action and 2nd, sensor has closed with notification action.

1 Like

That’s absolutely a good idea to use both open and close as triggers to keep everything in one rule, and the concept mentioned would work. The reason why I suggest the virtual switch is to only send “closed” notification if it has been left open previously if I understand the OP’s request correctly, and you can definitely include the virtual switch in @Scunny’s concept and keep everything in one rule. Thanks for sharing thoughts. :wink:

1 Like

Thanks guys. I will test both options and choose the one that works better!


Hi James,

That worked perfectly! I would never have guessed the need of a virtual device.

@Skunny, that worked as well, however it will always push the “close” notification which is not ideal.

Thank you both for your support