Can the 'Motion Lighting App' do this logic?

I'm new to HE but have been diving in deep in all the documentation, so I think I may have to do something like this with a Rule Machine rule, but wanted to ask before I went down that path...

I have a bathroom light tied to a motion sensor. I want the bathroom light to turn on at 9pm at 25%, and then dim to 5% at 10pm. When motion is detected during the night the light would go to 25% then after a minute or so back down to 5%. So it would stay on and not the typical 'delay off' after so many minutes. And then the light would turn off completely around 8am.

Would this have to be done in Rule Machine?

I did the same thing with my cabinet lighting in my kitchen. With some thought, you could probably do it in motion lighting. It would be several rules. I will share my rule from rule machine. Maybe that will help you. It's worked well for a long time. I have simple automation rules turn the light on and sunset -60 and off at sunrise +60 and then I have rule machine control the rest
The rule shows it's missing a trigger event because I removed it and it left that, but does no harm to the rule. I also have a virtual device in there that doesn't need to be there. I was swapping equipment and used a virtual device to keep from breaking my rule during that time. Looks like it never got removed.

I'd do it as 2 rules in RM.

Rule 1

Trigger
motion Active
Actions
Cancel delayed action
bathroom light 25%
wait for motion inactive
bathroom light 5% delay X seconds

Rule 2

Trigger
9pm
Actions
bathroom light 25%
wait for event 10pm
bathroom light 5%
Unpasue Rule 1
Wait for event 8am
bathroom light off
Pause Rule 1

Thank you guys so much! I got it sorted with your help, amazing.
Questions I came up with during the process...
When setting the actions, there is the 'create conditions' options below. I was trying to set the actions in there but it never worked, your methods were the right ones. So what exactly would one use the conditional actions for if you're already set up triggers?

You use them to restrict when the actions happen.

Say you wanted Rule 1 to always be on and you needed to stop it for some reason.
If it started with:
if virtual switch is off then
do actions
else
do nothing
You could stop the lights changing by turning on a virtual switch.

Thanks! Also in the first rule, why does the first action need to be 'cancel delayed action'? I put everything in but the lights were still on this morning at 9 when they should have been off. For the action to actually turn them off, does 'set dimmer to 0' work? Or is there another action to use?

Cancel makes the delay go away. So if you walk into the room, motion triggers lights on. Then you walk out, motion stops. Easy so far.

The motion off starts a timer. The lights turn off after X minutes, no matter what. You return to the room, the lights turn off from the previously running timer.

With Cancel, you return to the room, and the timer resets. And resets again if needed. The lights stay on until you are truly not going back and forth into this room. So you want to cancel right away in the rule to let the motion re-trigger the rule.

Dimmers are both dimmers and switches. And generally, setting dimmer to zero is not really off. If you want off, use Switch>OFF in your rules.

1 Like

Dimmers can also struggle in the lower ranges so you may find that there is no difference in brightness between 0-20%.

Thanks much for shedding more light on that! So the motion sensor stays on throughout the day, and itโ€™s not going off in the morning at 8am, I canโ€™t quite get it to work. Am I missing a rule somewhere? Do I need to do a simple automation for motion sensor on/off at a certain time?

You mean the actual sensor, or the rule?

Sorry, the light is staying on past 8am, and the motion sensor keeps triggering it as well.

I would try this app first. Rule machine will work, but this might be a much easier option.

If that doesn't suit you, then Rule Machine can be revisited.

Here is a screenshot of my on/off rule:

And motion sensor rule:

Gotcha! Just saw your post after I added the screenshots. I'll definitely check that out. Thanks so much! I feel I'm super close because of everyone's superb help, thank you!!

That is not how I would have written that, but I am not an expert in rules. I am just OK with them.

I am not quite sure about some things in there like the Pause, I don't think that is working like you intended. And Dim 0 is not off, so that might be causing issues.

I can show you what I did in a similar situation, however mine looks quite similar to April's above.

That'd be great! How do you get to that screen like April shows? with the actual programming language?

Screenshot. In Windows, the command is CTRL> Print Screen. I just use basic Paint to paste and crop. I crossed out the parts you don't want (light colors).

At the very least, the base logic is here (IF, ELSE, ENDIF).

Awesome, thanks! I just meant, in the Hub settings, how do I show the screen with all that logic like that. I feel like i've come across it before, but the rules in my rule machine don't look like code.

If you are using Rule Machine, once you enter the rule, (click on the name of rule in Apps) it should look exactly like that. Nothing special otherwise.

Are you using conditions? I don't have those screens, craziest thing.