INSTEON Motion Sensor One Minute Delay

Posted on
Mon Apr 23, 2012 3:08 pm
CaliChris offline
Posts: 38
Joined: Apr 15, 2012

Re: INSTEON Motion Sensor One Minute Delay

I see, so what is the recommended method to setup a motion detector to simply turn on bathroom lights when someone walks in then turns off after a delay after not seeing any motion? I have tried everything I can think of by doing an action trigger and doing a link, but it never stays on for the delay, it turns off in a minute just about every time.

Also I cant seem to do the reset to defaults on the Insteon motion sensor. I disconnect the battery for 15+ seconds, hold set and plug in the battery. No matter how long I hold the set button I never get any beep.

Posted on
Mon Apr 23, 2012 3:47 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: INSTEON Motion Sensor One Minute Delay

Do you have the Motion Sensor directly linked to the light module? Instead of directly linking it, use a Trigger Action (Device State Changed on the motion sensor on/off state) to control it.

Image

Posted on
Mon Apr 23, 2012 3:49 pm
dshj offline
User avatar
Posts: 84
Joined: Jan 16, 2010
Location: San Francisco, CA

Re: INSTEON Motion Sensor One Minute Delay

CaliChris wrote:
I see, so what is the recommended method to setup a motion detector to simply turn on bathroom lights when someone walks in then turns off after a delay after not seeing any motion? I have tried everything I can think of by doing an action trigger and doing a link, but it never stays on for the delay, it turns off in a minute just about every time.

Also I cant seem to do the reset to defaults on the Insteon motion sensor. I disconnect the battery for 15+ seconds, hold set and plug in the battery. No matter how long I hold the set button I never get any beep.


So what I do is I setup a variable for each motion sensor (for example, LivingRoom_Sensor:True/False). I set each sensor to its lowest time delay (30 seconds) so that it's constantly sending Indigo updates. Then, I set a Trigger to update the variable based on the response from the sensor. If motion is detected, it turns the variable to true. If it's not detected, I change the variable to false.

Next, I have another Trigger that turns the lights on in the room when the VARIABLE is true. I have another Trigger that waits for the variable to be False, then it waits a specified amount of time (5 to 20 minutes, depending on the room) before shutting off the light. But I'm not done. In the original Trigger that says to turn on the light with the variable is true? I ALSO tell that trigger to cancel the delayed action to turn off the light (remove delayed actions for trigger xxxxx). This way, I don't have the light always going off each time the sensor doesn't detect motion.

I know some people would do it without the variable for motion detected, but I feed that data into other actions and triggers rather than to poll the status of the device when I need the data.

I'm sure other people have a fancier way of doing this exact same thing, but that's how I accomplish what you're trying to do. Let me know if you want me to expand on any of this.

Posted on
Mon Apr 23, 2012 3:53 pm
CaliChris offline
Posts: 38
Joined: Apr 15, 2012

Re: INSTEON Motion Sensor One Minute Delay

Hmm, more complicated then I thought it would be. How do you do the remove delayed actions for trigger xxxxx?

Posted on
Mon Apr 23, 2012 4:04 pm
CaliChris offline
Posts: 38
Joined: Apr 15, 2012

Re: INSTEON Motion Sensor One Minute Delay

matt (support) wrote:
Do you have the Motion Sensor directly linked to the light module? Instead of directly linking it, use a Trigger Action (Device State Changed on the motion sensor on/off state) to control it.


I tried it both ways, even when doing a trigger action and putting in a long delay of like 15 minutes it shuts off after about a minute.

Posted on
Mon Apr 23, 2012 4:18 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: INSTEON Motion Sensor One Minute Delay

CaliChris wrote:
matt (support) wrote:
Do you have the Motion Sensor directly linked to the light module? Instead of directly linking it, use a Trigger Action (Device State Changed on the motion sensor on/off state) to control it.


I tried it both ways, even when doing a trigger action and putting in a long delay of like 15 minutes it shuts off after about a minute.


It must still be directly linked then to the motion sensor. Once you delete that link, Indigo can control it independently. If that doesn't help, then copy/paste from the Event Log an example of it occurring.

Image

Posted on
Mon Apr 23, 2012 5:00 pm
CaliChris offline
Posts: 38
Joined: Apr 15, 2012

Re: INSTEON Motion Sensor One Minute Delay

Maybe this could be causing issues. Under device links I have an "unknown device" one which says it is not erasable, and wont let me delete it. It shows the address as "masked". I tried everything I can think of to get rid of this including the reset links button under troubleshooting.

