Sunset/Sunrise issue - Rule Machine

With Basic Rules and Rule Machine, I am attempting to setup a rule with a "time between" condition of sunset to sunrise. However, the behavior is backwards. For example, the below is showing to be "True" yet is is 2:50pm so should be false. I've confirmed correct time in hub settings.

Hmm... Delete the rule and start over. I just tested this in RM and it shows false correctly.

It appears there was a firmware update I needed to apply. Did that along with a reboot and now it is reporting correctly. However, I'm struggling with a particular conditional rule though and could use some expertise. Here is what I'm after:

  • turn on garage light when house door to the garage is opened or overhead garage door is opened
  • only run sunset to sunrise or sunrise to sunset if overhead garage door is closed
  • turn off 5 minutes after house door is closed

I had this rule working in Smartthings automations but am struggling to replicate in Rule Machine


Doesn’t sunset to sunrise or sunrise to sunset mean all the time (if overhead garage door is closed)? Maybe I’m misunderstanding.

1 Like

i probably didn't explain it very well. when it is dark in the garage (i.e sunset to sunrise) or when the garage door is closed (anytime), i want the light to come on when the house door or garage door is opened and turn off 5 minutes later. If it is during the day (sunrise to sunset) and the garage door is open there is plenty of light so i dont need the light to turn on.

I think i have it figured out but need to test. below is what i have right now.

Im not sure you trigger events on your sunrise/sunset are doing what you want. Its triggering at those specific times.

I would

Required Expression
Time Between sunset and sunrise

Door Contacts Open

Turn on lights; wait turn off lights

perhaps i'm not fully understanding the purpose of Trigger events when the same triggers are being defined in the action conditions.

Without triggers, your rule actions will never run (unless run manually, run from another rule, or run from another app via the Rule Machine API). Having a conditional in the actions does not do anything on its own. The condition is just evaluated at the time when it is reached.

It's a little unusual to trigger on an event and then immediately test for the condition (state) that would have resulted from that event, so often you wouldn't need to write rules this way. This is what you did at first. However, because you want to use this rule in a particular way, invoking its actions from another rule but also causing its actions to run in response to a particular event, doing it as you are in the revision is probably the easiest way to get what you want.


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