Smartthings Motion Sensor delay

I am using a SmartThings IRM-250 motion detector to turn on a room light when I enter and turn off when I leave. It works great as long as I am in the room for 12 seconds or so. Problem is if I leave the room before the MS resets itself to Inactive, the light does not go out.

Is there some way to reduce the time needed to reset to Inactive to 1 second or so?



Two questions:

  1. What app/automation are you using to turn off the lights, and how is it set up?
  2. Does the motion sensor correctly log active/inactive events as expected in either the live/past logs ("Logs" in the left menu, if descriptionText logging is enabled) or the device's "Events" history tab?

This shouldn't happen with any of the stock motion lighting apps, so I'm guessing there's either something wrong with the sensor or some configuration issue you could look at in the app. I'm not aware of any motion sensor that allows a 1-second reset interval, though some do let you get a bit smaller than their default, which is often at least 30 seconds. If it's a battery-powered sensor, going this low could be an extra-bad idea because you're likely to drain it faster than usual.

Thanks bertabcd1234. I am using the rules machine. Not quite sure I understand "and how is it setup question". I am quite new to Hubitat, but I do not believe it is a sensor problem or anything else. I think it is functioning the way it is designed to unless I got a defective component right from the get-go. I further do not believe it is a function of an app since it has performed this way with It has been this way since day 1 with SmartThings, Wink, Stringify and now Hubitat. I can see on my Dashboard that it becomes active then about 12 seconds later inactive.
Yes as per my original, I would like to see the code and perhaps change it. Do you know how I can do this?

This setting is not adjustable on this sensor.

The issue as you describe it appears to be an issue with the way that the rule you have setup.
If you post a screen shot of the rule configuration this will likely help in understanding why this is not working as expected.

If you're new to Hubitat, that is likely the problem. Rule Machine is powerful, but complicated at the beginning. As Mike suggested, could you post a screenshot of your rule setup so someone can help troubleshoot? It's easy to miss things in RM if you haven't created a lot of rules before. If the sensor is working as expected, this is undoubtedly where the issue lies.

Alternatively, look into the Motion Lighting app that is built in to Hubitat. If you just want a light to turn on and off with motion, it will do what you need. (That being said, if you do want to learn RM, this wouldn't take a ton of effort and might be a good starting point for more complicated situations.)

The code for the stock apps is not open, so modifying it is not an option. But like modifying the sensor time, I think that is also the wrong approach to this problem. :slight_smile:

I appreciate the quick replies. However, I think my question and your answers are going in the wrong direction. No doubt it is my fault since I am a newbie and that is most likely the problem according to bert, not knowing if I have any background in this kind of stuff or not. Soooooo I will try to be more specific.

I do not believe this to be an RM problem.

I have a motion sensor (SmartThiings IRM-250) that has a time delay of about 12 seconds between active-inactive-active etc. I would like to reduce that amount of time as much as possible. Can this be done?

Again thanks for your help

Thanks for the screenshot! So, a regular "Rule" like you have in Rule Machine works by evaluating the "Define Rule" section when any of the conditions ("Select Conditions") changes. Since your condition is the motion sensor being active, it will evaluate your rule every time that changes. "Actions for True" will run every time motion starts (i.e., if the evaluation of the rule changes to true, meaning the motion sensor changes to active), and "Actions for False" will run every time motion stops.

Right now, you only have "Actions for True," so nothing will happen when motion stops. Additionally, the "Actions for True" section might not do what you expect. I'm not sure what your IF/THEN is trying to accomplish, but it looks like you might be trying to detect if the light is currently on. In that case, you want to look at the switch attribute and not the level attribute (long story short is that these are separate and most dimmable devices remember their level attribute if turned off by an off() command; setLevel(0) will effectively turn most/all dimmable devices off, but turning something off does not necesarrily, if ever, set the level to 0). So your rule will currently turn the bulb off when motion is detected (surely that's not what you want?) but only if it was previously turned off by way of dimming to 0 but probably not if it was turned off by a direct off() command (also not likely what you want). Otherwise, it will turn the bulb on to 100% (might be close to what you want?).

If you just want the light to turn on and off based on motion with or without a delay, I'd suggest using Motion Lighting instead of Rule Machine. Like Rule Machine, it's a built-in app, but unlike Rule Machine, configuration with that app is quite easy since it was designed for, among a few similar cases, this exact purpose. Otherwise, if you could clarify what exactly you want the rule to do, someone could help figure it out. If you want the bulb to turn on to 100% when motion is detected, you can just leave the "set level to 100%" (and only that) in "Actions for True." If you want the bulb to turn on to 100% when motion is detected only if the bulb isn't already on, one way to do that would be to put "IF Bulb1 switch is off THEN set level to 100%" there instead. Then, in "Actions for False," you probably want "Turn Bulb1 off," or that with a "Delay X minutes" before it if you want that (with "Cancel on truth change" selected so this section will stop executing if motion is detected again during this wait).

