Motion Lighting Configuration

I understand. I will look at how this could work.

Updated: This feature will be in the next release.

2 Likes

great news!

This feature is now available in the latest release:

I saw that in the release notes!!! Great news. I haven’t played around with it yet, but will soon.

I have a related, but maybe not exact use case.

I have used and loved RM in SmartThings, but saw that Motion Lighting had both a Switch to Disable On and Switch to Disable Off feature.

Previously, in RM, I would create a virtual switch and then have that rule not fire when the switch was turned on.

I’m attempting to get that same result in Motion Lighting by specifying the same virtual switch in the settings for ‘Switch to Disable On’ and ‘Switch to Disable Off’.

I note that it doesn’t ask what the state of the switch is in the config options, so maybe I’m misinterpreting what this is for.

Basically, I want the lights I’m controlling to remain in whatever state they are (on or off) ignoring motion sensor activation when this virtual switch is on.

It seems to work for not turning lights on when the virtual switch is on, but, when I turn the virtual switch off, and the ‘Time to Delay before turning off’ time elapses (10 minutes in my case), the lights are remaining on.

If I have to do a Rule for this, it won’t be the end of the world, but I was just wondering if Motion Lighting could handle this case?

Am I missing something obvious? Thanks for the help/guidance. :slight_smile:

Take a read of this..it should help.

1 Like

Started playing with the level override.

So, my configuration is as follows:

What I seem to be missing is I still want to have a means via button or switch disable the automation all together. I have a pico that I use to turn on a virtual switch for "sleeping" to disable a number of automations. Is this possible? Maybe I am missing something.

The light level override works great!

I haven’t tried this myself but why not use the same switch in “switch to disable on” also be used in the last group of options “switch to disable off”. That switch would essentially disable the whole automation…I think :crossed_fingers:

I can confirm that using the same virtual switch for both override on and override off works… the only wrinkle is that it appears that the internal ‘rule’ doesn’t get re-evaluated when the virtual switch is turned off.

In other words, if I have the lights go on, then put on the override virtual switch, and wait past the ‘delay to turn off’, it works great - lights stay on. But, if you then turn off the virtual switch, the rule isn’t re-evaluated - the lights will stay on until another cycle of motion/no motion.

This is a minor wrinkle, and usually easily avoided if the sensor is going to pickup movement relatively quickly. Once it does, the rule is re-evaluated and all works normally.

@bravenel are there any plans to change things so that the current rule / scheduled action is re-evaluated? I want to use a virtual switch set by multiple possible channels (ie. a button, action on a switch, alexa, etc.) all to turn on / off a virtual switch. The virtual switch would be the switch for the enable on and disable off. But if the same virtual switch is used, then the light could already be on, turned off by the existing schedule then not turned on because enable on is false.

Motion Lighting does not have rules that are evaluated. It is entirely event driven. So the simple answer to your question is, no, there are no such plans.

I don't fully understand what you're trying to do. Using the same switch to enable on and disable off doesn't sound logical... ??

Thanks Bruce - this does help answer a question and strange behavior I was seeing in Motion Lighting.

Back in the early days of RM, when I submitted a patch for you to consider for rule override, the general pattern was that a switch (virtual or otherwise) was evaluated to see if it was turned on. If it was on, then execution of the rule was effectively suspended.

So, if you didn’t want the rule to fire turning on lights in a kids room after bedtime (but with the house in Home mode), you turned on the virtual switch. Disabling off is a similar use case - the lights came on with the automation, but, turning on the virtual switch would prevent execution of the ‘turn off after x minutes of inactivity.’

Based on your earlier example in Motion Lighting, I was under the assumption that using the same virtual switch for ‘disable on’ and ‘disable off’ was operating in the way I just described.

If that’s not the case, I can easily convert my Motion Lighting to RM rules. If you could clarify, that would be great.

Thanks.

You should not need to know how the implementation handles this internally. RM did things in one way because it had a more general problem to solve, namely the evaluation at a point in time of a bunch of conditions. Motion Lighting doesn't have that problem to solve, so it goes about it differently. Whereas RM was implemented such that it found out the current state of a device at the time of evaluation, Motion Lighting is implemented such that it maintains in its internal state the implication of the state of the device. Motion Lighting has subscribed to these override devices, and uses their events to manage its internal state. RM did not maintain internal state about devices. The net effect of either approach is the same (or should be).

If you turn on the disable-off switch at any time before the timer runs out on motion-inactive, the lights will not turn off. Motion Lighting should function exactly the same way the corresponding rules would function. If it doesn't work as expected, there could conceivably be a bug somewhere, although I am not aware of any at the moment.

Thanks - so, the only thing you previous message confused me on slightly was using the same virtual switch for both ‘disable-on’ and ‘disable-off’. If Motion lighting subscribes to the ‘on’ state for both of those conditions, I think what I’ve built will work fine.

Thanks.

Yes, you are right, that should work fine. I use that in one of my Motion Lighting rules. I probably misspoke before...

1 Like

There needs to be an app that can do this:

  1. Motion triggers light
  2. Secondary Switch can be turned on/off based on an extra condition after a specified amount of time. (Door closed after motion event)
  3. Motion off disabled if motion becomes active after door is closed
  4. Motion Off enabled after door is opened
  5. Switches can be turned off at different times after motion stops

This would be ideal for a Bathroom that has a light and a fan.

Switch 1
Switch 2
Motion
Contact

Why not just write a Bathroom App? I’ve seen you mention this use-case multiple times now. It seems to be a fairly specialized use case for a bathroom. You could write an App that handles this and then share it with the community.

This can be done with two rules in RM.

2 Likes

Actually, most of my rooms have this feature.

I don’t want the lights, tv, etc., to turn off if I am in the room.

The easiest thing was:
If motion changes to active and door is closed, then pause automation.

If door opens then resume automation.

1 Like

I am pretty techie and I just don’t see how in RM this can be done in just 2 rules.

Enlighten me please.