It's late and I'm tired...and I had an automation that used motion lightening and rule machine to do the following
So when motion is detected and it's within those parameters of modes, then turn lights on, but then I had a section to say if the TV is on then disable turning off and also a switch to turn off lights.
I then had a rule machine to turn off the virtual switch when the lamps (side lights) turn on.
for whatever reason I deleted my groups (by mistake) and it messed up some rules, so I recreated them from screenshots I'd taken and it no longer works. Lounge Lights turn on and stay on if TV is on (which is good), but when the lamps turn on the lounge lights stay on...Now if I remove the 'Disable off turning off' option it works again, but I had it exactly he same as before.
Edit: I used to have this as a single rule in rule machine, but I kept wanting to mess with it, so moved it to motion.