Posted on
Mon Apr 23, 2012 5:05 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: INSTEON Motion Sensor One Minute Delay

Factory reset the module (per its manual), then Define and Sync it again. That should get rid of any unwanted links.

Image

Posted on
Mon Apr 23, 2012 5:27 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Motion Sensor One Minute Delay

berkinet wrote:
support wrote:
joemurrayaz wrote:
Why is there a one-minute delay on the motion sensor?

The 1 minute delay is the factory default. Unfortunately, the only way to change it is by sending it an INSTEON Extended Data Command.


If I just want to change the inactivity-timeout value on the motion sensor, it seems I could use the Powerlinc PLM and connect to it with any serial terminal program (or even a real terminal) and then manually enter the appropriate INSTEON extended commands to make the change.

My question, to those that know far more than I, is: Is this practical and if so; what is/are the command(s)


While Matt and Jay may be under NDA, I'm not. :-) I found this page very helpful. I haven't done it yet, but with Indigo 5, you should now be able to use the sendRawExtended() Indigo Python method to send extended configuration messages to the Motion Sensor. From that web page, it seems you can not only set the off time down to 30 seconds, but you can also adjust the dawn/dusk trigger level, set the LED brightness, check the ambient light level, and check the current battery level using extended commands. Of course, the motion sensor would need to be set to software managed mode (via jumper). If I have any success in messing with it, I'll post back here.

Posted on
Mon Apr 23, 2012 5:30 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Motion Sensor One Minute Delay

Experimenting with those commands was definitely on our ToDo list, especially now that we can easily send those extended commands via python. Please try it out and let us know how it goes. Keep in mind the user will have to wake up the Motion Sensor for it to be able to respond to the commands.

Image

Posted on
Mon Apr 23, 2012 5:37 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Motion Sensor One Minute Delay

matt (support) wrote:
Experimenting with those commands was definitely on our ToDo list, especially now that we can easily send those extended commands via python. Please try it out and let us know how it goes. Keep in mind the user will have to wake up the Motion Sensor for it to be able to respond to the commands.

Will do. Yes, I'll take down one of my motion sensors and wake it up in order to mess around with it. :-)

Posted on
Mon Apr 23, 2012 5:51 pm
CaliChris offline
Posts: 38
Joined: Apr 15, 2012

Re: INSTEON Motion Sensor One Minute Delay

Factory reset the motion detector or the powerline module? I keep trying to reset factory defaults on the motion detector but it doesnt seem to work, I do what the manual says but it never beeps at all...

Posted on
Mon Apr 23, 2012 6:00 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: INSTEON Motion Sensor One Minute Delay

Factory reset whichever one is showing the fantom link - I'm guessing the Motion Sensor. v1 of the Motion Sensors had a different reset procedure - hold the set button and plug the battery in and continue holding until the LED comes on for about 3 seconds then goes out. That should do the reset. Then do the define and sync in Indigo to see if the link is still there. If your Motion Sensor doesn't have any dials beside the set button then it's the older v1. If it does have dials and it won't factory reset then it may be having hardware issues.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Apr 25, 2012 1:50 am
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Motion Sensor One Minute Delay

matt (support) wrote:
Please try it out and let us know how it goes.

So here are my results.

I tested the full set of options listed on the page I mentioned previously with one rev 2.0 (firmware 0x34) 2420M motion sensor and successfully adjusted every parameter. I then tested a much smaller set of parameters (motion timeout change) on 3 other 2420M motion sensors (all the same 0x34 firmware... sorry, no variety ;-) ). All were successful. Note that I had jumper 5 (software managed mode) connected in all the 2420Ms already. I did not try to send data to them without jumper 5 set. All other jumpers were not connected.

Below is the Python code (used from an embedded script within an Action Group, only changing the device name when testing the various 2420Ms). (Thanks for the example code on how to use the sendExtendedRaw method from this thread Matt)!
Code: Select all
def bin(s):
    return str(s) if s<=1 else bin(s>>1) + str(s&1)

instnAddr = indigo.devices["Patio Motion"].address

######################
# Read, then log the current values:

reply = indigo.insteon.sendRawExtended(instnAddr, [0x2E, 0x00], waitForExtendedReply=True)
ledBrightness = reply.replyBytes[4]
timeoutIntervals = reply.replyBytes[5]
duskDawnLevel = reply.replyBytes[6]
optionBits = reply.replyBytes[7]
jumperMaskBits = reply.replyBytes[10]
ambientLight = reply.replyBytes[12]
batteryLevel = reply.replyBytes[13]

