Turn off entertainment area and turn on lights only if they were being used

I have an entertainment area and when I go to sleep, I want it to remind me by turning off the entertainment area and turn the lights to red for example.

But when I automatically stop the entertainment program, it turns the lights off, so I can’t use the state of the lights as a trigger afterwards.

When I turn the lights on automatically, well they turn on every evening, and well I don’t want that.

Only when I used them with the entertainment area, or when they were on to beginn with.

Is this possible?

Thanks in advance