Motion Control - Getting light to stay on

I am using Motion and Mode to turn on my garage light.
This is as follows:


Is this set up correctly?
I also have the track light go on in RM, if the garage door is unlocked, and if the garage door contact sensor is opened.

My questions are as follows:

  1. How do I retrigger to get the light to stay on if motion is detected?
  2. Is one dominating another? Often, when I open the door (if already unlocked), it requires me to close the door and re-open, for the contact sensor to read (and therefore trigger the light). With this, why isn't motion working to trigger it?
  3. In my rule pictured above, do I have this set up correctly to keep the light on?

Here is the rule machine rule:


Should I perhaps just have RM, and add the motion as an OR?

Thanks in advance.

My recommendation would be to eliminate the motion lightning and add the garage motion as a trigger in RM.

Also, you should add a “Cancel Delayed Actions” as the first item so it doesn’t shut down after the first 15 minutes when it gets re-triggered.

Finally, you will probably need to add a bit more complexity to only trigger the off event 15 minutes after motion has stopped...

|Thanks. Will take the motion lighting phase.

Questions:

  1. What do you mean by Cancel Delayed Actions
  2. More complexity? Please elaborate

Thanks!

1 Like

Rule Machine rules will run concurrently. You can have the same rule run 10 times concurrently if it was triggered 10 times... Adding the “Cancel Delayed Action” command will cancel the delayed action in the previous instance(s) of the rule so it doesn’t keep turning off the lights...

You may need to add an “if” condition to check if motion is active or not...

  • If you trigger only with motion start, it will shut down after 15 minutes even if motion never became inactive because you were moving around a lot.
  • If you trigger on motion “change”, it will turn on the light when the motion stops and stay on for 15 minutes which may not be ideal as the room will most likely be empty at the time.
1 Like

Thanks so much for the help.
It is all a bit much for me, but I will try to get through it.
Adding the Cancelled Delayed Action is still an unknown, though I will look into it.
Building IF conditions statements is also a challenge for me.

1 Like

OK, so it seems you basically have a race condition between those two rules causing a disconnect between the known state of the light, so maybe the easiest way to handle this is to start from the basics, what are your triggers and what is your intended effect?

From your post this is how I read it:

On State
Triggers: Motion sensor (inside garage?), garage door contact sensor opening, 2 different garage door locks? either unlocking

Intended Effect: Turn on track lights

Now that the on state is clear, we can handle the off state.

Off State
Triggers: 15 minutes of no motion from the garage motion sensor (is this all or did you want the contact sensors/locks part of this equation?)

Intended Effects: Turn off track lights

Personally, I love the motion lighting rules, they are very powerful especially in regards to secondary and even tertiary control from buttons to switches to contact sensors. So if I surmised ish how you want this to run I think you can do it all as a part of the motion rule.

Yes you can basically do anything with RM4 but my understanding is that it usually should be the last resort when something else cannot do it due to complexity or something else.

1 Like

That makes a lot of sense.
The motion rule seems to have more capabilities, especially around motion detectors.
I guess in building it, I dont really need to have the garage door unlock as part of it; it was my first trigger I had created BEFORE i had purchased the contact or motion sensor.

I will try to rebuild with Motion Rules, and exclude the door unlock trigger.

2 Likes

Okay. Here is what I have built with Motion Control

Do you see any issues with it?
The only thing missing is the ability to trigger using an unlock command.

1 Like

So use a virtual motion sensor, and with a simple rule change the state of the virtual motion in relation to locks.

The virtual motion sensor would then just get used in the first box of your Motion Lighting app above.

That is the simplest way I can think of to do this. The main issue is you are trying to mix device types (motion, contact, lock) in one rule. It can be resolved by fooling the app via the method I outline above.

3 Likes

This setup didnt work just now.
Contact was broken, motion was there - nothing.

Perplexed.

Okay. So, it eventually worked, with me opening and closing the door a couple of times.
This is why I need multiple triggers - I cannot guarantee that one will do the job.
Motion detector often works, but then like tonight, did not.
Same with contact sensor.

That is very odd, are you sure that your mesh has a strong enough connection out to your garage? From the device pages are the contact and motion sensors responsive? I have never had issue with a single device being able to trigger a rule unless that device itself was not responding.

Also the "Additional Motion Sensors to keep on: Garage Motion" is not necessary, that option is for using motion sensors to keep the light on, but that do not trigger them to be on initially, say you have a basement and the motion sensor at the top of the stairs triggers the lights to go on, but the motion sensors actually in the basement keep them on. Basically, as I understand it, that option enables preempting an action to get a more responsive outcome.

