Rule Machine - Motion

I want my motion to only work between 8:00 am and 11:00 am. Outside that time frame I do not want it to fire and turn the lights on.

Required expression.

2 Likes

Is there a reason you're using Rule Machine for this? The above is one possible solution, but if you just want to turn a light on (and eventually off) between certain times, I would suggest another solution. Mode and Motion Lighting was built for this, even if not receiving active development anymore, but Basic Rule or the older Simple Automation Rules app can handle it with ease (Basic Rule would be my suggestion).

All have built-in options for time or "restrictions" that can handle what you want -- and that free you from the task of creating such logic yourself, which can be a struggle in Rule Machine if you are not familiar with its features.

3 Likes

Thanks I have a lot of rules with just the Basic Rules but sometimes I have to make more than one rule to get it to turn on and off sometimes. Just looking for a way to make it a bit easier.

Not sure I understand after looking back on the rule it looks like it is True.

What do you mean with this?

Is it currently between 8 AM and 11 AM in your time zone? Presumably, yes -- that's just Rule Machine showing you the current, evaluated value of the expression (at the time of page load).

However, you're also using the wrong feature, at least if you're trying to do what the other poster above suggested. (You could do this with conditional actions, too, but it's not clear that you intentionally changed your mind.) You'd need to enable the option to use a required expression, then specify your expression (including the conditions you need to build it, similar to your screenshot) there. As described in the docs, the rule will trigger only if the required expression is true.

But, again, there might be a simpler way to do this if you clarify the first thing above. :slight_smile:

2 Likes

Thank you so much for all your help. Here is a screenshot of my kitchen motion. It works fine, I was just trying to put it all under one rule. The other screenshots I provided is a test for my Office Light Motion to turn on my Office Light between 8 and 10 am everyday.

Kitchen Motion Screenshot:

I don't see a screenshot of any actual rules. Maybe you missed something? (We'd need to see the rule itself, not the name.)

This is what matters. :slight_smile:

This matters less. :smiley:

There is no inherent reason to prefer one larger, more complex rule over multiple smaller, simpler rules, but there is some reason to prefer the latter, as they are generally easier to write and troubleshoot. And because you have something that works now, I would not suggest changing things just because.

But if you are curious to learn more, seeing what your current automations actually do would be a good start. It is still quite likely that e built-in app that isn't Rule Machine would meet your needs and be easier to set up if Basic Rule can't do it, but we'd need to know more about your automations first.

2 Likes

Here is the screenshot of my Kitchen Motion for Lunch time.

What do you want to do that isn't possible? I assume this rule works as intended? It sounded like you wanted help with something, so we'd need the complete picture (literally or described) to do that.