Custom Tailoring Entities/Devices

I have a sensor sensor.double_take_X the X being the name of someone in my family. When they walk in front of a camera and get detected it updates the state of this senor to the camera they were detected by, but it will hold the state of the last detected camera till they get detected again.

My goal is to create something that will set the state to unknown when they haven’t been detected by any camera within X amount of time, as well as not letting the sensor update when a specific person is not home. To help with more accurate facial recognition automations.