How to keep binary_sensors ON for a certain time

Hi,

I’ve connected the movement sensors from my alarm system into my RPI3 GPIO’s and configured them as binary_sensors in HA. The problem is that when we are home the sensors are constantly going ON and OFF like they should, but that fills my history database. Also, it becomes dificult to see in real time if someone is at a certain room.

I would like to find a way to clone the binary_sensors into a template that would keep the value ON for e.g. 1 minute every time the binary sensor goes from OFF to ON.

I know how to do this with Automations, but it would take 2 automations per sensor. I have 10 sensors. I don’t wan’t to have 20 automations because of this.

Thank you!