This should be doable with standard hello home phrases. It’s just they have one strange quirk: you will only be given access to the motion sensor option if you set the Hello Home Action up to change the mode. But you only have to do that the very first time you set it up, you can then go back in and take out the mode change and it will still work.
And you will need to set up one HHA for each variation.
So not the most elegant, and you May prefer one of the community-created options.
My bad. But then there is a different trick to it, the Hello Home Action can be set to run the lights based on the contact sensor only in specific modes.
The only mildly confusing part is that for the HHA you list the modes when you do NOT want the HHA to run, rather than specifying the one when it does.
The Sonos control can be set separately, but this time you choose the mode when you do want it to run, which will run on the change TO that mode.
So The trick is to have the HHA run in one mode when triggered by the contact sensor and change to a new mode, and have the change to that new mode be what triggers the Sonos. Two modes to get to one scene.
Again, not graceful. So you will probably prefer custom code.
I wish I were that talented. Credit goes to @JoeC on that one. It is simple and it just works for all sort of scenarios that hello home is just too confusing or incapable of.