What's the most efficient way to turn on lights on motion, and off after X seconds, but with some conditions?

Just wondering how you guys do it efficiently. (comparing notes)

DEVICES
Kitchen Ceiling Lights
Kitchen Sink Lights (led strip for the kitchen sink)
Motion Detector by the Kitchen sink

Desired Behavior:

#1
If motion is detected, TURN ON -> Sink Lights
And then Turn OFF Sink Lights after 30 seconds of NO MOTION

#2 (similar to #1 but with conditions)
If motion is detected, TURN ON -> Sink Lights
And then Turn OFF Sink Lights after 30 seconds of NO MOTION
---> BUT, only if Kitchen Ceiling Lights are NOT ON, else, keep Sink Lights ON for another 30 seconds, and so on.

Basically, for this one, I want the sink lights to turn on if someone uses the sink, and turns off after 30secs, but only if the main ceiling lights are also off.

Here's how I would write your two rules in Rule Machine

Rule 1

Trigger Events
KS Motion is active

Actions to Run
On: KS Lights
Wait for events: KS Motion inactive an stays that way for: 0:00:30
Off: KS Lights

Rule 2

Trigger Events
KS Motion is active

Actions to Run
On: KS Lights
Wait for events: KS Motion inactive an stays that way for: 0:00:30
Wait for Expression: KS Light is off --> duration: 0:00:30
Off: KS Lights

The Rule 2 Waits could be written as a single Wait but I think this shows the logic better as written.

1 Like

Can be done with RM as shown above, but pretty simple to get this behaviour in Room Lights :

  • Device to automate : Kitchen Sink Lights
  • Means to activate : motion becomes active
  • Means to turn off : motion inactive for X minutes
  • In turn off options, Limit turning off : when switch is on (Kitchen Ceiling Lights)
1 Like

Room Lighting. Note you need to know your motion sensor timeout. Some are configurable, some are not. Any delay you configure is in addition to the timeout of the sensor itself.

1 Like

Simple Automation.
Kitchen Ceiling Lights is the restrictor switch. When KC lights off, KS light motion rule is restricted from running.

Alas, SA can't do time intervals less than 1 minute, so I would change the timeout in my Hue motion to 30 seconds, vs the 10 seconds it does now.

1 Like

Thanks!

Ok about this. I wanted to use this App (Room Lighting) but I am under the impression that the more Apps installed on the hub, the more resource is spent, so I thought "if i could achieve what I want with Rule Machine, I better stick w/ it to keep the hub light on its feet" - is this an OK way of thinking bout this?

ok, it's good to know I'm not the only one using just RM to do this hehe
Thanks for ur input man.

I see.. thanks for the tip about the time outs

I see. I've not played with SA, ill take a look. And i don't mind raising the wait to 1minute instead of 30secs... Room Lightings App also can't do < 1min, i just found out now.

Thanks for ur inputs mate!

1 Like

This is true… but every rule is an instance of a Rule Machine app. The parent app you use to create a new instance doesn’t consume any resources. Same for room lighting. I doubt there’s any significant difference in resource usage with the same automation being done with either, or simple automation.

The box accepts a decimal number. Try 0.5, you should get 30 seconds. Also mind the sensor’s own delay.

2 Likes

Im using Linptech presence sensors that are working very well and you can put 0 for the timeout in the room lighting app.

2 Likes

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