indigo.server.log("OLD:")
indigo.server.log("  full reply: " + str(reply.replyBytes))
indigo.server.log("  LED Brightness (0-100): " + str(ledBrightness))
indigo.server.log("  Timeout (sec): " + str((timeoutIntervals + 1) * 30))
indigo.server.log("  Dusk Light Level (0-255): " + str(duskDawnLevel))
indigo.server.log("  Option Bit Flags (LED, Day+Night, ON+OFF, [nothing]): " + str(bin(optionBits)))
indigo.server.log("  Jumper Mask Flags (J2 J3 J4 J5): " + str(bin(jumperMaskBits)))
indigo.server.log("  Ambient Light Level (0-255): " + str(ambientLight))
indigo.server.log("  Battery Level (approx. Volts): " + str(float(batteryLevel / 10.0)))


######################
# Change the timeout duration.

timeoutIntervals = 0     # Default: 1. (didn't test max, probably 255)
                         # (timeoutIntervals + 1) * 30 sec

setMotionSensorSettingsCmd = [
   0x2E, 0x00,
   0x00,            # unused
   0x03,            # change data byte 4 (timeout intervals) setting
   int(timeoutIntervals) & 0xFF,  # the new setting
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
]
indigo.insteon.sendRawExtended(instnAddr, setMotionSensorSettingsCmd)


"""
######################
# Change the LED brightness.

ledBrightness = 100     # Default: 100. Max 255. Min 0.
                        # Values over 100 seemed to have no effect during testing.

setMotionSensorSettingsCmd = [
   0x2E, 0x00,
   0x00,            # unused
   0x02,            # change data byte 3 (LED brightness) setting
   int(ledBrightness) & 0xFF,  # the new setting
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
]
indigo.insteon.sendRawExtended(instnAddr, setMotionSensorSettingsCmd)
"""

"""
######################
# Change the dusk/dawn light level.

duskDawnLevel = 128     # Default: 128
                        # Lower number = less light required to trigger
                        #   day mode. Max: 255. Min: 0.

setMotionSensorSettingsCmd = [
   0x2E, 0x00,
   0x00,            # unused
   0x04,            # change data byte 5 (dusk/dawn level) setting
   int(duskDawnLevel) & 0xFF,  # the new setting
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
]
indigo.insteon.sendRawExtended(instnAddr, setMotionSensorSettingsCmd)
"""

"""
######################
# Change the option flags.
#
#   We're using hex here, not integers.
#   In the example below, we use a string of binary numbers to represent on/off
#      conditions of 3 different features
#     "00000" = LED off, only work at night, only ON messages sent.
#     "00010" = LED off, only work at night, ON and OFF messages sent.
#     "00110" = LED off, always work, ON and OFF messages sent.
#     "01110" = LED on, always work, ON and OFF messages sent (default).
#                 Any of the left 3 bits can be switched on or off (1 or 0).
#                 Bit 1 (the right-most bit) is ignored.
#     "10000" = LED off, always work, only ON messages sent, timeout of ~4 sec
#                 (described as "occupancy mode").

optionFlags = "01110" # default = 01110 (LED on, always on mode, send ON and
                      #   OFF commands, occupancy mode off… i.e. use timeout).
                      # (Occupancy mode is "10000". It disables the LED, ignores
                      #   ambient light conditions, and only sends ON commands).
                      # Max value is 11111, but if the most significant bit is 1
                      #   then all other bits are ignored. The least significant
                      #   is stored but never had any effect during testing.

setMotionSensorSettingsCmd = [
   0x2E, 0x00,
   0x00,            # unused
   0x05,            # change data byte 6 (option bit flag) setting
   (int(optionFlags, 2) & 0xFF),     # the new setting
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
]
indigo.insteon.sendRawExtended(instnAddr, setMotionSensorSettingsCmd)
"""

######################
# Read, then log the new values to ensure it stayed.

reply = indigo.insteon.sendRawExtended(instnAddr, [0x2E, 0x00], waitForExtendedReply=True)
ledBrightness = reply.replyBytes[4]
timeoutIntervals = reply.replyBytes[5]
duskDawnLevel = reply.replyBytes[6]
optionBits = reply.replyBytes[7]
jumperMaskBits = reply.replyBytes[10]
ambientLight = reply.replyBytes[12]
batteryLevel = reply.replyBytes[13]

