Disable motion control when garage door is OPEN

Hello All,

I have a garage door set up with the Evolve LFM20 Relay and SmartThings MultiSensor. I also have an outdoor light on top of the garage + a Motion Detector to control the light based on motion. The way I have it set up now is as follows,

  • When Garage door opens (anytime between 7 pm and 7 am) , the outdoor light turns ON and it goes OFF after the Garage door closes.
  • Alternately I have the motion sensor detecting motion and turning the same light on only as long as motion is detected and turning it off when there is no motion (between 7 pm and 7 am only)

These 2 activities conflict - For example, sometimes when I open the garage door to leave my dog - the light comes ON and if my DOG is not in the range of motion sensor the light would go off, since the motion sensor activity kicks in. Then when my dog comes back in range the light comes ON again because it detects motion… this creates a ON/OFF activity. Ideally , I would like to leave this light ON in the night as long as the garage door is OPEN and only control it based on motion when garage door is closed.]
I dont want to keep the light ON for more than 5 seconds when motion is detected, because it would stay ON for too long if I keep it ON for long - So ideally, I would like to keep the light ON when motion is detected and Off again when no motion detected.

I am trying to write a smart app for this, but I am unable to combine two event handlers and ignore one based on state of the other. Moreover, I am not sure I am able to identify the state of the garage door correctly using the xyz value of the accelaration handler on the multisense - How can I do this? Any ideas?