+1 to this, but it does not have to be a virtual motion sensor if you don't want it to be, it can be a virtual contact sensor, virtual switch, or even virtual button, but that would kinda be weird. Basically comes down to if you want an immediate or delayed response. If you want immediate, switch or contact is the way to go, if you want delayed and you also want the garage motion to be factored in, then virtual motion is the way to go. Either way you go, you would need an external small RM rule, maybe even a Simple Automation would suffice, that mirrors the lock state to the virtual device state.

2 Likes

I'll admit to not having read the entire thread, or even the original post, so please ignore me if I'm way off here....

EDIT - Looks like I probably was right, but feel free to read on if you are interested....

I had issues with Motion and Mode Lighting app because I wanted to trigger my lights based on motion / contact sensors, but if I used a manual form of control such as a physical (Hue Dimmer) switch I wanted to move to a manual operation mode. Once the lights turned off I wanted to move back to a motion / contact based operation. The issue I believe was that the Motion and Mode Lighting rule remained in an "on" state and so would not turn lights back on when I wanted them to. I ended up setting up about 4-5 rules on RM for each room. If this is likely to be helpful let me know and I can post some details.

Simon

1 Like

What exactly do you mean by manual control? Just on/off and dim? If that is all, you should be able to still use the mode and motion lighting by using the "Name to use with Alexa" or something like that at the bottom. That creates a virtual device for your rule that stays in sync with the rule so if you tell Alexa for instance to turn on the lights, she will go in accordance to the rule. Then for the button controller just reference that virtual device and enable the option where manual changes override motion settings.

1 Like

I think I will go back to RM.
Could you post some of what you have done, and also explain a bit about the "4-5 rules for each room"?

I will post back what my new RM creation is.

Okay. This is driving me a bit crazy.

Here is the rule moved to RM

I can see issues already.

  1. If the door stays unlocked, will that affect the light turning off?
  2. Same is contact is left opened - will light stay on?
    Or are both of these one and done?

Answers:

  1. The light will turn on when the door is unlocked and turn of in 20 minutes, regardless of whether it is locked again or not.

  2. The light will turn off 20 minutes after the door was opened regardless of whether it is closed again or not.

  3. The light will turn off 20 minutes after it received the first motion event. It will also most likely turn off 20 minutes after every other motion events it received. (Same if you open / unlock the door). I would recommend you add a “Cancel Delayed Actions” at the top (first action of the rule) to avoid this.

See the following link for more information on “Cancel Delayed Actions”:

Thanks @cjkeenan, I would never have looked at the Alexa option, I'll give it a go and see if it does what I need.

One example use case is I want to be able to walk into a room, have the motion lighting setup through the app turn the lights on, but then press a Hue dimmer button or have a switch turn on cause the lighting rule to essentially stop, leaving the lights on until I turn the lights off with the Hue dimmer or some other situation. This all worked perfectly for me up to the last point. I could pause the rule so the lights would remain switched on when I pressed the Hue dimmer button, but when I turned the lights off with the Hue dimmer, when I later re-entered the room, the motion lighting rule would log that it would not turn the lights on because they were already on.

This is from memory, not in front of my home PC at the moment.... I'm almost certain there is one or more rules on top of what I have listed, I'll post back later today...

Motion Lighting - Turn Lights On
Triggered by Motion Sensor / Zone Motion Sensor becoming active
If Motion Override VS is Off THEN
Cancels Turn Lights Off Rule below
Activate Scenes Per Mode for the

Motion Lighting - Keep Lights On
Triggered by Motion / Zone Sensor being Active
Cancel Turn Lights Off Rule
-- Not sure how effective this rule is.....

Motion Lighting - Turn Lights Off
Triggered by motion becoming inactive for relevant sensor / zone sensor
Action - Turn lights off, delayed by X minutes, cancellable (required for earlier rules)

Motion Lighting - Motion Override
Triggered by Motion Override VS switching off
Cancel Turn off Lights rule

In terms of the Motion Override, this can be turned on by any number of rules or other apps, based on pressing physical buttons, other rules based logic, etc.

Hope this helps.

Updated my last post with updated details of my rules, hopefully this helps...

Will also continue the conversation with @cjkeenan on the alternate conversation re the Alexa option in Motion Lighting.

Download the Hubitat app