Detecting quick off-on-off transition for an entity (switch or dimmer)

I have a multitude of switches and dimmers of several manufacturers in my rooms.
I need to be able to disable motion light activation for the room in question

So I think if I am able to detect a quick transition (say 2 sec apart) of them through the sequence off-on-off, (i.e. kind of simulate a double tap action), then I can disable those automations.

Or does anyone have a better idea how to disable such room automations without using any additional hardware but the smart switches themselves? Some of those switches do not know double/triple tap commands, some are wifi, some are zwave, etc.

TIA