Announcement

Collapse
No announcement yet.

Automatic lights off

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

    Automatic lights off

    Hi all,
    I use the "has been on for at least..." function to turn off my hall lights after they've been on for 6 minutes. However, this means that if I'm working in the hallway they are constantly turning on and off. What I'd like to do is turn them off if the X-10 command H1 On has not been received for six minutes.
    Anyone got any idea how to do this?

    Thanks

    John

    #2
    I described my approach in a reply to this thread:

    turn-light-off script

    Comment


      #3
      Nice simple idea Smee,
      I've not used delayed events before so I'll need to have a look into that, thanks for the info.

      JQ

      Comment


        #4
        Wow
        Smee, that is exactly what i was working on. Would you be willing to share the script? I'm pretty bad with scripting and this would help me to learn creation and deleting events from scripts.

        Thanks

        Marty

        Comment


          #5
          I'm planning on doing about the same thing, only with the ActiveEye motion sensors (on order from AO). The documentation says it will send an "on" signal command when it detects motion and an "off" command after x minutes of no motion. Those commands trigger HS events.

          Jeff

          Comment


            #6
            I believe the effect you are trying to achieve can also be done with mcsMovement without any scripting. mcsMovement is free from the updater.

            In essence an Area device is used to define the set of motion sensors that comprise the hallway area. This can be 1 or more.

            The device is setup to turn on immediately with motion and a minimum off time to be 6 minutes. The area device will now be on as long as there has been motion within the last 6 minutes.

            The area device will then be used to perform the device action of turning on and off the light in the hallway.

            Comment


              #7
              I'm home now and having a play with creating events with scripts... Could do with a few pointers if anyone can help.

              Thanks

              JQ

              P.S. Had a look at the mcsMovement plugin, looks amazing, and very complex, unfortunatley my sensors do not create X10 themselves, so are not devices, they tell the burglar alarm to create x10, so I don;t reckon I can use it. Still gonna play a bit more though, look slike I can work out how often people wander up and down the stairs ;-)

              Comment


                #8
                If it is a homeseer device then it can be managed by mcsMovement. It can use either the status of the device or the value associated with a device, depending upon how the device operates. They can be real or virtual devices.

                Comment


                  #9
                  That is a great idea Michael and I'll definitely try it, but for learning purposes I'd still like to see Smee's script.
                  Smee? Would you be willing to share it?

                  Thanks

                  Marty

                  Comment


                    #10
                    Here is my similar script


                    Create two events, one triggered by motion sensor, running the script below.

                    sub main()
                    hs.RemoveDelayedEvent "","Off front of house"
                    hs.DelayTrigger 300, "Off front of house"
                    end sub

                    The second, called Off_front_of_house, (in my example) that actually turns off whatever devices you want.

                    The first line of the script deletes any running delayed event (reset the clock everytime motion is detected). The second line creates a delayed event to run the event that turns off the light, the number is in seconds.

                    Make sense?

                    Comment


                      #11
                      Tyke,
                      There's something vaguely ingenious about that. I'm sure that given a few dozen monkeys and enough time I could'a come up with something similar.

                      Thanks

                      JQ

                      Comment


                        #12
                        No credit here, something I learned years ago on this board.

                        Comment


                          #13
                          Hi,
                          Strange thing,
                          after seeing the above script, I want to mention that this script I run, I had to stop using. It had been triggered about 20 times in one hour and the memory usage of homeseer increased from about 30k to 90k. It has taken a good two days for the memory usage to get back to about 41k right now. I sent in a helpdesk ticket about this.
                          Stuart
                          The below script was triggered by a motion detector.

                          sub main()
                          If hs.isoff("A9") then
                          hs.execx10 "A9", "on",0,0
                          end if
                          hs.removedelayedevent "A9",""
                          hs.delaytrigger 120,"hall night light off"
                          end sub

                          Comment


                            #14
                            I use a "soak time" approach because I also have audio announcements for my motion detectors over the house intercom.

                            Basically, my motion detectors send an ON every time they see motion. My motion script will announce motion only if the soak timer is off. If motion is seen, the soak timer is turned on. If the soak timer is on, then there will be no audio annoucement. This way, if I am hanging out in the family room, I won't here "Motion in the family room, motion in the family room, motion in the family room....", etc.

                            Once there is no motion for N continuous minutes, my noMotion script will turn the lights off, and say "No motion detected in the family room", and then turn the soak flag to off. The soak flags are just virtual devices.

                            Pretty easy idea. I assume other folks have done the same thing. I'll post the scripts if anyone is interested.

                            Thanks, rich

                            Comment


                              #15
                              Yup, I'd be interested in seeing those scripts Rich.

                              Ta

                              JQ

                              Comment

                              Working...
                              X