Rule Machine - Turn Lights on at Certain Time and Off at Certain Time With One Rule

I'm new to HE, can someone let me know if I'm doing this the best way. Keep in mind, I'd only like to do this with one rule.

As you can see, i'm trying to turn lights on at sunset and off at 11pm. Pretty simple:

Simple automation wouldn't do it for you?
I don't have smart bulbs, so I know nothing about the color capabilities.

I'm uncertain why you're particular about having a single rule for this. Rules are free; there's no expense with breaking this up into two rules.

That being said, the rule pasted below will do what you want. Caveat emptor - I don't use Rule Machine, but I think my rule fits your needs.

Untitled

2 Likes

Thank you all for your help. And yes I understand I can create as many rules as I want, but want to not keep so many rules so easy to find and edit, but yes I see your point if a single rule gets too complex. I'll see if this wait for even feature works.

Thanks for your help

1 Like

In your use case above, a single rule would suffice. But in general, if one must use Rule Machine, then multiple simple rules are preferred over a complex one.

Along the same lines, Simple Automation is preferred over Rule Machine, because the app itself is less complex. Likewise, Motion/Mode lighting should be used over Rule Machine when appropriate.

Can you explain how the above would be done in simple automation in a single rule or would it require multiple?

Also what is the general reason for opting for multiple simple automation rule rather than a single more complex rule machine rule?

One SA will do:

Screenshot_2021-03-23 Turn On ~ Arcade mantle lights at sunset

2 Likes

This is way overblown. We're talking about differences of order 100 milliseconds. For a rule that runs twice a day, it really is completely immaterial which app you use for it. You should use whatever you are comfortable with.

I use hundreds of these apps all of the time, and whatever works is a good thing. If someone is beating on their hub so hard that they need to be concerned about app choice, they have much larger issues to face.

2 Likes

I second the Simple Rule advice from the group. I use a Simple rule to turn a set of lights on at a specific time and off at a specific time. Simple direct never fails.
I can post a screenshot later if it helps. I'm not at that console right now.

You must use two triggers:

Triggers are a transient. The associated actions will be run ONLY when one of the triggers occur.
So with the above triggers, your conditions code will run:
Once at exactly sunset.
Once at 11:00PM

UPDATE:
At no other time will the actions be run. Regardless of how you structure them.

To be complete, one could use:

  • Wait for events
  • Wait for conditions

Which can be used to create additional triggers without using the "Select Trigger Events" section of the Rule.

Still the "Trigger" requirement is still the action initiating event needed to run any actions, however they are generated.

This is entirely not true. Wait for Events and Wait for Conditions introduce additional transient subscriptions or scheduled jobs. So the rule starts with the initial trigger event, proceeds to the Wait, and then waits for the next 'trigger', the one created by the Wait.

2 Likes

Yea but....
The OP's original attempt did not address the need for a trigger to run any conditions/actions. So I assumed they weren't aware of that concept. I neglected (for simplicity) that there are multiple methods to create these triggers.

I will update my earlier post.

Oh wow, yes much easier, in the essence of KISS, will use this to manage my standard on off timers. Thank you all for your help!!

1 Like

A thing I like about SA is that it'll name the rule for you (which you can override).

Ok I setup the below SA, any reason why it's not working? See the rule and the event log below? Also, I checked and my mode was day, so it should've worked. I feel like I'm doing something dumb:

It will be something simple, nothing dumb on your part. But we may all have another Ah ha moment...
It looks to me if the devices are always powered switches, or bulbs who's power has not been interrupted, they should turn on at 8:10 PM and off at 11:00PM. I'm not sure about the Restriction "Only when bypass, day, evening, morning, night". Is there a mode that you don't want the lights coming on at 8:10PM? Or what is the intent of that mode restriction entry?
The items that come to my mind are; that restriction, power not being on to the device or the time settings (the hub matching the world), and the "color" settings. I have a Sengled color bulb that works but the system doesn't seem to know it works. It will turn off and on correctly, but it does not seem to report its status well enough to trigger anything else.

I'll offer my thoughts. I sometimes tend to use a trial and error approach. Simplify this much further, just to test it out. Use as few devices, restrictions and conditions as possible and see if it works. Then add additional devices (lights) and if it continues to work, refine with your desired restrictions. That may be a crude and cumbersome method but for my simple, methodical mind, it works for me when I'm having difficulty identifying the issue.

Other, much more savvy members may have to offer deeper help for both this and your other post concerning these similar issues.

For what it's worth, the is my Simple automation. Always works, hasn't failed me yet.

A bit of overlap from your "Motion Lighting" post...
One possible solution may be to group all those lights into a single group. Then use that group rather than all the individual lights in your rule. That may then be seen as if any are on. Secondly, I believe I have seen a button or toggle in either RM or Motion Lighting, one of them somewhere to tell the rule "if one is on, consider them all on". or something like that. That too may help the rule know lights are on.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.