Issue with Motion Lighting rule and "Don't turn on if turned off manually" option

Hi guys,

I'm trying to set up a rule for turning the lights on in a bedroom based on a hue motion sensor and a combination of current mode and lux:

Everything seems to work well so far, except for the "Don't turn on if turned off manually" rule. The idea behind the rule is if for example I have sleeping children in the room I can turn the lights off and they won't turn back on until the next mode change. Sounds good in principle but so far it seems to stop the light from turning on a lot of the time!
I use a manual mode change as a way to reset the state of the rule and re-test, but even after doing that, the light won't turn on.
Here's an example log snippet:
app:702020-06-28 08:44:14.276 pm infoNot turning on: lights not on at mode change

[app:70](http://192.168.1.10/logs#app70)2020-06-28 08:44:14.239 pm [info](http://192.168.1.10/installedapp/configure/70)Mode change to EveningLate

[dev:130](http://192.168.1.10/logs#dev130)2020-06-28 08:43:53.276 pm [info](http://192.168.1.10/device/edit/130)Hue Motion Sensor 1 Studio is inactive

[dev:130](http://192.168.1.10/logs#dev130)2020-06-28 08:43:43.216 pm [info](http://192.168.1.10/device/edit/130)Hue Motion Sensor 1 Studio is active

[dev:130](http://192.168.1.10/logs#dev130)2020-06-28 08:41:25.098 pm [info](http://192.168.1.10/device/edit/130)Hue Motion Sensor 1 Studio is inactive

[dev:130](http://192.168.1.10/logs#dev130)2020-06-28 08:41:15.085 pm [info](http://192.168.1.10/device/edit/130)Hue Motion Sensor 1 Studio is active

[dev:130](http://192.168.1.10/logs#dev130)2020-06-28 08:41:07.877 pm [info](http://192.168.1.10/device/edit/130)Hue Motion Sensor 1 Studio is inactive

[dev:130](http://192.168.1.10/logs#dev130)2020-06-28 08:40:13.564 pm [info](http://192.168.1.10/device/edit/130)Hue Motion Sensor 1 Studio is active

[app:70](http://192.168.1.10/logs#app70)2020-06-28 08:40:06.347 pm [info](http://192.168.1.10/installedapp/configure/70)Cleared 'Don't turn on if turned off manually'

[app:70](http://192.168.1.10/logs#app70)2020-06-28 08:40:06.333 pm [info](http://192.168.1.10/installedapp/configure/70)Not turning on: lights not on at mode change

[app:70](http://192.168.1.10/logs#app70)2020-06-28 08:40:06.306 pm [info](http://192.168.1.10/installedapp/configure/70)Mode change to EveningEarly

[dev:41](http://192.168.1.10/logs#dev41)2020-06-28 08:39:22.445 pm [info](http://192.168.1.10/device/edit/41)Group Studio was turned off

[dev:130](http://192.168.1.10/logs#dev130)2020-06-28 08:39:22.222 pm [info](http://192.168.1.10/device/edit/130)Hue Motion Sensor 1 Studio is inactive

[app:70](http://192.168.1.10/logs#app70)2020-06-28 08:39:13.964 pm [info](http://192.168.1.10/installedapp/configure/70)Lights off, will not be turned on due to 'Don't turn on if turned off manually'

[app:70](http://192.168.1.10/logs#app70)2020-06-28 08:39:13.943 pm [info](http://192.168.1.10/installedapp/configure/70)Hue ambiance lamp 1 Studio turned off

[dev:40](http://192.168.1.10/logs#dev40)2020-06-28 08:39:13.828 pm [info](http://192.168.1.10/device/edit/40)Hue ambiance lamp 1 Studio was turned off

[dev:130](http://192.168.1.10/logs#dev130)2020-06-28 08:38:43.552 pm [info](http://192.168.1.10/device/edit/130)Hue Motion Sensor 1 Studio is active

[dev:130](http://192.168.1.10/logs#dev130)2020-06-28 08:38:11.868 pm [info](http://192.168.1.10/device/edit/130)Hue Motion Sensor 1 Studio is inactive

[dev:130](http://192.168.1.10/logs#dev130)2020-06-28 08:37:59.111 pm [info](http://192.168.1.10/device/edit/130)Hue Motion Sensor 1 Studio illuminance is 0 Lux

[dev:130](http://192.168.1.10/logs#dev130)2020-06-28 08:37:38.963 pm [info](http://192.168.1.10/device/edit/130)Hue Motion Sensor 1 Studio is active

[dev:130](http://192.168.1.10/logs#dev130)2020-06-28 08:37:24.135 pm [info](http://192.168.1.10/device/edit/130)Hue Motion Sensor 1 Studio is inactive

[dev:41](http://192.168.1.10/logs#dev41)2020-06-28 08:37:22.319 pm [info](http://192.168.1.10/device/edit/41)Group Studio level was set to 25%

[dev:130](http://192.168.1.10/logs#dev130)2020-06-28 08:37:14.063 pm [info](http://192.168.1.10/device/edit/130)Hue Motion Sensor 1 Studio is active

[app:70](http://192.168.1.10/logs#app70)2020-06-28 08:36:57.109 pm [info](http://192.168.1.10/installedapp/configure/70)Hue ambiance lamp 1 Studio set to 25

[dev:40](http://192.168.1.10/logs#dev40)2020-06-28 08:36:56.954 pm [info](http://192.168.1.10/device/edit/40)Hue ambiance lamp 1 Studio level was set to 25%

[app:70](http://192.168.1.10/logs#app70)2020-06-28 08:36:56.563 pm [info](http://192.168.1.10/installedapp/configure/70)Setting colorTemp [Hue ambiance lamp 1 Studio] to 2000 at level 25

[app:70](http://192.168.1.10/logs#app70)2020-06-28 08:36:56.486 pm [info](http://192.168.1.10/installedapp/configure/70)Setting dimmers [Studio Downlights] to 0

[app:70](http://192.168.1.10/logs#app70)2020-06-28 08:36:56.437 pm [info](http://192.168.1.10/installedapp/configure/70)Mode change to Evening

[dev:130](http://192.168.1.10/logs#dev130)2020-06-28 08:36:49.383 pm [info](http://192.168.1.10/device/edit/130)Hue Motion Sensor 1 Studio illuminance is 1 Lux

[dev:130](http://192.168.1.10/logs#dev130)2020-06-28 08:36:49.353 pm [info](http://192.168.1.10/device/edit/130)Hue Motion Sensor 1 Studio is inactive

[app:70](http://192.168.1.10/logs#app70)2020-06-28 08:36:46.829 pm [info](http://192.168.1.10/installedapp/configure/70)Hue ambiance lamp 1 Studio set to 10

[dev:40](http://192.168.1.10/logs#dev40)2020-06-28 08:36:46.695 pm [info](http://192.168.1.10/device/edit/40)Hue ambiance lamp 1 Studio level was set to 10%

[app:70](http://192.168.1.10/logs#app70)2020-06-28 08:36:46.585 pm [info](http://192.168.1.10/installedapp/configure/70)Cleared 'Don't turn on if turned off manually'

[app:70](http://192.168.1.10/logs#app70)2020-06-28 08:36:46.312 pm [info](http://192.168.1.10/installedapp/configure/70)Setting colorTemp [Hue ambiance lamp 1 Studio] to 2000 at level 10

[app:70](http://192.168.1.10/logs#app70)2020-06-28 08:36:46.249 pm [info](http://192.168.1.10/installedapp/configure/70)Setting dimmers [Studio Downlights] to 0

[app:70](http://192.168.1.10/logs#app70)2020-06-28 08:36:46.213 pm [info](http://192.168.1.10/installedapp/configure/70)Mode change to Night

Questions:

  1. Why is it not working the way I expect it to work?
  2. Is there a better way to reset the rule?
  3. At what point does a rule become too complex for motion lighting app? When it does, where is the best place to re-configure it in? Rule Machine? App Code?
  4. Is there a way to duplicate Motion Lighting rules?
  5. In many places I've seen an example of a Rule Machine code (such as this). Is that just a simple way to explain how to set up a rule through the UI or is there a way to paste that sort of code to generate a rule?

Many (many!) thanks :slight_smile:

Update: maybe I blamed that option needlessly. It seems that even with the option off, if I turn the lights off (at the switch) they won't come on when motion is detected. This is obviously not great and I can't figure out how to make them come on again through motion...