Turning on an amp when one of several Chromecast audios or android TVs enter playing state

Hi. Apologies in advance if this is a silly question, but I am a newbie.

I have a number of chromecast audios and shieldTV’s that feed a set of zones in a couple 16 channel amplifiers. The amp doesn’t do auto power on, but I have them controlled by plugs that HA controls.

What I would like to do is define a set of groups of entities such that when any of the chromecast audios or shield TV’s go active (probably playing for the chromecasts and simply turning on for the shield TVs) to trigger the amp to be switched on.

I have tried using media player group state calculations, but that doesn’t seem to deal with the playing state, only if everything is off, or ends up set to unknown.

There is a value template that would seem to be a good way forward, but I can’t figure out how to do this using entities in a group using the expand and selectattr commands. Can someone give me hint how to structure this in HA?

Also, I would prefer to have the amp not turn on and off when things go to idle or are paused for a few minutes. So I’d like to wait 10 minutes after all the sources stop playing or turn off before turning the amp off.

Can all this be done in one automation?

Thanks!