Manual and adaptive motion trigger based on time and weekday


New here and not at all sure where I should post, there are quite many categories. Please advise, or move if inappropriate. Thanks.

I have yet to receive my first C-7 hub, hoping any day now, migrating from several legacy units. I have with them tried to make an automation/scene that acts differently pending on time of day/night and motion. Easy you may say? Please keep reading. How would you guys solve this with just one automation? Is the Hubitat up for the task?

It should be able to control a lamp like so;

Manual trigger

When OFF and triggered by anything but motion (such as a switch), and time is between X & Y weekdays:
– dim-level set to 30%, and stays on at minimum 30% until manually OFF or by other timer.

Turn light on by movement

When OFF and triggered by motion at night between time X & Y weekdays:
– dim-level is set to 30% and turns OFF after Z minutes

Raise light level temporarily on movement

When ON and motion detected between time X & Y weekdays:
– dim-level is set to 50% and back to 30% after Z minutes

It would probably be easy to create separate automations that do one of the above at a time, but how do you make sure they don’t interact/interfere or block each other? Therefore I would like it to be one automation handling it all.


I am pretty sure you can do this with one rule in Rule Machine. I don't usually advise that people start out with RM, it is a pretty complex app. But in this case it might make sense. However, I would probably start out with just motion lighting or a portion of your desired automation until you are more comfortable using Hubitat.

There also might be community contributed apps that can handle some of this. I haven't really searched for this specific thing, so you might want to look around and see if anyone else has something that will meet these needs.

Your other option is you could write your own app, but that is way beyond what me and most people are capable of, but it is an option if you wish to do so.

With all that being said, I would start out by getting my modes correct and working the way you want. Modes can be set for times, days, and so on. It will greatly simplify things if you can have a light do something by mode rather than having to set days and times every time you set up a new automation.

1 Like

Thanks for confirming, or sort of. I do realize RM is a complex thing, but also why I got interested in Hubitat. All devices have their limitations, or thus far anyway, having not explored the Habitat yet. I have read some though and there is much, much more to learn.

I will do as you suggest, start small and build upon it. Modes sound like another powerful feature. I will read the link you posted tomorrow.

Writing an app also sounds like fun, pending on the language Habitat uses for that, may be over my head as well, but may well be an option. So far I have not found a single thing I don't like about Hubitat, really hope it works out the way I hope. :slight_smile:

Thanks again.

1 Like

You can defiantly do what you want with motion lighting and RM or simple automations and the use of modes.
With some of the restrictions you can put in place it should be easy enough to stop the rules interfering with one another.

1 Like

On a mobile so sorry if formatting is crazy. First run at this I would create a virtual device called LampManual and when you use a switch or button controller also turn on the virtual device.

Trigger: Motion1 active

Cancel delayed actions.
If time between x and y
    If LampManual on
        Set Lamp1 50%
        Wait for event Motion1 inactive
        Set Lamp1 30%  -> delay 3min cancelable 
        Set Lamp1 30%
        Wait for event Motion1 inactive 
        Lamp off -> delay 3min cancelable
    End if
End if

Thank you! This looks like a really good staring point. Having not received my unit yet, if I wasn't eager before, well... :smiley: Can't wait to start fiddling with it.

1 Like

It might not work 100%!as expected the first time but its a good starting point.

I only have two rooms that I disable motion control in and have a specific switch (the scene button on inovelli reds) to toggle motion enable or disable. Other than that the whole house is on motion.

Because I use a virtual switch to toggle this I can use simple automation or motion lighting instead of RM.

However it may be difficult to achieve all of these parameters in those programs.

1 Like

Agreed. It is a tough nut to solve, but a challenge... :slight_smile: I will read up on the different ways of doing things, but a little hands on to begin with is always fun. Is there some best practice to consider when starting fresh?

You'll want to start with the simple automation app and the motion lighting app as these pretty straight forward to use.
RM really only needs to be used if these can't do what you want not he first port of call.


Thanks everyone! You have been very helpful, and I am really tempted to start trying this now. :+1:

1 Like