Presence Detection to Play Music Automation - How?


I’m looking for some help getting started with automations.

I have a speaker attached to a Raspberry Pi/IQAudio Digiamp running Volumio in my bathroom that I would like to turn on/off (Play/Pause) when the Xiaomi Zigbee Presence detector detects movement (and turn off after say 5 minutes of no movement).

Has anyone else done something similar, or can someone help guide me through it from the viewpoint of someone who has no automation experience within HA. Literally from the begining, I have the XIaomi sensors and Volumio set up and ‘working’ in HA already, just need to automate.

So… If Xiaomi Sensor senses movement then turn music on (play) if it doesnt sense movement for say 5 minutes then turn music off (pause) for my Volumio Pi/amp.