Turn off lights after any non specific action

The way i’ve achieved similar is with variables, create and set a variable to zero, when something else happens e.g. a light switching on or the TV switching on then increase the variable by 1, then a separate flow that is when variable is greater than 1 turn hallway light off, catch all also when everyone leaves the house then set variable to 0. Hope that makes sense.