Lights are turning off even when switch to disable is on

I’ve been using this motion lighting app for my hallway lights for a while. I have a motion sensor on either end of the hallway. It works well.

I just tried adding a switch to disable off (when on) “ZAlexa: switch hanging laundry”, but it seems even when that virtual switch is on the hallway lights are still turning off automatically after 1 minute of inactivity.

Here’s the app:

Any thoughts? Thanks!

Are you saying that if the switch is turned on during that 1 minute countdown the lights still turn off, or it doesn't matter when the switch is turned on, the lights still turn off even sometime later?

1 Like

I'd also suggest trialling this in Room Lighting, to see if options there may have been introduced / adjusted to cater for this situation, I suspect they may have. You could leave your ML setup in place and just Paused while you test out RL. You should (I think) also be able to import the ML rule into RL.


If the switch is turned on a few seconds before motion, a few seconds after motion starts but before device times out motion, or during the 1 minute after that, in all those scenarios, the lights are still turning off.

Then I suspect the option you chose is only disabling the "triggering" of the turning off, where the start of the 1 minute countdown would be seen as that trigger point. Though your comment about immediately before / after motion is also an odd situation.

My suggestion would still be to give Room Lighting a go, but before you do it may be worth turning on any logging you can in Motion Lighting. The logging there and in RL is often quite verbose and may provide some hints as to what is happening.

1 Like

Thanks. Started to try room lighting. Got an NPE (new thread about that). Will look into more logging to debug.

Yeah, saw your post about RL, shame.... Good to pass on the error to the dev's, though your rule is simple enough it may be a good exercise to go through the steps of creating it from scratch in RL, as much as it would have been nice to not need to do it... Up to you.... See where the debugging gets you...


Okay, I re-created the automation in Room Lighting. It's working somewhat. It's not always turning on or off, I wonder if it's because my Inovelli Reds have never been the most reliable for me. Still playing around... I do like that I can customize the times per day (weekends later start).

Two things I'm curious about:

  • If the lights are scheduled to turn off (I even see the scheduled job in the logs), then is it too late for a switch turned on to disable the lights from being turned off? Or is that switch status checked after the delay (1m) before turning off?
  • What's the difference between "Limit Turning Off under these Conditions: Switch is on" vs. "Disable/Re-Enable Turning Off upon these Events: Switch is turned on/off"

Regarding flakiness of the lights even coming on with motion: here's where the logs indicate basically that motion was detected by the app but the light itself didn't have it's level set:

If it helps, here are all the details for the app:

I think "Act" unchecked for Nightime period is what I want?

I take back what I said about Inovelli flakiness -- I just re-enabled motion lighting and it is consistently working fine.

There was a conversation about this in the last couple of months, I'll see if I can find it. Essentially, the "Limit..." option allows you to stop turning off lights based on the state (or combined state I think) of a device or some value, whereas the "...upon these Events..." option allows you to control the turning off of the lights based on an event. So for example, if you have a virtual switch that is always on during the time where you don't want the lights to turn off, use the "Limit,,,," option, but if you have two very separate events that you want to control the turning off option, like the pressing of a button or a change in mode, then you could use the "... Events..." option.

Here it is....

Ah, fair enough, so Event with switch on/off is overkill and ostensibly the same as Limit, if the same switch. If you want distinct items, then Events are helpful.

Any ideas on the configuration and if something looks different from my Motion Lighting that would cause motion not to turn the lights on reliably?


The second round of activation starting at 8:33pm does not include the setLevel log entry. Are you saying the first activation and turning off between 8:27pm and 8:29pm worked as you expected, then the second activation did not turn the lights on?

The config looks fine BTW, at a glance...

Looking again at your screenshot, the RL app seems to be reporting the lights as On currently, which could be either you needing to refresh the page, or the lights (switch) not reporting correctly. There is an option to force that, which you may want to use.

You may want one or both of these:


If you click through the screens the options are available here:

Oooh, I'll try that additional option. Thank you for the pointer!

Regarding the original issue, I manually copied the motion lighting app into a new one and it seems to be respecting the laundry switch to disable off now. Not sure that anything is different. I had mistakenly clicked "Use settings per mode?" on the original motion lighting app, and I don't see a way to go back to what I had, same settings for all modes. But I think my testing when I started this thread was before I switched that slider.

Are you saying the first activation and turning off between 8:27pm and 8:29pm worked as you expected, then the second activation did not turn the lights on?

Yep, exactly.

From testing with the new motion lighting app I created, it seems the disable-off switch is working regardless of whether I set that laundry switch to on before/during/after motion, which is what I want.

I do wish there were a way when the laundry switch is turned off (which I want to be 15 minutes after turning on, enough time to deal with the laundry) to evaluate if there is, at that time, any hallway motion, and if not to turn off the lights then. But I imagine that's not so standard and would require Rule Machine. And I don't want to build that...


I had a similar requirement recently. Not the nicest solution in some ways, but what I did was setup a virtual motion sensor and add it to a Zone Motion Controller setup (a built-in HE App, you could use others if you wish). In your case when the switch turns off, setup a small rule to activate the virtual motion sensor. I also configured the sensor to have a short timeout, so soon after the switch is turned off, the trigger to turn off the lights in RL will kick in. It won't turn off the lights immediately, but will allow motion shortly after to keep the lights on.

That's clever. Naming conventions get so hard to remember all the various apps/devices you have to create to workaround things like this. But it's obviously better than nothing to be able to do it all.

I'm still testing RL to see if force on/off is all I need for it to work.

I did have a little side-project I was working on a while ago to develop an app that would allow grouping together Apps and Devices that are related in whatever way you decide. I have the same situation where the lighting for a room may involve various Apps and Devices, so it would be nice to group them all together in the one place.

Download the Hubitat app