Custom sensor with an added cooldown/timeout - any easy options?

Hey all,

Does anyone know if there is an EASY way to create a custom sensor (based on an existing sensor) with an added timeout/padding/cooldown (or what ever its called).

Basically, say i have a sensor like a PIR or camera motion sensor. Lets say that those sensors turn on as soon as someone walks in and turns off within couple of seconds when they walk off. I want to have a sort of a [custom] sensor that turns on immediately when someone walks in, and turns off maybe 30 seconds AFTER someone walks out. I have several usecases for this, so its not about getting a PIR that has adjustable timeouts, im looking for a solution that works for anything.

I can definitely/easily do this via node red. I assume its fairly simple to do with HA automations too. But are there any easier way? I vaguely recall there being an option on helpers (sensor groups?) where there was some cooldown or timeout option, maybe im imagining it (i definitely cant find it anymore)? Is there a way to do this via templates or any other helpers? Are there any easy blueprints that will do this?

Thanks in advance :slight_smile: