Using the plugin: homebridge-delay-switch v3.0.3
In this example, we are going to turn off a speaker 10 minutes after it is turned on.
From the plugin Settings in Homebridge, add an accessry.
Create an automation to trigger a motion detection after a delay when the speaker is turned on
Create automation to act on the delayed motion detection which turns off the speaker.
You should have 2 automations that will result in the speaker being turned off after 10 minutes of being turned on.