Motion Lights - Nearly there

I am nearly there with my first habitat 'project', which is to control my garden lights. Nearly, but i have one last thing to sort out!

The lights are on a schedule, on at sunset 100%, dimming down soon after, dimming to 1% overnight and then turning off in the morning. What i am trying to do is bring them up to 100% if motion is detected outside whilst they are running through the program, and then revert to the program after motion has stopped.

I have the 'bring them up to 100% bit sorted' but am struggling after that. I can't even get them to stay on, even though it looks to me like that's how i've set it. Screenclips are below and any pointers will be gladly received. The schedule is done in rule machine, the motion is done in motion lighting.


This would work with two rules, one like you have above to do the dimmer changes as the night progresses, and the other to do the motion on/off. Use a single Global Variable in Rule Machine to keep track of the current dim level. That way, the motion rule can set the lights to 100 when there is motion, and then set it to the current dim level when the motion stop.

First, the dimming rule you had above, cleaned up a little:

And below is the motion rule:

Got it. I will have a go at this in the next day or two and report back in. Thanks for the help!

@bravenel I had a quick look at this, the only bit i can't figure out is the last line of the motion sensor rule. I can't see how you've set the dim to the 'fade level' variable rather than an actual value?

Not dark here for another 9 hours or so so can't test anything yet :grin:

You can reference the variable with %variable-name%. So that goes in the field where the dim level number would go.

Thanks @bravenel - i have it all punched in now so I will see how it goes and confirm. So essentially the lighting schedule is just writing a global variable each time it operates a dimming step, and when the motion lighting routine finishes it simply reads this variable in as the value to revert to - have I understood that correctly?

If i have, we'll have to see if i've programmed it correctly next!

Yes, that's the way it works.

Ok, tested and it looks like it is all working as i hoped - really appreciate the help there @bravenel.