Using Built in Motion App, plus luminance

Here's the thing I'm trying to do:

  • Switch on a bunch of lights using the built-in Motion App.
  • Once they're on, control their level by luminance sensors (I'm using Webcore for this bit) BUT to stop them coming on without motion, the luminance will only operate on the lights if they are already on

Both of these I already do very successfully. However the thing I'm blocked with is:

  • If the lights are turned off by exceeding max lux, but then lux drops back into band, turn the lights back on even if motion has not stopped (currently of course the overrides on the Motion app mean the lights will only come back on if Motion stops and restarts)

So my question is, how do I use the two separate methods to control the state of the lights in the right way at the right time????