indigo.server.log("NEW:")
indigo.server.log("  full reply: " + str(reply.replyBytes))
indigo.server.log("  LED Brightness (0-100): " + str(ledBrightness))
indigo.server.log("  Timeout (sec): " + str((timeoutIntervals + 1) * 30))
indigo.server.log("  Dusk Light Level (0-255): " + str(duskDawnLevel))
indigo.server.log("  Option Bit Flags (LED, Day+Night, ON+OFF, [nothing]): " + str(bin(optionBits)))
indigo.server.log("  Jumper Mask Flags (J2 J3 J4 J5): " + str(bin(jumperMaskBits)))
indigo.server.log("  Ambient Light Level (0-255): " + str(ambientLight))
indigo.server.log("  Battery Level (approx. Volts): " + str(float(batteryLevel / 10.0)))


The code above modifies the default 60 second motion timeout (at least on all my motion sensors) to the minimum timeout possible (30 seconds) and generates output in the Indigo log like this...

Code: Select all
  Sent INSTEON                    "Patio Motion" raw insteon command (2E 00   00 00 00 00 00 00 00 00 00 00 00 00 00 00; ack: 00)
  Script                          OLD:
  Script                            full reply: [46, 0, 0, 1, 100, 1, 128, 14, 0, 121, 14, 2, 48, 86, 0, 210]
  Script                            LED Brightness (0-100): 100
  Script                            Timeout (sec): 60
  Script                            Dusk Light Level (0-255): 128
  Script                            Option Bit Flags (LED, Day+Night, ON+OFF, [nothing]): 1110
  Script                            Jumper Mask Flags (J2 J3 J4 J5): 1110
  Script                            Ambient Light Level (0-255): 48
  Script                            Battery Level (approx. Volts): 8.6
  Sent INSTEON                    "Patio Motion" raw insteon command (2E 00   00 03 00 00 00 00 00 00 00 00 00 00 00 00; ack: 00)
  Sent INSTEON                    "Patio Motion" raw insteon command (2E 00   00 00 00 00 00 00 00 00 00 00 00 00 00 00; ack: 00)
  Script                          NEW:
  Script                            full reply: [46, 0, 0, 1, 100, 0, 128, 14, 0, 121, 14, 2, 62, 86, 0, 210]
  Script                            LED Brightness (0-100): 100
  Script                            Timeout (sec): 30
  Script                            Dusk Light Level (0-255): 128
  Script                            Option Bit Flags (LED, Day+Night, ON+OFF, [nothing]): 1110
  Script                            Jumper Mask Flags (J2 J3 J4 J5): 1110
  Script                            Ambient Light Level (0-255): 62
  Script                            Battery Level (approx. Volts): 8.6


I've included sections in the above code to change all the features of the 2420M rev 2.0 motion sensor as well. All one need do is remove the three double-quote comment characters """ from above and below the specific sections related to their desired change and execute the code. As Matt pointed out, though, you have to have the sensor unit in-hand and open to put it in linking mode (i.e. make it stay awake) in order to respond to commands. It won't respond unless in linking mode (i.e. press and hold the SET button for ~3 seconds until red LED begins to flash). I tried. ;-)

Perhaps one of the most potentially useful options is "occupancy mode", which disables the motion timeout setting and will send only an ON command for effectively every non-continuous motion sensed (basically a timeout of 4 seconds). This can be very useful when setting the position of the sensor to get precise positioning. The only drawback, of course, is that once you have it set just right, you still have to press and hold SET button, change the mode back and screw on the back cover plate (thus altering the position of the sensor you just so meticulously set). Still could be useful though. The option to dim (or turn off altogether) the LED could be helpful for home theater or other intentionally dark environments. Changing the minimum illumination level for dusk may also be useful. The current light and battery levels are cool, but not very useful since you can't grab that info without putting the device in linking mode (and thus have the back off and next to it already). I wonder if there's a bit that can be poked somewhere to enable remote administration. :-)
Last edited by nsheldon on Wed Apr 25, 2012 2:06 am, edited 1 time in total.

Posted on
Wed Apr 25, 2012 2:05 am
dshj offline
User avatar
Posts: 84
Joined: Jan 16, 2010
Location: San Francisco, CA

Re: Motion Sensor One Minute Delay

nsheldon wrote:
As Matt pointed out, though, you have to have the sensor unit in-hand and open to put it in linking mode (i.e. make it stay awake) in order to respond to commands. It won't respond unless in linking mode (i.e. press and hold the SET button for ~3 seconds until red LED begins to flash). I tried. ;-)


What would be cool there is to be able to rely on the ambient light sensor of the motion sensor for additional options. Living in the "Fog Belt" in San Francisco, there are days where we need the lights on sooner than the timed setting. We have the sensors all over the house, and being able to set lighting in each room based on the ambient light in that room would be great!

Oh well... :?

Who is online

Users browsing this forum: No registered users and 18 guests