Announcement

Collapse
No announcement yet.

Using mcsMovement

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

  • Using mcsMovement

    Hello,

    I upgraded to Homeseer 2, and installed the mcsMovement plug in. It is looking for three files, movement.txt, includes/header.asp and includes/style.asp. Also, there is no link to the mcsMovement pages from the main page of Homeseer (web page, not the executable.) Help!

    -Larry Lovering
    Eastford, CT

  • #2
    Movement.txt is a file that I use as the script that is executed from mcsMovement. It means that you have a managed device setup to call this script when a status change occurs. Review your managed devices tab and remove the reference to running a script or create the script file if that is what you want.

    mcsMovement operates out of the HS menu that is the same one that is used to show the HS log and do the exit control. mcsMovement uses a Windows form for setup so it cannot be used if you are running HS as a service.

    The "includes" should be availble from the updater. There were written by CFGuy/Jeff Farmer.

    Comment


    • #3
      I have the includes and now, it displays from the HS menu (.exe.) But the Windows forms, including the status and display, do not show the links to the movement forms.

      Comment


      • #4
        There are two techniques of which I'm aware for the Links. One is with the Link editor from the Updater and the other is with a plugin forcing the entry. I've always edited mine so I could show only what I wanted easy access to and it includes more than just plugin-supported pages. I put in the forced entry in the latest posting so hopefully others will not object.

        Comment


        • #5
          Movement.txt

          I have been enjoying playing with the MCSmovement. I have noticed that there is an error in the log trying to find movement.txt. I searched all directories and do not find it. Do you have this file available separately?

          Thanks!

          Comment


          • #6
            One of the features of mcsMovement is the ability to spawn a same-thread or new-thread script when the status of a device changes. The user enters the name of the script and the initiation option as part of the properties of a device.

            I happen to use movement.txt as the script where I process some of my movement actions. The logic within it is unique to my situation. Movement.txt is only executed on your computer because a device status change property has requested that a file by this name is to be run. You likely did not intend for this and can be correctd by changing the script name or changing the execution option to none.

            For your amusement here is my movement.txt file

            Code:
            'Movement.txt
            'Movement Event Occurred
            
            Dim mv
            Const MotionSensor = 0
            Const DuskSensor = 1
            Const OffOnSensor = 2
            Const Security = 4
            
            Sub Main(sDeviceName)
                 ' Define the object if not running optimized script
                 if typename(mm) = "hspi" Then
            	set mv = mm
                 else
                     Set mv = hs.GetPlugins("mcsMovement")
                 end if
            
                Select Case mv.GetDeviceProperty(sDeviceName,"DeviceType")
            
                Case MotionSensor
            'MOTION SENSOR
            
                  If mv.isOn(sDeviceName) Then
            
                      Movement (sDeviceName)
            
                      If mv.Changed(sDeviceName) Then
                          NewMovement(sDeviceName)
                      End If
                  Else
                      NoMovement(sDeviceName)
                  End If
            
                Case DuskSensor
            'DUSK SENSOR
            
                Case OffOnSensor
            'OPEN/CLOSE SENSOR
            
            	Switches sDeviceName
            
                Case Security
            	Switches sDeviceName
            
                Case Else
                End Select
            
            End Sub
            
            
            Sub Movement(sDeviceName)
            
            	'hs.writelog "Movement",sDeviceName
            
                Select Case lcase(sDeviceName)
            
                  Case "kitchen nook motion"
            
                  Case "bedroom closet motion"
            
                  Case "bedroom master bath motion"
            
                  Case "hall entry motion"
            
                  Case Else
                End Select
            End Sub
                
            
            'DEVICE CHANGED TO ON
            
            Sub NewMovement(sDeviceName)
            
                Select Case lcase(sDeviceName)
             
              'HALL LIGHTS
            
                Case "hall stairs motion"
            
            	'Turn on stair light if nighttime
            	'Turn on entry light if motion from upstairs to stairs
                    If hs.isOnByName("House Nighttime") Then
                        mv.ExecX10ByName "Hall Stair Light", "On"
                        If mv.FromTo("Hall UpStairs Motion", "Hall Stairs Motion") Then
                            mv.ExecX10ByName "Hall Entry Light", "On"
                        End If
            	end if
            
            	'Turn off entry light if moving from hall to top of stairs (upstairs)
                    If mv.FromTo("Hall entry Motion", "Hall Stairs Motion") Then
                            mv.ExecX10ByName "Hall Entry Light", "Off"
                    End If
            
                  Case "hall upstairs motion"
            
            	'Turn on Stair light at nighttime
            	'Turn off Entry light if moving from downstairs to upstairs
                    If hs.isOnByName("House Nighttime") Then
                            mv.ExecX10ByName "Hall Stair Light", "On"
                    End If
                    If mv.FromTo("Hall Entry Motion", "Hall Upstairs Motion") Then
                            mv.ExecX10ByName "Hall Entry Light", "Off"
                    End If
            
            
                  Case "hall entry motion"
            
            	'Turn on Hall light if nighttime
            	'Turn off  stair light if from upstairs to downstairs
                    If hs.isOnByName("House Nighttime") Then
                            mv.ExecX10ByName "Hall Entry Light", "On"
                    End If
                    If mv.FromTo("Hall UpStairs Motion", "Hall entry Motion") Then
                            mv.ExecX10ByName "Hall Stair Light", "Off"
                    End If
            
            
              'ROAD LIGHTS
            
                '^19 = "Road Well Floodlight"
                'C3 = "Road Mid Floodlight"
                'C9 = "Road Sitting Place Floodlight"
            
            
                Case "road well_motion"
                    If hs.isOnByName("House NightTime") Then
                        'Leaving
                        'Arriving, turn on next 2 lights
            	         mv.ExecX10ByName "Road Well_Floodlight", "ON"
                             mv.ExecX10 "C3+9", "on"
                     End If
            
                Case "road mid motion"
            
                Case "road sitting place motion"
            
                Case "road garage motion", "road garage motion 2"
            
                Case "exterior shed floodlight motion"
            
                Case Else
            
                End Select
            
            End Sub
            
            Sub NoMovement(sDeviceName)
            
            	'hs.writelog "Movement", "No Movement " & sDeviceName
            
                Select Case lcase(sDeviceName)
                
            
                Case "road garage motion", "road garage motion 2"
            
                Case "road well_motion"
            
                Case "road sitting place motion", "road mid motion"
            
                Case "hall entry motion"
                    mv.ExecX10ByName "Hall Entry Light", "Off"
            
                Case "hall upstairs motion"
                        mv.ExecX10ByName "Hall Stair Light", "Off"
                        
                Case "hall stairs motion"
                        mv.ExecX10ByName "Hall Stair Light", "Off"
            	    if mv.IsOffByName("hall entry motion") then
                            mv.ExecX10ByName "Hall Entry Light", "Off"
            	    End if
            
                Case "bedroom master bath motion"
            
                Case "bedroom closet motion"
            
            
                Case "bedroom attic motion"
                    'if light on in attic and no motion for 15 minutes then message it
                        mv.ExecX10ByName "Bedroom Attic Light", "off"
                        hs.RunEx "MessageScript.txt", "Add", "Attic Light Turned Off" & " | " & "Kitchen Den"
                        
                Case "exterior shed motion"
                    'if light on in shed and no motion for 30 minutes then message it
            
            
                Case "exterior shed floodlight motion"
            
            
                Case "family fireplace damper"
                        mv.ExecX10ByName "Family Furnace Fan", "off"
                    
                Case "exterior shed floodlight motion"
            
            
                Case Else
                
                End Select
            
            End Sub
            
            
            Sub Switches (sDeviceName)
            
                Select Case lcase(sDeviceName)
            
                Case "family fireplace damper"
                    if mv.ElapsedTime(sDeviceName) > 5 Then
            	    if mv.isOn(sDeviceName) Then 
            	        mv.setDeviceValueByName "Ocelot Volume Increase Count",1  'up 1 notches
              	    else
            	        mv.setDeviceValueByName "Ocelot Volume Decrease Count",1  'down 1 notches
              	    end if
                    End if
            
                Case Else
            
                End Select
            
            End sub

            Comment


            • #7
              Michael,

              Thank you for the clarification. I thought that something was wrong. I guess I should have read more about it!

              Comment

              Working...
              X