Announcement

Collapse
No announcement yet.

Your method for House Modes & Occupancy?

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

  • Your method for House Modes & Occupancy?

    I'm converting from Vera to Homeseer and have extensive House Mode and Occupancy coding.

    Vera has built-in House Modes that I can leverage so I just had to integrate those into some PLEG logic and my EVL3 plugin. Looks like Homeseer will be much more involved/manual

    Looking for your input in hope to avoid limitations, problems, etc.

    thanks@

  • #2
    I have a virtual device named Occupancy. It has four states: Away, In bed, Up inside, and Up outside.
    • Away is determined by the alarm system being armed away.
    • In bed is determined semi manually. We each (there are two of us) tap a button on an HSTouch controller when we go to bed. (The incentive is that HS takes care of putting the house to sleep if we do that.)
    • Up inside is initiated when the alarm is disarmed or if the master bath scene controller is set to the morning scene.

    • Up outside is inferred by lack of activity and is based on my analysis of motion data and light patterns. It's conservative, to prevent false determinations.
    • Up inside is assumed if we are not away or in bed. If HS thinks we are outside, opening any door, triggering key motion detectors, etc., will return the system to inside status.

    It took some time to get the inside/outside balanced, but has been working well for over a year now.

    The good news / bad news of HS is that living patterns are different for different families, as are useful occupancy state categories. HS gives you the flexibility to implement what works best for you. To do that, though, requires significant effort. Because I see HA as a hobby, I think of it as fun.
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10: XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

    Comment


    • #3
      Similar to Uncle Michael, we have a virtual device which has three states: awake, sleep and vacant.

      While we have the ability to have physical interaction with HS to change states (minimotes, Alexa & HS switch scenes), we rely on a "hands off" approach.

      Each of our rooms and living areas have motion sensors which set another virtual device, room-zone, to "occupied". When there is no motion within a set amount of time, variable per room, that particular zone changes to "vacant".

      We also track which motion detector last tripped for movement logic. As an example, if we have moved to our bedroom, then the last motion detector to trip would be in the master bedroom, and the sequence would be stairs, loft, MBR hall, master bedroom.

      When all zones except for sleeping quarters are "vacant" and the time of day is "Night Time", the virtual device changes to "sleep" and various events are fired.

      When both of us have left the house, then the virtual device changes to "vacant". We achieve this by using iBeacons in our vehicles and geo-fences.

      Similarly, when one of us returns home, the virtual device changes to "awake" and heating/cooling and lighting is controlled.

      I was looking at the last time we have physically operated our HS switches and some have not been pressed since they were installed, although most are controlled by HS3 every day.

      The ability to imagine a solution is one of HS3's strengths, and also, one of its weaknesses because it is not an "out of the box solution". I continually read the messages on this board for tips and suggestions to tweak our individual system, programmed for us.
      Michael

      HS3 Pro 3.0.0.470 | 849 devices | 349 events | OpenSprinkler | BLShutdown | EasyTrigger | NetCAM | Harmony Hub | Sonos | SDJ-Health | BLUPS | PHLocation | BLBackup | BLLock | Z-Wave 3.0.1.243 | weatherXML | Pushover 3P | Blue-Iris | AirPlaySpeak

      Comment


      • #4
        I have a virtual device for everyone in the household. Presence is determined by phone connectivity to the network. I also have a device for being in bed (determined by a pressure sensitive mat under my futon and connected to my DSC panel). I have a device for each of us being outside which is determined by a phone connecting to the outside wi-fi access point. This is all automated. I have a device for when we have company and one for when my daughter has company which is also based on cell phone connectivity. There is no need for me to interact with HS much at all. Pretty much all I do is turn the thermostats off in the spring and on in the fall. I don't touch light switches except to set the dim level.

        Unplugging my Vera was the best home automation decision I've ever made. PLEG was a nightmare. It just got way too had to manage when dealing with complicated situations.
        Originally posted by rprade
        There is no rhyme or reason to the anarchy a defective Z-Wave device can cause

        Comment


        • #5
          Take a look at this post I did last week that gave a small overview of what I do:

          https://forums.homeseer.com/showpost...03&postcount=9

          I have a few different modes depending on time of day, type of weather and occupancy, but I deal with occupancy outside of the house mode virtual device. I have a VD for that and it looks for my wife and I based off geofencing and arms/unarms the alarm and doors and turns on/off the lights depending on where we are.

          I use the house mode VD to check against to see if lights should be turned on when we come home (day shouldn't have any lights on unless the weather is bad).

          The house goes into cleaning mode automatically every other friday and turns on all the lights and disables the alarm for 3 hours and turns on the code to unlock the doors for the cleaners for that 3 hours. We leave the house, and they can come do what they need during that time.

          Entertain mode just disables all the motions when we have people over and turns on the lights on the main floor. It was cool initially to show my friends all the cool stuff my house does, but I have gotten to the point that my automation is to not be seen or noticed , and just work.

          Sleep mode is triggered by a button push on my in wall controller on the way up the stairs (last person up pushes it), shuts down everything in the house and locks doors, arms alarm. This also puts all the motions in the "walkways" active to turn the lights on very dim if we need to let the dogs out or something.
          Attached Files

          Comment


          • #6
            I'm reviving this old thread. I think designing the broad structure of the system is critical as it becomes increasingly complex. Like many people here I have some software development background. We all know what happens when we don't put effort into structuring a system.

            I have three occupancy states: unoccupied(0), occupied(1) occupied(2).

            I have nine house zones, including four exterior zones. Each zone has its own occupancy status. One virtual occupancy device for each zone.

            occupied (1) is that there may be person in the zone.
            occupied (2) is that there is almost certainly a person in the zone. Occupancy (2) trips the burglar alarm if the zone is interior and the system mode is armed and away.

            My inconsistency with this design is how I treat window sensor when security is "armed and home".

            The point of this design is to cleanly break sensing from events so that I can change the system and still know WTF is going on.

            I think house modes are critical for systems with a lot of events and scripts. I'm still working on how to think about more unusual modes like the cleaning lady or the plumber in the basement while no one else is home.

            I have an increasing number of exterior sensors. My goal, when away from home, is that the systems does an excellent job of pretending that someone is home but not answering the door. My dog may have died last year, but he still barks when someone is on my front porch.

            Currently I just use geofencing as a nag if I leave the house without locking the doors or setting "away".

            Comment


            • #7
              These are excellent concepts.

              As I also have software dev experience, what I’m looking for is a FRAMEWORK for HS3 occupancy/modes, if you will.

              In software dev this would be a library/SDK that sits on your base framework/rudimentary stuff for you. Like MySensors for Arduino.

              dmiller I *LOVE* the idea of having a 0-1-2 approach to occupancy. How do you waterfall from high state to low? On timers?

              Separate Questions:
              Do you have a Mode per each room + whole house mode? If yes, how do you waterfall? For example, child A’s bedroom is in nap mode but the living room is in Watch TV.

              Comment


              • #8
                I live alone, so have an easier time with occupancy and automation interaction than with 2 or more people. The more virtual devices that exist for a person, their location/state & schedule, the easier it is to script responses to their activity. The complexity & length of the programming may increase, but the possibilities also increase. I created a "room" called Randy with a few virtual devices that keep track of various aspects of my position & state. I also keep track of weather, daylight, moon phase, calendar events such as work days, vacation days, sick days, holidays, & anniversaries. I've spent a lot of time looking at what other people have come up with, thinking about how a transparent system could interact with me without getting too much in the way or failing completely. Surely, Iron Man's JARVIS & Star Trek's computer interactions have inspired how I approach this hobby. For such a system to be a reality, it has to know as much about me, my schedule & my surroundings as possible. I've realized it will probably always be a work in progress and feel like I'm at the beginning of putting thought into action.
                • Room
                  • Virtual Device
                • Randy
                  • Consciousness: Whether I'm Asleep or Awake
                  • Presence: Whether I'm home or away
                  • Location: Which room in the apartment I am currently in (or Unknown when away)
                  • *Want to get an iWatch to track health-related aspects (heart rate, sleeping patterns, at rest vs exercising etc.)
                  • iPhone: Whether it's on my network or not
                  • Morning Commute: Checks the Waze API for my drive time to work
                  • Evening Commute: Waze API for my drive home
                • Outside
                  • Visibility: Darkness or daylight
                  • Various weather devices: moon phase, conditions (rain, snow, wind, fog etc.), few days forecast (WeatherXML plugin). My morning TTS update includes mostly weather info and I can ask Siri about each one individually, if desired.
                  • Motion sensors outside windows (nice to know if someone climbed the fire escape and is sitting outside my window prior to actually trying to break it)
                • Home
                  • Virtual Devices that are main controllers not specific to one room:
                    • Media Center (speakers & mics in each room, but the main control center for all audio works everywhere)
                    • Security (Same. Motion & sensors for windows/doors in ea room, but the concept of an overall security system and state of the home)
                    • Lighting: A sense that light is something that follows me around room to room. When I want to turn on the lights wherever I am, I say, "Hey Siri, illumination" and she knows where I am and the state of the lights currently in that location. If they are off, they turn on and vice versa. (Used to be able to say, "Hey Siri, lights" like Star Trek TNG, but HomeKit hijacked that verbal command recently and would turn all lights on/off regardless that I had an event called "lights")
                    • HVAC: Have a NEST thermostat and an in-window air conditioner (it's a small apartment) controlled via IR
                    • Networking: Check the status of my cable modem, check Internet speed & latency once per hour, all my networked device statuses like Wifi routers, computers, PS4, AppleTV, ink jet & 3D printers, NAS, Echos, etc.
                • Calendar
                  • Separate Google calendar for each type of day: work/weekend day (whether it's a long weekend - 3 or 4 day), vacations, holidays, anniversaries, adhoc sick days. (BLGData plugin)
                I have many more devices to control & sense things but all of those above compromise the basic neural network of information I can utilize when programming interactions. For example, when speaking the morning greeting upon waking up, it will skip mentioning the morning commute time and best time to leave to make my first appointment on my work calendar if it's not a work day. If it's the first day of the weekend (usually a Sat) it will end the greeting with something like, "Enjoy the weekend" or "Enjoy the long weekend" if it's going to be 3 or 4 days. If it's the 2nd or 3rd day of a weekend, it simply says something like, "I trust you are enjoying the weekend". I'd like to inject some searches on local events I may be interested in and have it suggest things here and there I may not know about a few days in advance.

                One of the things that has always been a pain in the *** to get right is motion control of lights. For years, I tweaked a series of timers and sensors to "guess" when I was no longer in a room to have the lights go out. It never worked. Nothing like sitting on the can and having the lights turn off, only to realize there is a 1 minute grace period before the motion sensors are recognized again. Flailing your arms to get the lights back on sucks. So, instead, I now use the BLRadar plugin's Movement section to sense when I move from one room to another. It. works. perfectly! A single device is a combination of a "from" and a "to" motion sensor. So the single "Entrance -> Living Room" virtual device turns on when you move from the Entrance to the Living Room. Makes it easy to create events for movement between rooms instead of on a room-by-room basis. The lights in a room turn on when I enter and would stay on forever if I never left. As soon as I leave that room and trigger any motion in another area, HS knows which room I WAS in and turns those lights off. This is the sort of approach that only works for a single person in an environment. As soon as you introduce a 2nd person, the logic fails. I think having a personal keyphob would be the best approach to a multi-person lighting automation setup. Then I'd keep track of actual occupancy count per room.

                The NEST home/away variable is my main source of truth for arming my security and drives the Randy Presence VD. Using the Home app (not Apple's, this one existed before Apple put out their Home app), I have a few favorite scenes on my iPhone lock screen for arming/disarming security and locking/unlocking the front door (August lock). All devices get turned off when I arm the system or say, "Hey Siri, good night" at the end of the day. I hated remembering to push a button for such things as I always forgot and then had to go to where the button was to press it. Rather than walk around with wireless buttons (did that for a while), I always have the phone on me and it's easier to say something. As part of the security, I send a command to my Foscam cameras when arming to turn on motion alarms. If someone opens a door or window or triggers a cam's motion while the Home is in armed mode, it sends me an SMS text message within 8 seconds, starts recording video to my offsite shared hosting FTP server and turns on a bunch of Philips Hue lights in red (an LED strip also goes into police mode: flashing red/blue/white). Will eventually have an iPad by the front door so I can announce that the intruder is being recorded and the authorities have been notified.

                Tweaking all of this for a single home/apartment is one thing. Once I am satisfied with the operation, I want to extend it to my car (iPad with cell chip) and work place. Once I have car connectivity, I think I'll be inspired to create a new "Randy Movement" VD for when I'm stationary, walking, running, riding a bike or driving. Not because I have a need for that info now, but I may in the future want my JARVIS to know if I'm moving or not and how fast? (GPS movement of the phone, I suppose) For work, I just want to control the cubicle lighting & sense if someone was in my cubicle when I wasn't there. At home, I can send the TTS audio to whichever room I am currently in, though I can't get Amazon Polly voices to work with the PC version of HS! It works great with the Linux version, and I do have a 2nd install of HS on a Raspberry Pi, but I'm running the PC version for Wine on it simply because the X10 plugin works better there than on my Windows 10 version of HS. When offsite, I want to be able to send TTS directly to my iPhone or the iPad in the car. At that point, the home automation crosses the line into JARVIS territory, becoming more a personal assistant than just home automation. I have done some voice recognition/TTS with HS in the past and was happy with it. However, I mostly use Siri for commands and don't have any interaction like I used to. Hopefully, Siri will advance soon to stay listening for a few seconds after every command (like Alexa, though Alexa skills and HS are way too wordy) so I can say, "Hey Siri. Lights. Brighter. Perfect. And some music. Softer." Instead, I'm saying "Hey Siri" about a hundred times a day. My neighbors must think I'm insane!

                Comment


                • #9
                  Originally posted by RandyInLA View Post
                  . My neighbors must think I'm insane!
                  hahah

                  Comment


                  • #10
                    Originally posted by RandyInLA View Post
                    One of the things that has always been a pain in the *** to get right is motion control of lights. For years, I tweaked a series of timers and sensors to "guess" when I was no longer in a room to have the lights go out. It never worked. Nothing like sitting on the can and having the lights turn off, only to realize there is a 1 minute grace period before the motion sensors are recognized again. Flailing your arms to get the lights back on sucks. So, instead, I now use the BLRadar plugin's Movement section to sense when I move from one room to another. It. works. perfectly! A single device is a combination of a "from" and a "to" motion sensor. So the single "Entrance -> Living Room" virtual device turns on when you move from the Entrance to the Living Room. Makes it easy to create events for movement between rooms instead of on a room-by-room basis. The lights in a room turn on when I enter and would stay on forever if I never left. As soon as I leave that room and trigger any motion in another area, HS knows which room I WAS in and turns those lights off. This is the sort of approach that only works for a single person in an environment. As soon as you introduce a 2nd person, the logic fails. I think having a personal keyphob would be the best approach to a multi-person lighting automation setup. Then I'd keep track of actual occupancy count per room.

                    Occupancy Status is tough...

                    For the house, Wasp In a Box logic works well because the exterior doors are generally closed. i.e., If motion has been detected since exterior doors were closed, then house is occupied until an exterior door is opened. I have similar WIAB logic setup for all of my interior rooms which have doors, and I use timers for when those doors are left open and for rooms which don't have doors. The master bedroom is tricky because we rarely close the door thus timer concept doesn't work well, In this case I leverage the motion sensor outside of the master bedroom as a barrier for the wasp-in-a-box logic. Similar concept for the basement.


                    The best approach that I've found thus far for occupancy controlled lighting is to disconnect the lights from the motion sensors. i.e, One set of rules for occupancy detection, another set of rules which control the lights based on whether the room is occupied or not. Most of the rooms have a 1 minute timeout for occupancy (changes from Occupied to Unknown) when the door is left open, but the lights are configured to shut off if the occupancy status has been unknown for more than 5 minutes. The Living Room, Kitchen, and Hallway lights turn off 15 minutes after those rooms are marked 'Unknown'. I can enable/disable this functionality in each room via a virtual device called 'Automatic Lighting'. I also leverage the Home Status in some of my lighting rules.. i.e., If the house is in sleeping mode, disable automatic lighting in the kids bedrooms, or, if the house is in sleeping mode, when occupancy detected only bring the lights up to 15% vs 100%.

                    Comment


                    • #11
                      I think that is what i will do. Instead of having one device with a bunch of state ( people/ two moment of the day day |night , and two modes /here bot here. )

                      . Wellll...i’ll keep it , but I will also create occupency per room. It is not a hard task ..just need to do it lol.


                      —-

                      It is very easy to know when someone is home.
                      But knowing nobofy is home is harder.


                      You guys have ideas? I won’t talk about bad techniques like wifi for know someone is not there ...

                      1-Geofence : reliable most of the time, but not 100% ...+ need to always have a phone/ watch in us.
                      2- Our two cars are not there ( Installing a realiable wifi/bluetooth object powered by the car could maybe do the tricks.

                      3- Camera that detect our face and/or car (costly, and need to implement it. )

                      4- bluetooth dongle We can attach on a keyfob.

                      5-some logic near the principal door. (With some condition event to cancel , etc etc, those event if the sequence is no right...but I won’t write them here , I think you can infer them). This is just a general logic.

                      A. If a motion sensor (or two) detects motion near the door Set a virtual counter to 1.

                      B. If the door is open , and if a motion sensor is still in ‘’motion’’ state. Set virtual counter to 2.

                      C. Set virtual counter to 3 if the sequence from A happen again.

                      D. Set Virtual counter to 4 if the sequence from B happen again. Wait 1 minutes

                      E. Retract 2 to virtual conter if anyone do the sequence in reverse.

                      create another virtual house device #2:
                      0=Nobody’s here.
                      1=At least someone is here.

                      some controls for VD house =1

                      set the VD to 1 if any of those are true:
                      - Tv has been set to on
                      - alexa hear something more than two times
                      - any laptop is set to on
                      -my pc is set to on
                      -the fridge has just been open and then closed.
                      Etc.

                      Controls for VD House =0
                      -Set the VD to 0 if geophency detect we enter a geofence that is not our home



                      I’ll try to format this post better when I get my laptop. But you get the idea.












                      Comment


                      • #12
                        Some idea for bed occupancy:

                        build something with an arduino, that can mesure how much pressure/kg are in the bed .

                        Ex:

                        -60 kg = Girlfriend’s in bed

                        -88 kg = Matt’s in bed (our biggest cat is 6.5 kg, second is 6 kg, the two last are both 4kg...so 20.5 kg in total )( I guess it is safe, if I do not loose 8kg haha. But seriously, even if the margin becomes lower, i’ll just play with events conditions and it’ll be ok. ) ( one last option would be to loose one cat...somewhere..in the name of automation)

                        - More than 140 kg = Both are in bed.

                        But ... I am not skilled enough with arduino for now

                        Comment


                        • #13
                          I reset the occupancy status anytime an exterior door is opened or closed (seems redundant, unless you have children who leave the door open). Thus, once the house is closed, occupancy status is unknown until something within the house detects an occupant. I'll post my rules shortly.


                          Edit...

                          Photos of my WIAB Logic for the house are below; originally I had this in just 4 rules but I recently re-worked all of it to be a bit more modular when I started playing with the IFTTT integration for WyzeCam, thought maybe I could use those as a mechanism for detecting occupants. It is a lot more flexible as I can add new rules for occupancy detection devices without impacting any of the existing logic, and if one detection rule is misbehaving I can just disable it.


                          This just does occupancy detection and updates the house occupancy status. House "Mode" is a separate virtual device with it's own rules which are built on top of this base WIAB logic (and other stuff).
                          Attached Files
                          Last edited by viroid; June 18th, 2019, 08:45 AM. Reason: Adding Photos of Rules

                          Comment


                          • #14
                            And now that I've seen WIAB 4.1 again, those AND IF statements are all wrong... It was supposed to prevent the house from being marked unoccupied when a bedroom is marked occupied and their door is closed, except I'm only checking to see if the door is closed, not if the bedroom is also occupied.

                            Comment


                            • #15
                              I still want to see someone write a plugin to handle all of this

                              Comment

                              Working...
                              X