How to get/store Sonos current status in a variable?

Here’s a rather convoluted solution I am thinking of:

I also have my Sonos exposed to Apple’s Home via homebridge.

So the idea is to set up a Virtual Devices switch in Homey as my boolean Sonos status “storage”, expose it to Homekit via Sprut Homekit Homey App and have its status changed by a simple Homekit automation, sth like When Sonos (it’s an on/off switch in Apple’s Home App) is On, Turn Dummy Switch On. When Off, turn Off.

I assume this will get “reported” back to the Homey world.

I would then use it as an AND condition for turning off Sonos playback when lights are switched off (manually, or on timer) - so that if the Sonos was on when the whole thing started it won.t be turned off when it ended.

But my question in reference to your response is how do I “extract” the Sonos status in Homey at all?