Help selecting "AND" vs. "OR" default trigger condition

Just starting with Hubitat and exploring capabilities of Rule Machine. I would like to turn on a light for 5 seconds every minute when it is night. When I select the mode of Night and the interval of Minute, rule defaults to the "OR" condition rather than the desired "AND" condition. Can't seem to find the way to change this. Please point me to the appropriate documentation for RM4.

Your trigger would be the time interval and then in your actions, you'd check to see if the mode is night. If it is, do stuff. If it's not, don't.

The mode cannot be a trigger. The mode CHANGING can be a trigger.

Hello - and welcome to Hubitat!

Here's the Rule 4.0 documentation.

https://docs.hubitat.com/index.php?title=Rule-4.0

Hubitat is Event driven, therefore a trigger of mode = night would only occur at the very instant that the mode changed to being night. Therefore, in this particular instance, I would suggest using mode as a condition.

Thanks, gents, for the quick reply. Understand completely. Am coming from Vera/Ezlo, so this approach is a bit different. But, I'm liking it already.

1 Like

Here’s how I would do it in Rule Machine...

Update: added an off command in the else to make sure the switch is off once the “night” mode is left.

2 Likes

This is a great example because it demonstrates repeat loops (stopable) and delays (cancelable).

2 Likes

Still getting familiar with "coding" what you show, but understand the concept. Lots to learn about this powerful system. Seems pretty stable, too.

2 Likes

Feel free to ask additional questions. We all were in your shoes when we started. :wink:

I found your automation request very interesting, which is why I decided to give it a go in RM. I am curious... What is the purpose of blinking a light for 5 seconds every minute?

Just an example request. Unboxed the Hubitat and a zooZ Double Plug to start exploring. Wanted to see if I could could turn on a plug for a few seconds, but only if at night. Learned that I also need to establish when Night mode is, etc. Still confused about applying conditions.... But, that is today's project. Hoping to get up to speed and ultimately move my Vera system with about 50 devices to Hubitat for more predictable performance.

1 Like

The built-in Mode Manager app may be the simplest solution to changing modes. I have been using it for years and it has been very reliable for me. I use a combination of times (some relative to sunrise/sunset and others absolute) and presence devices (to trigger Away mode when we all leave). It's been working well for my needs.