Unlock side door when garage opens, but only when I’ve just arrived home?

I’m new to Home Assistant + Node-Red, but enjoying the learning. I have a flow I want to do, but I’m having trouble with the logic and hoping the community has ideas.

I have a detached garage behind our house. When I return home and open the garage to park, I’d like the lock on my side door to automatically unlock.

However, there are scenarios where I don’t want that to happen. If the garage door opens and I’m not home, don’t unlock. If I’ve been home for a long time and I’m opening the garage to leave, then don’t unlock the side door (as I tend to open the garage door after I’ve already exited the house).

The last challenge I have is sometimes presence detection doesn’t detect me as home again until after I have already opened the garage, but other times, it is faster and I show up at home before the garage opens.

Can anyone suggest a flow that can account for these challenges?

Thanks for any assistance!

Look into an interval node. Run your two conditions to the input side and select a time frame you see fit. If those events happens within that time frame it’ll proceed to output if not it won’t. Sorry I’m on mobile or would post my flow example.

Thanks! I’ll check it out!

How are you detecting Home status for your device? Wifi only or App and Geofence?

If Wifi Only it can be the cycle check time for your device causing the issue of your odd timing.

I have a friend staying with me who doesn’t use the HA app on her iPhone and her phone doesn’t always connect to the wifi when she gets near, also sometimes drops off. Currently she’s here been here for over 40 minutes, getting home from work. HA shows her as away since her phone isn’t reported as on the wifi by my ubiquiti hardware.

Could try an ARP sense using her WiFi MAC…?