Announcement

Collapse
No announcement yet.

Motion Sensor & Dusk/Dawn Sensor Script Package Discussion

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Motion Sensor & Dusk/Dawn Sensor Script Package Discussion

    This is the discussion thread for the Motion Sensor & Dusk/Dawn Sensor Script Package

    The current version is 4.7.1

    Jim Doolittle

    [This message was edited by Jim Doolittle on Tuesday, 30 July 2002 at 09:56 AM.]
    Jim Doolittle

    My Twitter
    My Hardware & Software

    #2
    Jim,

    The latest download sets the recurring event to 2 seconds rather than 2 minutes:

    evnt.rec_secs = RecurTime

    I tried changing this to RecurTime * 60 but that gives me 12 seconds for some reason (when I open the event properties the "seconds" value seems to take only the high-order 2 characters of the calculated value).

    This is using 5.2.40.

    --Bill

    Comment


      #3
      I just added another motion sensor to my set up and noticed the 2 second recurrence. I believe Rich has fixed the rec_secs parameter of a recurring event to actually be seconds. I used that to set the recurrence time and now it is actually setting the recurrence to seconds (truth in advertising I suppose).

      I will upload version 4.5.1 shortly. I am altering my_motioninit.txt to set both rec_mins and rec_secs. In this new version, the RecurTime parameter in my_motion_const.txt will now need to be specified in "seconds". I will make my_motioninit.txt convert seconds > 60 to the appropriate min:sec.

      Jim Doolittle
      Jim Doolittle

      My Twitter
      My Hardware & Software

      Comment


        #4
        Hey Jim,
        Could you put in a version comment in the header section of each of your scripts? Sometimes I get cornfuzed when I browse through the versions. It would be nice to also include the date. If the script hasn't changed, perhaps you could indicate this.
        Thanks for sharing a great set of scripts!


        -------------
        GenevaDude

        Comment


          #5
          I apologize if this has been asked and answered before. I have been reading over the threads about these scripts (which look pretty nice BTW) and have been looking over the scripts themselves.

          I plan on setting my MR26A to not send the OFF commands from the housecode that I have my motion sensors on. I want to reply on HS to handle the delayed OFF.

          The question I have is it seems that the scripts only call NoMotion when they receive an OFF command from the motion detector, otherwise they trigger the fail safe if the motion detector has been ON too long. Is there an easy way to setup a delayed event for NoMotion that the delay would be settable by motion detector using this script?

          Thanks,
          Eric

          Comment


            #6
            Just to make sure, if I already have the motion sensor script up and running, can I just overwrite the my_motioninit.txt with the newer version and change the following in my_motion_const.txt:

            Const RecurTime = 50

            Thanks,

            Simon

            Comment


              #7
              htsource,

              I am not sure what version you are starting from to answer your question. To quickly fix the RecurTime, just go ahead and alter the "Const RecurTime = " line in your current my_motion_const.txt.

              Jim Doolittle
              Jim Doolittle

              My Twitter
              My Hardware & Software

              Comment


                #8
                Eric,

                If you the latest version of my script package, you can add code within the MotionAction procedure of my_motion_custom.txt that creates a delayed event to do something (e.g., turn another device OFF) x number of minutes after motion detected (X10 ON). If the delayed event already exists, the code can delete it first. This way continuing motion will keep "resetting" the trigger time.

                I use this approach almost exclusively although I do have some applications where I rely on the no motion trigger (X10 OFF) from the motion sensor.

                Code would look something like:

                This code turns off my backdoor light 30 minutes after motion is first detected. You can alter the hs.NewTimeEvent code to make this happen only on certain days of the week, etc.

                Jim Doolittle
                Jim Doolittle

                My Twitter
                My Hardware & Software

                Comment


                  #9
                  I'll try that tonight and see what I can get going.

                  Eric

                  Comment


                    #10
                    Thanks for your reply, I have 4.5.0 installed on my PC and so far I only copied my_motioninit.txt from your latest zip file (i.e. 4.5.1) and change the RecurTime = 50 in my existing my_motion_const.txt.

                    Please let me know if I need to update other files, thanks for your help.

                    Simon

                    Comment


                      #11
                      Simon,

                      You should be OK. Let me know if you have any problems.

                      I hesitate to add version numbers to the files that comprise the script package. I don't want to have version 4.5.1 of this file and 4.5.2 of that file and then call the package update some other version. Instead, I will start including a revision history for that individual file with the last revision date. I usually rely on file dates for other people multi-script efforts but this should work out better.

                      Jim Doolittle
                      Jim Doolittle

                      My Twitter
                      My Hardware & Software

                      Comment


                        #12
                        Jim,

                        Thank you very much for the updates. It seems to work okay with the changes.

                        SImon

                        Comment


                          #13
                          Jim,

                          I'm finding that my DD devices have a blank icon string until they have individually triggered the my_dusk2dawn_sensor.txt script. The motion sensor script has an initialization for all icon strings when it is triggered periodically, but it doesn't appear that the DD script does anything similar.

                          --Bill

                          Comment


                            #14
                            When the MS updates status, after trigger, it correctly shows Motion Detected othwerwise the status says "Daytime" and not "No Motion"?

                            When the DD is triggered by light, the both the DD & MS status goes to "Nighttime"?

                            I have attached my my_motioncustom.txt. Please let me know if you see anything that would help fix this. I'm using 4.5.1 - fresh install.
                            Attached Files

                            Comment


                              #15
                              Bill,

                              Icon initialization is done with the InitizeSensors procedure within my_motion_procs.txt. It handles both motion sensors and dusk/dawn sensors. The icons are not "initialized" by my_motionsensor.txt (read further).

                              If my_motionsensor.txt was executed via recurring event, only the no motion time of the motion sensor's device string is updated. If my_motionsensor.txt was executed by X10 command, the device string (icon) of the corresponding motion sensor is updated. The dusk/dawn sensors are handled by my_dusk2dawn_sensor.txt which is triggered only by X10 command and changes the device string (icon) of dusk/dawn sensors.

                              I noticed that there is an error in the readme file and you should be initializing motion sensors and dusk/dawn sensors with the following code within startup.txt:
                              <pre class="ip-ubbcode-code-pre">
                              ' Initialize motion sensors
                              hs.RunEx "my_motionsensor.txt", "InitializeSensors", ""
                              hs.WaitEvents
                              hs.Run "my_motionsensor.txt"
                              hs.WaitEvents
                              </pre>
                              The second call to my_motion_sensor.txt acts as the first "triggering" of the recurring script. You should not call my_motion_procs.txt directly as I use it only as an include file (it does not contain a Sub Main).

                              Jim Doolittle
                              Jim Doolittle

                              My Twitter
                              My Hardware & Software

                              Comment

                              Working...
                              X