Announcement

Collapse
No announcement yet.

Event Trigger on occupancy sensor movement

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

    Event Trigger on occupancy sensor movement

    What is the best way to trigger an event after motion has been detected on a selected group of motion sensors. I want to select about 10 sensors, so ideally don't want 10 events.

    I'd like to use an occupancy sensor, (called "House") and trigger an event each time movement / echo is detected, but I can only trigger event on occuapancy if active zone changes to on or off. Is there an easy way around this?

    Thanks

    Jim

    #2
    Not sure if this helps but UDMC can be triggered by either a motion sensor or an occupancy sensor. So if you want something triggered by each motion detected, put the code in the UDMC for each motion sensor. Or you can have each sensor trip a certain script that contains the code you want executed.

    Comment


      #3
      Thanks heatvent,

      I have an occupancy sensor which I have UDMC "on code" to trigger and event called "Motion". The code I've used is:

      hs.TriggerEvent "Motion"


      however, when there is movement the event is not triggered, have I missed something?

      Comment


        #4
        I've had a bit more of a play with this, but still can't get the code to execute. to make things simple I added this code:

        hs.speak "hello there", True

        I also tried this:

        Sub Main()
        hs.speak "hello there", True
        End Sub

        I don't get any errors in the event log

        Comment


          #5
          ahhh, just found that "Enable User Defined Motion Code Scripting" was not enabled, and now I can get errors in the event log.

          What does this error mean? "16/11/2010 16:56:05 - Error - Script compile error: Method arguments must be enclosed in parentheses.on line 34"

          Also the commands are only run when the device changes from off to on, how can I get an event triggered each time there is motion?

          Comment


            #6
            Try this:

            hs.TriggerEvent("Motion")
            Cheers,
            Bob
            Web site | Help Desk | Feature Requests | Message Board

            Comment


              #7
              Magic!!! using code:

              hs.TriggerEvent("Motion")

              it works, but only when changing from off to on, how can I get it to run the event every time motion is detected?

              Thanks

              Jim

              Comment

              Working...
              X