Turning a light on/off with motion when "X" is not time or date but another sensor

I have absolutely no problems setting a light up to turn on and off using motion at a certain time.

What I would like to do is to turn on/off a light using motion but only when another sensor is opened or closed without using modes.

So for instance the garage lights to turn on with motion but only when the garage door is shut.

Or a lamp to turn on with motion but only when the alarm is disarmed.

I’m not sure if I’m missing something but I have tried everything. Even IFTTT only seems to allow 1 condition based on another and not 2.

Any help is appreciated, I’m sure it is out there I just can’t seem to find it.

If you are in the U.S., you can look into one of the third-party rules engines. (This is a clickable link)

Thanks I just haven’t had the time to code, I’m fairly comfortable with groovy I guess I just need to sit down and knock it out. I’m really surprised this hasn’t been done before, even my old ADT pulse unit did this. Ahh maybe some day when the kids move out and I’m retired I’ll have more time for the simple things like coding.

Code can be a pain in the butt… trying to make sure you follow all the rules, all the correct syntax. And just when you think you’ve got it all worked out, the program fails, completely and you sit there and sit there and sit there reading it over and over again, trying to find where your logic is wrong. Then after hours to work you finally figure it all out and it works… and then the standards all change or the reason why you wrote the darn program doesn’t apply anymore.

Code can be a miserable, stressful, exhausting experience.

I’d still rather code than do the dad stuff. :wink: