Motion controlled lights help needed

I’m trying to get something I want to work to actually work. I think I’m going to have to use some virtual switches. Anyways, here’s what I want to do: I have a wemo switch that controls lifx bulbs in the living room through st. I also have a motion sensor that for right now I use to shut off the switch if someone leaves the room for 10+minutes. I want it now so when the switch is on, it’ll turn on the lights with the switch, and I still want it to automatically turn off, but I also want it to turn on automatically with motion only if the switch is turned on.