Lights bright on motion, then back to original state (dim)

First of all, I'm brand new to all of this, and I'm just trying to understand. The logic makes sense to me in some ways, but in others it doesn't. I've played with a lot of rule making, and I'm as confused as ever. I've actually had a rule for these actions working in rule machine, but added some wrinkles to it, and couldn't figure out to write in the wrinkles. Since I re wrote for the wrinkles I can't make any of it work now. So at the risk of feeling stupid yet again, I'll ask:
The scenario I want is to have my lights on dim from sunset to 2245. Then from 2245 to sunrise only a select few to be on dim. So kind of an evening/sleepy time thing. I have simple rules already set up for these times, with the appropriate lights on with the brightness I want. I have 2 motion sensors and I want either sensor to trigger all of the lights to go bright for a 7 minute delay if there isn't any other motion, then return to the previous condition (either all lights on dim, or select lights on dim and others off. I only want the lights to go bright between sunset and 2245 and 2245 and sunrise. In other words I don't want this action to happen at noon.
Basically dim lights for ambience and security while it's dark, and if someone trips the motion sensors, everything bright with illusion I've either seen their presence and turned on the lights, or I've woken due to their presence and turned on the lights. Then after the threat has left, return to the previous lighting.
I thought I had it today, but now nothing happens at all.
My rule was as follows:
IF motion AND time parameter THEN lights bright
IF no motion AND time parameter THEN lights back to dim after 7 minutes

If I run the action after building it it works if no time is added. Once I add time in, it stops working.

Would this app below work? It isn't Rule Machine, but for a newer user it might be easy to start this way and work your way into Rule Machine. This is a fairly complex thing you want, and RM can do it, but probably not a good way to learn.

1 Like

You could use @bptworld 's Event Engine. It has a "Permanent Dim" option to just that. Dim when no motion and bright when motion. @bptworld has just added lots of Motion Lighting features in his app.

He also has Room Director with the same option but less flexible.

1 Like

That's sounds like it'll do what I want it to do. Now I just have to figure out how to install an app that isn't already in the app list...hoo boy, learning tho.

Thanks yannick. I'll check it out.

You have a couple options. First would be to do a manual import of the code: Apps Code - Hubitat Documentation

You also could use Hubitat Package Manager app. You would also have to install HPM the same way as outlined in that link I posted above. But once that is done, you can just use the interface in HPM to do the install of the Lights On app, as well as many more apps and device drivers. And HPM can do updates and other things more automatically or easily, and notify you of updates. It really is the easier way once you do that initial "manual" importing step.

I am doing something similar... here are my rules

This one turns the light on and sets the Boolean in my motion rule letting my motion rule know the lights are on

This one turns the lights off, and sets the Boolean in the motion rule so that the motion rule knows to that the lights should be turned back off it it turns them on.

This is my motion rule that returns the light to the state it should be in based on the the status of the Boolean

This is what I wrote last night, but I can't seem to get it to work.

I am starting to understand the user app installation, I think. I find RAW code to make the most sense to me, and I see what is called Parent and Child code and the Hubitat Apps Code Documentation doesn't address this. From what I've read, you have to install the Parent first, then the Child. So I'm stuck. I've imported the Parent, but from there I'm not sure where to go. Sorry to be so stupid. Just not my milieu...

If it is a parent and child setup, you need to import the parent first into app code, and Save. Then starting back at the app code main page, import the child ones into app code as many times as there are child apps. In the case of Lights on Motion Plus, you will import a total of two things (one parent, one child) into apps code.

From there, you then just install the app itself like you did Rule Machine or anything else, but using the User app instead of Built-in app button. You won't install the parent and child apps separately, the one install takes it all into consideration.

Thank you for your patience with a noob. Believe it or not, I'm learning. I'll keep this as reference material for the future.

1 Like

Loading User apps video.

Thanks, that'll be my best learning method. I did manage to get bertabcd1234's app loaded, I'll be messing with it tonight! I'm trying to figure out all that happened last night (my hub lost it's IP address too) I'm also seeing in the logs that both of my motion sensors, while not saying they're off line, haven't had an event on one since morning yesterday, and afternoon yesterday and I shoveled in the presence of one, and drove in front of the other this morning. I might have to remove both of them and then reinstall them.

So, stupid me forgot to remove the Hue Outdoor Motion Sensors from the Hue app after I reset them and installed them in HE. Dunno how it happened but the Hue app turned them off, and that affected their performance, basically nullifying it. So I removed them from the Hue app. Then I went to writing a rule in rule machine.

I tested this rule with the delay time set at 01:00 minutes several times. It worked every time. The lights would go bright with motion of either sensor, then after a minute they would return to their previous state. Hallelujah! So I upped the time to 07:00 minutes and figured I was done. It worked once and hasn't worked since. So today I went back in, and edited the delay back to one minute. Like a charm, 3 x in a row, like a charm. So I upped the delay to 5 minutes, still like a charm. So my rule works. I'm basically happy and I'm just working out a couple of interferences, like the change from evening to night where I only leave one porch and one garage light on, but on movement light the world up, if a sensor detects motion on evening, and in the 5 minute delay, the rule changes to night, the capture wouldn't apply anymore, I think I'm too close to this and I just can't find a solution, or if I really even need a solution.
The real reason I share this, is wondering if anyone has a theory as to why 7 minutes would only work once then never again, but 1 or 5 minutes seems to work just fine.

Download the Hubitat app