You could try something along the lines of a venus fly trap. Venus fly traps have modified leaves (the kind with "teeth" people often associate with the plant) when they can't get enough nutrients from the ground. When there's plenty of nutrients, those leaves don't even form.
As for your plants, you could have their roots capable of ensnaring prey and absorbing nutrients from said caught prey. The light, then, would act as a lure for prey. When there are plenty of nutrients in the ground, the roots would not have to dedicate energy to creating the chemicals needed to cause luminescence. But when nutrients are hard to come by, the lights go on!
Now, this would effect your ecosystem. You'd have to have life that would actually be caught by these plants. They can't have a system to catch prey if no prey exists. So, while you don't necessarily have to go into detail of creating a life form, you could briefly describe some "creature" being caught in the roots, obviously dead, looking as though drained. Or something like that, anyway.