Heos - group and ungroup rule

TL:DR
Can we use OH to group/ungroup Heos speakers based on a variable (Active source/TV being or similar)?

Detailed question
I have an instance of OH running on an raspberry Pi and it really fits my needs nicely. It’s not anything fancy but just a way to easily control my lights and outlets (Sonoff with custom firmware), but I would like to extend the functionality.

I have multiple speakers from Heos and have installed the Heos Bridge. At first glance it worked, but in the long run it seems not to be updating/reacting to input. I suspect the culprit is that I turn off my speakers when I dont use them, and this might be an issue for the bridge to work properly. But in the future I will be having at lease one speaker plugged in 24/7, så that - hopefully - fixes that.

Now here’s my real problem: My Heos (ceol 10) is plugged into the TV and it works perfectly fine on it’s own, but whenever I turn on one of the other living room speakers there’s a delay due to the audio from the TV being streamed over wifi to the secondary speakers. This is a limitation in the system that we really cannot do anything about. I can live with the ceol 10 being the only speaker for the TV, but I would very much like the other speakers to play in sync when playing from spotify - this works perfectly fine without any delay.

So I was thinking if I could use OH to group the speakers whenever the TV isn’t on (I already check for this) or even better depending on the input source of the ceol 10 (ungroup when input = TV otherwise group)?

Any input is highly appreciated!

Alright I did some digging and testing last night. So far I’m able to group/ungroup my speakers manually without much hassle. I have also created a thing that reads the input status of the speaker connected to the TV.

So all in all I “just” need to create a rule to flip the switch to group/ungroup based on the input status. But I’m not very familiar with how to go about that, the paper UI rules does not seem to be flexible enough. Can anybody offer a bit of help on how to write rules manually? (Yes I have read the FAQ/toturial on rules, but I’m still a bit lost) :slight_smile: