Announcement

Collapse
No announcement yet.

Motion sensor - light control and occupancy status

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

    Motion sensor - light control and occupancy status

    I have the majority of the lights in my house and garage connected to z-wave switches. I have the arduino plugin which allows it to be interfaced to DSC motion sensors, I have around 15 that I will be installing in the house and garage. The setup scheme will be the same for all the motions sensors. What I would like to do is have a virtual device that is toggled when it detects motion, for occupancy tracking. So for example a motion detector is tripped, that virtual device changes to occupied and stays there for 30 seconds and then switches back to unoccupied. That way it would be easy to track which rooms are currently being occupied, or where a person is travelling through the house.

    Along with that when a motion detector is tripped it will turn on the appropriate light (after sunset) and start a timer. Every time there is motion it resets the timer. Once the timer hits a set level (for example 10 minutes), then the light shuts off.

    Does this sound like the right train of thought? Reason I want to bounce it off you guys is because once I do this for one zone, I will have to do this another 15 times. So any fat trimming or optimizing I can do now, will save me a bunch of effort down the road.

    #2
    A good deal depends on the layout of your house and its traffic patterns. For instance, you may find that turning on a light with one motion detection results in too much on/off activity of the lights.

    When I was setting up my motion detection system I first tracked the pattern of motion detection events to see what an 'occupied' room looked like. Then I used that information to help design the criteria for 'occupied' and 'unoccupied'.

    So, instead of turning on a light, I increment the value of a virtual device I call room motion each time motion is detected. If no more motion in 30 seconds, I decrement the value. I then set threshold values for deciding whether the room is occupied or not. One advantage is that it's easy to change the threshold to fine tune the behavior of things like lights.
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    Comment


      #3
      There are a number of different ways to do it - in HS2 a method which is still entirely valid for HS3 is to have a single event that triggers on motion, the first action is to cancel a delayed device action, the next action is to turn the device on and then the final action is to turn it off with a delay of x minutes - that way whenever the event runs it removes the delay and starts fresh.

      There is another method which I currently use which is to have two events, one to turn the light on at motion and the other runs when it has been no motion for x minutes, when that event runs I turn off the light - if motion had been detected in the mean time then that event would never run.

      A lot of the methods are as short as they are long, i'm still building events like in HS2 so don't really use timers but this could be an area which they come in very handy and a perfectly valid way of doing it.

      Comment


        #4
        I would check out the scenemaster plugin as the author is currently running a beta that should do almost what you are looking for. With motion tied to scenes, it really should be easy to have seemless movement with a little planning.
        I love how it returns light to previous state rather than creating several events for if it is on, or dim, or night or low light etc...

        Comment


          #5
          IMHO timer based lights-off is good for areas where people just pass through them.... but when you stop and do activity in the room, then you'd want to handle it differently, so the users don't have to deal with constantly 'reactivating' the timer.

          Another special case is room w/ only one exit/door. Combining motion sensor with a door sensor, you can determine whether someone is entering and exiting the room and treat the lights accordingly.
          HW: HS3 w/ Win8.1 on ASRock C2550d4i. Digi AnywhereUSB, Hubport, Edgeport, UZB, Z-trollers, PLCBUS, SONOS, GC-100, iTach IP2SL, WF2IR, IP2IR, RFXtrx433, Harmony Hubs, Hue, Ademco Vista 128BP, NetAtmo, NetAtmo Welcome

          Google Search for HomeSeer Forum

          Comment


            #6
            Originally posted by Conrad_Turbo View Post
            What I would like to do is have a virtual device that is toggled when it detects motion, for occupancy tracking. So for example a motion detector is tripped, that virtual device changes to occupied and stays there for 30 seconds and then switches back to unoccupied. That way it would be easy to track which rooms are currently being occupied, or where a person is travelling through the house.

            Along with that when a motion detector is tripped it will turn on the appropriate light (after sunset) and start a timer. Every time there is motion it resets the timer. Once the timer hits a set level (for example 10 minutes), then the light shuts off.
            You have described what I am currently testing with Enerwave motion sensors and it works pretty well with a few modifications:

            1. I have a manual override physical switch that bypasses them for 4 hours and keeps the lights on for when I want to read or have dinner in the room without worrying about lights going off and on.

            2. I have a power monitoring switch on the TV in the adjacent great room so if it is active then the lights will stay on because that is when you sit still and the motion sensors tend to not be very effective.

            3. I have a 10 minute timer that starts from the last motion sensed then stops and resets.

            My Enerwave devices send an off signal after about 30 seconds but if yours only send an on signal it should be possible to have something shut off after a set period. For my manual override timer I use an event with

            IF
            Living Room Manual Lighting Override 4hrs has been On for at least 4h, 0m, 0s
            Then
            Set Device Living Room Manual Lighting Override 4hrs to Off (this is a virtual device and I use events to control).


            Let me know which pieces you want to see and I will be happy to share what I have working so far.

            Comment


              #7
              Here are some more pieces to get you thinking:

              1. I have a virtual device for manual override.

              2. I have a physical switch that toggles on or off the manual override virtual device with an event.

              3. I have a living room occupancy timer named Lamp LR.

              4. I have an event to turn on minimal lights for motion
              IF Living Room Occupancy Sensor 1 Motion was set and has a value equal to On-Open-Motion
              AND IF The time is nighttime (after sunset, before sunrise).
              AND IF Living Room Manual Lighting Override 4hrs has a value equal to Off
              Then
              Set Device Living Room Table Lamp to On Last Level

              5. I have an event to turn off those lights after motion and timer expires
              IF Lamp LR's (timer name) value is more than 10m, 0s
              AND IF Living Room Manual Lighting Override 4hrs has a value equal to Off
              AND IF Living Room TV Monitor Watts has a value equal to 0 Watts
              Then
              Set Device Living Room Overhead Lights to Off
              Then
              Set Device Kitchen Overhead Lights to Off
              Then
              Set Device Living Room Table Lamp to Off
              Then Stop Timer Lamp LR
              Then Set Timer Lamp LR to time 0 Seconds

              6. I have a lighting occupancy timer event
              IF Living Room Occupancy Sensor 1 Motion had its value set to Off-Closed-No Motion
              AND IF Living Room TV Monitor Watts has a value equal to 0 Watts
              Then Set Timer Lamp LR to time 1 Second
              Then Resume Timer Lamp LR
              Last edited by Planetview; November 6, 2015, 02:48 PM.

              Comment


                #8
                Here is a screen shot of my main devices (excludes some counters and root devices). I try to keep it simple:

                Click image for larger version

Name:	Devices.png
Views:	1
Size:	73.6 KB
ID:	1181010

                Comment


                  #9
                  Originally posted by Uncle Michael View Post
                  A good deal depends on the layout of your house and its traffic patterns. For instance, you may find that turning on a light with one motion detection results in too much on/off activity of the lights.

                  When I was setting up my motion detection system I first tracked the pattern of motion detection events to see what an 'occupied' room looked like. Then I used that information to help design the criteria for 'occupied' and 'unoccupied'.

                  So, instead of turning on a light, I increment the value of a virtual device I call room motion each time motion is detected. If no more motion in 30 seconds, I decrement the value. I then set threshold values for deciding whether the room is occupied or not. One advantage is that it's easy to change the threshold to fine tune the behavior of things like lights.
                  I do agree, I want something I can replicate for all the sensors but be able to individually tune based on the type of activity. So yes rooms with a lot of activity, kitchen being one would be a good candidate for a shorter timer, while as rooms with an initial motion and then lack of motion even though it's occupied, such as an office, would have a longer delay. I'm sure that even a 10 minute window the timer will be reset even with me sitting at a desk.

                  I like the idea of tracking a pattern of motion. Very intriguing. Such as picking up motion in a hallway and then finding motion in the bedroom. Then starting the time and then shutting off the light in the bedroom until it picks up motion in the hallway again. The ideal setup for a single person, but with a wife and a 4 year old it would make it a bit more complicated.

                  Incrementing/decreasing a counter based on movement is a neat idea. So instead of resetting a timer it adds time to keeping the lights on? So if there was a lot of activity the time it would take to shut off the light would be longer based on the amount of activity in that room?

                  Originally posted by mrhappy View Post
                  There are a number of different ways to do it - in HS2 a method which is still entirely valid for HS3 is to have a single event that triggers on motion, the first action is to cancel a delayed device action, the next action is to turn the device on and then the final action is to turn it off with a delay of x minutes - that way whenever the event runs it removes the delay and starts fresh.

                  There is another method which I currently use which is to have two events, one to turn the light on at motion and the other runs when it has been no motion for x minutes, when that event runs I turn off the light - if motion had been detected in the mean time then that event would never run.

                  A lot of the methods are as short as they are long, i'm still building events like in HS2 so don't really use timers but this could be an area which they come in very handy and a perfectly valid way of doing it.
                  Ya I am running HS3 so a timer would work in my case. With so many of the same type of triggers I just wanted to make it as simple as possible.

                  Originally posted by 519zwave View Post
                  I would check out the scenemaster plugin as the author is currently running a beta that should do almost what you are looking for. With motion tied to scenes, it really should be easy to have seemless movement with a little planning.
                  I love how it returns light to previous state rather than creating several events for if it is on, or dim, or night or low light etc...
                  Returning to a previous state is pretty cool! The ramp rate also is pretty impressive...I didn't realize that was possible. I might try it out to see what I can do, I am just worried I might get limited by the plugin, but it seems to lay things out in a no brainer kind of way.

                  Originally posted by LeoS View Post
                  IMHO timer based lights-off is good for areas where people just pass through them.... but when you stop and do activity in the room, then you'd want to handle it differently, so the users don't have to deal with constantly 'reactivating' the timer.

                  Another special case is room w/ only one exit/door. Combining motion sensor with a door sensor, you can determine whether someone is entering and exiting the room and treat the lights accordingly.
                  I do agree this won't work for every room. The plan down the road will be to combine doors sensors with motion to verify room occupancy...right now the house will be starting off with motion just due to cost. The garage addition I am working on will be "easy", there are 3 zones, three large open spaces with each zone with their own z-wave controlled lights. I move around a lot in the garage, but all 5 garage doors will be monitored as well as the 3 man doors and god forbid I try to sneak out a window too. So with the garage it will be easier, however with the house we only have a few doors sensors, excluding the outside doors we have a guest bathroom and a bedroom being monitored. So for the bathroom if it detects motion the light will turn on, if the door changes to close and it picks up motion in the room then time timer could be kept at 0 in order to never shut off the light, until the door is opened and then the motion detector never sees motion for the next X minutes and then shuts off the light. A bit different scheme with a bedroom as I wouldn't want the light to kick on if one of us moves in our sleep etc... I'm just trying to get a good idea of how to make a event structure that works and then can be copied for all the other zones, then individually modified and tweaked for their application.

                  Originally posted by Planetview View Post
                  Here are some more pieces to get you thinking:

                  1. I have a virtual device for manual override.

                  2. I have a physical switch that toggles on or off the manual override virtual device with an event.

                  3. I have a living room occupancy timer named Lamp LR.

                  4. I have an event to turn on minimal lights for motion
                  IF Living Room Occupancy Sensor 1 Motion was set and has a value equal to On-Open-Motion
                  AND IF The time is nighttime (after sunset, before sunrise).
                  AND IF Living Room Manual Lighting Override 4hrs has a value equal to Off
                  Then
                  Set Device Living Room Table Lamp to On Last Level

                  5. I have an event to turn off those lights after motion and timer expires
                  IF Lamp LR's (timer name) value is more than 10m, 0s
                  AND IF Living Room Manual Lighting Override 4hrs has a value equal to Off
                  AND IF Living Room TV Monitor Watts has a value equal to 0 Watts
                  Then
                  Set Device Living Room Overhead Lights to Off
                  Then
                  Set Device Kitchen Overhead Lights to Off
                  Then
                  Set Device Living Room Table Lamp to Off
                  Then Stop Timer Lamp LR
                  Then Set Timer Lamp LR to time 0 Seconds

                  6. I have a lighting occupancy timer event
                  IF Living Room Occupancy Sensor 1 Motion had its value set to Off-Closed-No Motion
                  AND IF Living Room TV Monitor Watts has a value equal to 0 Watts
                  Then Set Timer Lamp LR to time 1 Second
                  Then Resume Timer Lamp LR
                  I do like the idea of monitoring the TV consumption, as motion may be fairly low in the living room and that would prevent the lights from going out. The manual override is a neat idea too, is that just a manual button you have placed in the room? So most likely used in the dining area type setting?

                  Comment


                    #10
                    Yes, the manual override on/off and 4 scene switch is in between the kitchen and living room where there is a dining area (a very long great room). I still have a ton of X10 stuff and am now switching over to z-wave. I used an X10 surface mount like this one, you can label each button with very small writing or larger numbers, the plastic cover to buttons is removeable:

                    Click image for larger version

