Motion Lighting turns lamp off in wrong mode

Actually, digging into the code a bit, it doesn't seem to require "physical" after all to recognize that the lights are already on.

Update: Now I can't reproduce the problem. The first time I didn't have the "don't turn off if already on" flag set. Doing it again, it didn't turn off the light.

Since you don't have this Motion Lighting rule installed anymore, it's sort of impossible to troubleshoot what might have been going on. Let me know if you want to check this out again, would be glad to help find the issue.

I have recreated the error. This is a screenshot of my Study routine. If I turn the study lamp on with dashboard then walk into the room, after the delay the lamp goes off.

Could you please do this:

Trip the motion sensor, and then take a screenshot of the app detail page (circle i on Apps page for that Motion Lighting rule). I'm looking for a Setting called "DontTurnOff" near the top of the page and a State variable called "alreadyOn" near the bottom of the page. Post screenshot here.

Oh, and turn on the light before, like you did before.

Here you go.


Interesting. The alreadyOn state variable is not set. That explains why the light turns off again.

I see the problem in the app. It was setting that state only for dimmers, not switches, and your Study Lamp is a switch! This will be corrected in the next release.

Thanks for bringing it to my attention.

5 Likes

Glad you found it. :+1:

This bug has been fixed in the latest release: Hub Update 1.1.3

1 Like

I think the bug fix may have created an inverse bug. I've just tried another Motion Lighting App and now it seems that if you select the "don't turn off if already on" option the lamp never turns off even though it wasn't on before the motion trigger. I've tried with both dimmers and switches and it behaves the same for me. It's not the mode stopping it turn off, because as soon as I deselect the "don't turn off if already on" option it all works as it should. The lamps in questions show correctly as off in dashboard before the motion trigger turns them on.

I will look into this later today, when I can test it.

I just tried this and it works as expected. Make sure you don't also have "Modes for disabling OFF" set.

That's odd. I do have modes for disabling off set, but not for evening mode, which is the one I have it operating in.

This is my rule that works, but if I add "don't turn off if already on" it never turns off

It won't turn off in Evening mode? It's not supposed to turn off in Day, Morning or Night Mode.

That's right. I only want it to work (on or off) in Evening Mode. As it is above, it works OK, but if I select "don't turn off if already on" it doesn't turn off after being triggered even though it wasn't on previously.

You are correct, there is a bug that I can reproduce. Will find and fix it...

1 Like

Found this bug, Argh, sorry this has taken so many iterations. Pesky critter, kept hiding in plain sight. Next release will have the fix.

No problem. Glad you've found the critter and crushed it!

@bravenel

I have just had occasion to create another Motion Lighting App and I think the "don't switch off if already on" bug still exists. Same as above, if that box is ticked for a Generic Zwave Switch device, it stays on even though it wasn't switched on before the motion trigger.

Yes, this bug still exists. It's been fixed in the next release, coming soon.