Motion and lux sensor with relay or switch to turn lights in

I would recommend starting with CoRE. You can create a simple piston with conditions. “if main lights on, then turn off cabinet lights”.