Name:	switch.jpg
Views:	1
Size:	2.8 KB
ID:	1181014

                    I also have speech for each button to confirm function:
                    Speak Lights are now in manual mode for the next 4 hours. Press off to cancel. or
                    Speak Lights are now in automatic mode. or
                    Setting lights to scene 1....

                    Comment


                      #11
                      Originally posted by Conrad_Turbo View Post
                      Incrementing/decreasing a counter based on movement is a neat idea. So instead of resetting a timer it adds time to keeping the lights on? So if there was a lot of activity the time it would take to shut off the light would be longer based on the amount of activity in that room?
                      To control the time for the light to go off with no activity I cap the maximum value of the counter.
                      Mike____________________________________________________________ __________________
                      HS3 Pro Edition 3.0.0.548, NUC i3

                      HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

                      Comment


                        #12
                        I only have one entrance. I tested a setup where I had a virtual counter in Homeseer. When it reaches 0 then no one is in the house. For someone going out (motion followed by the door switch) subtract 1. For the opposite incoming add 1. I could not get it to work properly, the count got off after a few weeks... I thought this would work because the more people that enter the higher the count and they have to go back out at some point but I could not track single people coming in then groups going out. sigh.
                        Last edited by Planetview; November 10, 2015, 09:18 PM.

                        Comment


                          #13
                          For occupancy status I am currently trying IFTTT to track who is out of the house based on location but it is very unreliable. Tasker was very accurate based on connection to nearby cell towers but I can not get it to communicate with Homeseer from the online tutorials.

                          Comment

                          Working...
                          X