Announcement

Collapse
No announcement yet.

Motion detector overwrite

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

    Motion detector overwrite

    I have a motion detector on the patio that turns on lights when motion detected and turns off after 10 minutes. Problem I am having is let say I go back after 8 minutes. Motion detector picks up the motion yet the lights turn off after only 2 minutes due to the original comand. Is there anyway to have it overwrite the previous command so the lights remain on for the full 10 minutes everytime the motion dector picks up motion?

    #2
    Hi,
    you could add a script line after you set the light on such as
    &hs.setdevicetime "A10", 0
    or whatever you use for the patio lights code, so it resets the time and it gets to go the full 10 minutes.
    Stuart

    Comment


      #3
      <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0><TBODY><TR><TD class=tablecellscript noWrap align=right width=160>
      Code:
       
       
                  [URL="http://localhost:9000/actn7725&action_index=1&edit=1"][B][COLOR=#0000ff]Run script:[/COLOR][/B][/URL] 
      </TD><TD class=tablecellscript align=left>&hs.DeleteEvent "Closet (delayed action)"</TD></TR></TBODY></TABLE><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0><TBODY><TR><TD class=tablecelldevice noWrap align=right width=160>        [URL="http://localhost:9000/actn7725&action_index=2&edit=1"][B][COLOR=#0000ff]Device Command:[/COLOR][/B][/URL] </TD><TD class=tablecelldevice align=left>Library Closet On</TD></TR></TBODY></TABLE><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0><TBODY><TR><TD class=tablecelldevice noWrap align=right width=160>        [URL="http://localhost:9000/actn7725&action_index=3&edit=1"][B][COLOR=#0000ff]Device Command:[/COLOR][/B][/URL] </TD><TD class=tablecelldevice align=left>Library Closet Off Delay: 00:00:30</TD></TR></TBODY></TABLE>
      when I open the closet, a motion sensor trips this event. The event Closet (delayed action) is created. As I move, the light it re-turned on and a new delayed event is made. Just do that, simple.

      Or you can get really complex using mcs Movement or Doo Motion PLugins.

      --Dan
      Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

      Comment


        #4
        You don't need a script...

        There is an action that can delete a previously created delayed action or event and thus you don't need a script. You can create an event that has the following actions

        1. Delete delayed action for the device (if it exists)
        2. Turn on light
        3. Turn off light in 10 minutes

        At 8 minutes when motion is detected again, the event will fire; delete the existing delayed action and create new one to turn off the light 10 minutes later.

        See the example below
        Attached Files
        James

        Running HS 3 on Win10 .

        Comment


          #5
          James,

          does that work now? I used that in the past, it never did work for me...as it couldn't find items with (delayed event) tagged on...my guess...but it couldn't delete delayed events, so I started using the script method...

          --Dan
          Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

          Comment


            #6
            Gentlemen----Thank you for the quick response. I am going to try both however where exactly would I put the script line? I have no experience with scripts.

            Comment


              #7
              Originally posted by drozwood90 View Post
              James,

              does that work now? I used that in the past, it never did work for me...as it couldn't find items with (delayed event) tagged on...my guess...but it couldn't delete delayed events, so I started using the script method...

              --Dan
              There was problems in the past but it does work now. After the event triggers you can go to the events page and see "Delayed Actions" and you can the delayed events with the expected run time. And you will see that the expected run time will change after it has been deleted and re-added.
              James

              Running HS 3 on Win10 .

              Comment


                #8
                Originally posted by jdls View Post
                Gentlemen----Thank you for the quick response. I am going to try both however where exactly would I put the script line? I have no experience with scripts.
                In the event action, you will need to select "Run Script|Advanced View" and since this is a one line script you should put it in the box labeled
                "OR Script Statement:
                ie: &hs.speak "hello"
                James

                Running HS 3 on Win10 .

                Comment

                Working...
                X