Is it possible to access the history of motion sensors in smart apps? I’d like to be able to only trigger events in the room with the most recent activity. Ie, when an external door opens blink the lights in an occupied room only.
So you could find all the “active” events, then sort to find the most recent one.
Here’s a quick n dirty pass at it (not tested), and I bet there are some ninjas out there who could whip something more terse and efficient, because something seems off about this. I look forward to seeing other solutions…