I can be more specific about these suggestions if you want, otherwise hopefully this helps point you in the right direction! Again, reducing the time between active/inactive events on the sensor both isn't possible (very few, if any, Zigbee sensors let you configure this) but also wouldn't fix the problem since that lies in the way the rule logic was set up.

Thanks bert. The Rule is working exactly as I have intended it to.
If bulb1 is on and motion is detected turn bulb1 off. If bulb1 is off and motion detected turn bulb 1 on.
If I use a False statement as soon as motion has reset it will change the state of the bulb to the opposite of what it currently is.

Again the whole problem is in the motion sensor itself with it not resetting immediately. If I walk in the bedroom and get a shirt off the bed and leave the room chances are the light will remain on because the motion sensor has not reached its time value to reset and wait for the next motion event.

Do you know ao any motion sensors that can have minimum reset times?

BTW - this rule will be part of a more extensive rule.It has been my experience in the past that if I get the simple things rolling and working the way I want the rest will follow without too much problem (hopefully)

So, you are both turning a light on and turning a light off when motion is detected? Where will this motion sensor go?

Sorry, I misunderstood your intent! Most people want motion inactivity to turn off lights, so I figured you were trying to create something like that here. :slight_smile: But a couple notes: first, this rule actually won't catch all scenarios under which the bulb could be turned off, just ones in which the bulb was turned off by sending setLevel(0). If you want it to catch any time the bulb is off, you should check for switch being off rather than level being 0 for the reasons I described above. If this rule is the only thing that would ever control this bulb, it is fine as is, but checking for the actual switch state is a safer bet in any case.

That being said, I still don't understand why you want to use motion active events to toggle a light. Regardless of reset time on the sensor, this is likely to cause problems unless all you ever do is walk into a room (trigger motion active), freeze (remain completely still so the sensor doesn't catch any movements and allow the sensor to go and remain inactive), then walk out (trigger motion active again). This is a poor match for human behavior unless maybe you live alone, don't have pets, and are using a "curtain sensor" or something you've rigged to narrow the PIR lens range so it only catches you walking through a doorway or something--in that specific case, I could see something like that working to catch you moving into or out of (but not within) a room, with that movement being the trigger to toggle the lights. Even then, this should only be a problem if your sensor has a relatively long reset time and you only make a quick trip, say a few seconds, into or out of the room. If you did want to go that route, many Z-Wave sensors have configurable "reset" times (I think the Dome DMMS1 can be configured down to 10 seconds, and it's also adjustable on the Aeon Mutli and probably Tri, HomeSeer HS-MS100+, and Zooz ZSE18, but I'm not sure how far). But 1 second is much further down that any I've seen will let you go, and all the ones I mentioned are Z-Wave, which tend to be a bit slower than Zigbee sensors to respond, which might get annoying if you're using them to turn on lights.

But I'm still not sure that would be the best approach. Let's zoom out and look at the big picture: is this a motion sensor you're using to detect motion in the room? (My "curtain sensor" scenario was just a guess but the only one where I could see something like this working well. The ST sensor is not one of these, so I assume you're actually using it to detect motion in a room like most people do.) If so, you'd be much better using motion inactivity to turn off the light. That way, you'd be guaranteed it would actually turn off and only do so if you're not actually in the room. Is there a reason you just don't want the lights to turn on with motion and then off when motion stops instead? (Most people would add a delay after the inactivity so it doesn't turn off if they're still in the room but just not moving enough to keep it constantly "active.")

Ryan - Yes, that is correct. It is located outside of the room where it has always been, not in it. When I walk in the room the light comes on and I can jump up and down, use my hula hoop or pump a little iron. WHen I leave the room the light goes out. That is the way I want it.

bert, yes I am aware of the limitations of my configuration (on-off, 0-100). At this point I am not concerned about that. Hopefully it is obvious by now my concerns rest with the reset time of the motion sensor as opposed to what action the motion sensor triggers.

Thanks for the suggestions on the different sensors

The shortest reset time I'm aware of is 10 seconds for a hue device, using our driver at the shortest preference setting.

Also expect poor battery life with settings these short.

You should have a rethink on how you want this to work.

Thanks mike. I appreciate your advice. However, I am not concerned about battery life. It may only get used once or twice a day if that. I have been able to manipulate the code where I can get the light to turn on and immediately turn off but that is not what I want because that deals with the light and not motion sensor reset time. I am planning on doing a lot of "stuff" with this MS and in reality its more experiment than need. Just trying to see how far I can push the code.

The "code" wouldn't be anything you (or the developers) could do on Hubitat. The device firmware would need to be changed. I second Mike's advice to try making this work in a different way, whether it's motion sensing in the room (I don't know of any statistics collected but I imagine this is by far the most common case), a door/contact sensor, or another way you could figure something out.

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