Announcement

Collapse
No announcement yet.

House to sleep event sequence

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

    House to sleep event sequence

    Because I mentioned this in another thread was asked to post how we do our House to Sleep sequence. Here it is. There are many ways to do it, but here is how we do it.

    For our "House to Sleep" sequence I use a lot of Events. It is initiated by a Virtual Device "House to Sleep Initiator". This device is controlled by a Central Scene from our Master Bedroom dimmer or any of three Remotec remote controls throughout the house.

    The first Event is the Initiator, triggered by the Virtual device. It will trigger immediately and will be checked again after 1 minute and 2 minutes.

    Click image for larger version

Name:	01).PNG
Views:	406
Size:	91.3 KB
ID:	1269552

    I will explain the additional triggers later. This Event first cancels a delayed event to reset the status LEDs on the bedroom dimmer, if one is queued, then sets the Master Bedroom dimmer status LEDs to all blue and not blinking. This shows me the sequence has started. It also runs an Event that runs a script checking all doors and windows, populating Virtual Devices with their status. After a wait of two seconds it calls the next 3 Events checking doors and windows if they are open.

    If a door is open, the LEDs on the dimmer are set to all red and blinking, an announcement is made, house to sleep is cancelled and a delayed event is launched to clear the status LEDs after 5 minutes. I will need to get up and close a door.

    Click image for larger version  Name:	02a).PNG Views:	1 Size:	54.9 KB ID:	1258765

    If the doors are closed, but a window is open, an announcement is made and the bottom LED is set to red and blinking. The Sequence will continue on to check the door locks. We also have a window check bypass device if we want to sleep with windows open. If window bypass is on the sequence continues.

    Click image for larger version

Name:	02b).PNG
Views:	377
Size:	106.5 KB
ID:	1269553

    The announcement Event cannot run more than once per sequence.

    Click image for larger version  Name:	02c).PNG Views:	1 Size:	41.7 KB ID:	1258767

    If doors and windows are closed, or if window check is bypassed, it proceeds to check the locks

    Click image for larger version  Name:	02d).PNG Views:	1 Size:	76.6 KB ID:	1258841

    If the doors are locked the lock check Events will not run. If either door is unlocked, it will set one of the LEDs on the bedroom dimmer to red and blinking. The second LED is the main door and the third one is the workshop door. It also announces if either door is unlocked. The announcement is in "David's" voice at an increased level "<voice required="name = Microsoft David Desktop"> Front Door Unlocked <silence msec='250'/> please wait while I attempt to lock it". Our normal announcement is at a lower level and uses the default (Zira) voice.

    Click image for larger version  Name:	03).PNG Views:	1 Size:	106.9 KB ID:	1258769

    Each Event runs another that attempts to lock the doors. The lock check Events will only run if the respective door is closed.

    Click image for larger version  Name:	lockchecks.PNG Views:	1 Size:	89.6 KB ID:	1258797

    If the lock checking events are successful, it will trigger Event 03c), making an announcement that the doors have been locked, using Zira's voice.

    Click image for larger version  Name:	03c).PNG Views:	1 Size:	65.6 KB ID:	1258770

    If the doors are locked it goes to the finisher event which will only run if the windows are all closed. If a window remains open it will not run, unless window bypass is enabled or if the initiator device has been on for 3 minutes.

    Click image for larger version  Name:	04a).PNG Views:	1 Size:	38.8 KB ID:	1258855

    There is another Event that will run if the initiator device has been on for 3 minutes. If all of the doors are closed and locked, but windows remain open, it will go on to the finisher Event, which has a condition that the virtual device has been on for at least 3 minutes.

    Click image for larger version  Name:	04b).PNG Views:	1 Size:	60.9 KB ID:	1258856

    The finisher event will turn all of the dimmer LEDs green, to show the process will continue to finish. After 15 seconds, either event will turn the status mode LEDs off.

    Click image for larger version  Name:	05).PNG Views:	1 Size:	100.9 KB ID:	1258857

    Hopefully this all makes sense. I also have some timing in the lighting to sleep Event that first dims the bedroom lights, then turns them off after 3 minutes. This is another queue that the house is going to sleep.
    Last edited by randy; November 11, 2018, 09:28 PM. Reason: text correction
    HS4 Pro, Windows 10 pro

    #2
    Whoa, that is some sleep mode you got there... Thanks for sharing!
    RJ_Make On YouTube

    Comment


      #3
      Originally posted by ServiceXp View Post
      Whoa, that is some sleep mode you got there... Thanks for sharing!
      At least it is automation and not just control

      I am adding to this reply to keep it near the starting post. I was asked by email how my "House Doors" and "House Windows" devices work, since they are integral to the sequence. I am mostly copying this content from a post I made in July.

      I use a script to populate the device with an array of all of the doors or windows which are open. I use a script that Wayne (waynehead99) provided and modified it for my use. I use several virtual devices and multiple subroutines in this script to update different groups. In this simplified script I have pared the script down to all windows and all doors. There is a virtual device for each. Lines in a script that begin with a single quote are only comments, they have nothing to do with the function of the script.



      When the script runs, it goes through one of two fixed arrays of reference numbers for the doors or windows I wish to check. It will populate each virtual device with the names of each window or door that is open. As you can see above, the front door is open and all windows are closed. This is a simplified version of the script:

      Code:
      'these are the virtual devices to be updated by the script
      '5281 Windows
      '8829   Doors
      
      'Use the reference ID of the door or window sensor devices in the arrays below
      
      dim array_windows() as string = {"4557", "4548", "4550", "4543", "4556", "4549", "4564", "4553", "4555", "4554", "4551", "4545", "4544","4559", "4560", "4561", "4562", "4563"}
      
      dim array_doors() as string = {"4565", "4542", "4558", "4566", "4532", "4531", "4552", "4523", "4522", "4528", "4527"}
      
      dim windows_count as integer = 0
      dim window_name as string = ""
      dim wstr as string = ""
      
      dim doors_count as integer = 0
      dim door_name as String = ""
      dim dstr as string = ""
      
      Dim dv as Object
      
      'Using 2 subs, one for doors and the other for windows
      
      'WINDOWS
      sub windows(ByVal Parms as Object)
      Try
      windows_count = 0
      window_name = ""
      wstr = ""
      for each devw as string in array_windows
              'hs.writelog("Array", "Window " & window_name & " | Value " & hs.DeviceValue(devw))
      if hs.DeviceValue(devw) = 1 then
                      windows_count = windows_count + 1
      dv = hs.GetDeviceByRef(devw)
      window_name =  dv.Name(hs)
             wstr = wstr & window_name & ",<br>"
      hs.writelog("DoorWindow", window_name & " Open")
      'hs.writelog("DoorWindow", array_windows)
              end if
      next
      If windows_count > 0 then
      hs.SetDeviceValueByRef(5281,100,true)
      hs.SetDeviceString(5281, wstr,true)
      Else
      hs.SetDeviceValueByRef(5281,0,true)
      hs.SetDeviceString(5281, "All Windows Closed",true)
      End If
      
      hs.writelog("DoorWindow", "Window Count: " & windows_count)
      
      Catch ex As Exception
      hs.WriteLog ("DoorWindow", "Error: " & ex.Message)
      End Try
      
      End Sub
      
      'DOORS
      sub doors(ByVal Parms as Object)
      Try
      doors_count = 0
      door_name = ""
      dstr = ""
      for each devd as string in array_doors
              'hs.writelog("Array", "Door " & door_name & " | Value " & hs.DeviceValue(devd))
      if hs.DeviceValue(devd) = 1 then
      dv = hs.GetDeviceByRef(devd)
      door_name =  dv.Name(hs)
      doors_count = doors_count + 1
      dstr = dstr & door_name & ",<br>"
      hs.writelog("DoorWindow", door_name & " Open")
              end if
      next
      If doors_count > 0 then
      hs.SetDeviceValueByRef(8829,100,true)
      hs.SetDeviceString(8829, dstr,true)
      Else
      hs.SetDeviceValueByRef(8829,0,true)
      hs.SetDeviceString(8829, "All Doors Closed",true)
      End If
      
      hs.writelog("DoorWindow", "Door Count: " & doors_count)
      
      Catch ex As Exception
      hs.WriteLog ("DoorWindow", "Error: " & ex.Message)
      End Try
      
      End Sub
      I think the script is commented well enough.

      Just create your virtual devices for storing windows and doors. Then use the Reference ID of the virtual devices in the script. Build your arrays using the Reference IDs of the doors and windows you want to check. The script will set the virtual device to Off (0) when all devices are closed and at On (100) if any device is open. The name of each open door or window is written to the string of each device. You can then use the device strings in a TTS announcement, email or other method of communicating, and use the values as Triggers or Conditions in Events.

      I run the script on a schedule to make sure it is synchronized, should HomeSeer be down at any moment when a door or window changes state. I also manually trigger this at the beginning of the house to sleep sequence.



      The script is also run any time a door or window is opened with these events. They are triggered by Easy Trigger group triggers. We can optionally have the system announce when any door or window is opened.



      I also have broken the virtual devices into subgroups of doors and windows, so that I can separate the house from two outbuildings and a back porch. That way, I can choose what doors or windows to look at in any Event. We usually only check the house windows and doors at sleep, because we will leave one or two porch windows open at night in the summer. The porch is separated from the house with a sliding door with its own sensor and lock. The outbuilding doors and windows are checked earlier in the evening and announced early enough that we can take care of them before going to bed.

      Last edited by randy; November 12, 2018, 10:30 AM.
      HS4 Pro, Windows 10 pro

      Comment


        #4
        Fooled me for a sec with Actions showing "If the event conditions are true" ... for checkbox Run Only if Other Event Conditions are True
        ... another HS3 congruity bug where it should really state "Run Only if CALLING Event's Conditions are True" . I think HST's an ESL company

        Comment


          #5
          Thanks ! What dimmer are you using that has status lights ?

          Comment


            #6
            Originally posted by kriz83 View Post
            Thanks ! What dimmer are you using that has status lights ?
            A HomeSeer HS-WD200+.

            HS4 Pro, Windows 10 pro

            Comment


              #7
              Originally posted by Ltek View Post
              Fooled me for a sec with Actions showing "If the event conditions are true" ... for checkbox Run Only if Other Event Conditions are True
              ... another HS3 congruity bug where it should really state "Run Only if CALLING Event's Conditions are True" . I think HST's an ESL company
              Dood! You really need to resist your seemingly insatiable need to post snarky comments directed at HST and its personnel in the majority of your posts. It is old and tiresome. In this case you are dead wrong. The checkbox applies to the event being CALLED, not the CALLING Event. This option applies to an ACTION, which only runs if the CALLING Event has already satisfied its Trigger and Conditions. Your logic and your memory are failing you. The option reads “Run Only If Other Event Conditions are TRUE” before collapsing the Action. This very clearly applies to the Event that the Action is calling. Granted, the wording changes when collapsed to “If the Event Conditions are True, Run Event...”, leaving out the specific word “Other”. Nevertheless it still implicitly applies to the CALLED Event. The option couldn’t possibly apply to the CALLING Event, because it must already be running to even encounter the Action the to which option applies. It doesn’t state “If this Event Conditions are True, Run Event..”.
              HS4 Pro, Windows 10 pro

              Comment


                #8
                Originally posted by rprade View Post
                A HomeSeer HS-WD200+.
                Thanks. Light switches have a different size here in europe, so this one wouldn't fit :-(

                Comment


                  #9
                  Randy,

                  Just out of curiosity, is there some reason you do not put your window/sensors in an Easytrigger group and just check the group for all values equal to the secure value? Of course all of the sensors must have the same value when secure. I use the HS-DS100+,

                  Click image for larger version  Name:	Sensor Check.png Views:	1 Size:	36.9 KB ID:	1258993

                  Comment


                    #10
                    Originally posted by Bob_Linux_User View Post
                    Randy,

                    Just out of curiosity, is there some reason you do not put your window/sensors in an Easytrigger group and just check the group for all values equal to the secure value? Of course all of the sensors must have the same value when secure. I use the HS-DS100+,

                    Click image for larger version Name:	Sensor Check.png Views:	1 Size:	36.9 KB ID:	1258993
                    If you note in post #3 above, I do use an Easy Trigger group for catching if any window or door changes state so the script will run.



                    We have a Virtual Device that we can enable to have the system announce when any door or window changes, if we desire. If the Virtual Device is enabled, the above announcement Event will run any time a door or window is opened or closed. .

                    The reason I use a script and a Virtual Device is that the Virtual Device and by extension any TTS or message contains the names of any and all windows or doors that are open. So my announcement at night will be "The dining room window is open" or "The front door is open". If there are multiple doors and or windows open, they will all be called out by name. It makes it easier to go to the correct one and close it. If all doors or windows are closed the string is set to "All Doors Closed" or "All Windows Closed". I also use another "greeting" device that has a string populated with one of three strings depending on the time of day.

                    Click image for larger version  Name:	Capture1.PNG Views:	1 Size:	7.1 KB ID:	1259007

                    I use a script for generating all of my Sonos announcements, to automatically build a linkgroup and set the levels on all devices. That way I can control every destination's level, and not send TTS to devices which might be offline or that I desire muted. It also elevates the level for devices and selects a different voice for alerts versus announcements. This way I have one Sonos linkgroup $SONOS$ANNOUNCE$:* that is built on the fly for each announcement. The actual text to be spoken is stored in an .ini file by tag. The script builds the linkgroup and writes it to the sonos.ini file using hs.PluginFunction("Sonos", "", "SetLinkgroupZoneDestination", {"ANNOUNCE", LinkString})
                    , waits two seconds then launches the tagged text to the ANNOUNCE Linkgroup. The text strings generated by the script for the below situation are:

                    $$DTR:8850: <silence msec='250'/> the $$DTR:8830:
                    $$DTR:8850: <silence msec='250'/> the $$DTR:5279:

                    Click image for larger version  Name:	capture.png Views:	1 Size:	20.4 KB ID:	1259008
                    Resulting in announcements:
                    "Good Morning, the Kitchen Window, Randy Office Window, open"
                    and
                    "Good Morning, the Back Porch Sliding Door, Front Door, open"

                    That way we get a more natural sounding and informational announcement.

                    Lest you think I am at all good at scripting, this was accomplished with significant help from my older brother Gary, who has the chops to build a script.

                    If anyone is interested I can put together a post with the script and instructions on it and the ini file construction. For obvious reasons, this only applies to Sonos.
                    Last edited by randy; November 12, 2018, 12:47 PM.
                    HS4 Pro, Windows 10 pro

                    Comment


                      #11
                      Very nice. I did miss the EasyTrigger group to trigger the event. If I get a window or door open alert I just look at an HSTouch screen on one of my PIPOs. The SONOS announcements are much more efficient and would have a better WAF. Thanks for the explanation.

                      Click image for larger version

Name:	Alarm Panel.png
Views:	362
Size:	117.1 KB
ID:	1259017

                      Comment


                        #12
                        If I ever took the time to learn the faults and foibles of HSTouch designer, I would like to have the same sort of display. My wife resists technology, but actually likes to be told if the house is secure when I am away. I try to minimize announcements and avoid having her need to interact with any display. To her getting an announcement "The Dryer is finished" is priceless, because it is announced throughout the house and the dryer is in the basement. It saves her steps and makes her happy. I'm sure you know the adage "Happy Wife...".

                        Saturday, one of us neglected to fully close the kitchen freezer drawer and we were outside picking up leaves and such in the yard. During the day, when the temperature is above 45 degrees and at least one of us is home, Sonos announcements are also made to the deck Sonos and front porch Sonos. While we were in the back yard, the speakers in "Dave's" louder voice announced "Warning the refrigerator freezer compartment is 18.1" alerting us to check the freezer. The announcement is made and a Pushover message to all clients is sent once every five minutes until it is nominal.
                        HS4 Pro, Windows 10 pro

                        Comment


                          #13
                          In my opinion, that is the beauty of HS. You are only limited by your imagination. If something cannot be accomplished with an event, a .vb script will normally meet the need and there are Forum users that will help you write the script if necessary. I also like the SONOS integration. I have SONOS everywhere and make full use of the capability. Thanks for all of your contribution to the Forum.

                          As far as HSTouch goes, I use PowerPoint to create all of my static screens including the buttons. I just place a transparent HSTouch button over my static button to perform the actions. I then use the "Status Tracking" feature to display the current state of a device. There are just a few functions in the designer that need to be learned to create really good screens. Not difficult at all. The Alarm Panel is really a PowerPoint display (exported as a .bmp) with a Status Tracking box for each switch.

                          Bob

                          Comment


                            #14
                            Originally posted by rprade View Post
                            If I ever took the time to learn the faults and foibles of HSTouch designer, I would like to have the same sort of display. My wife resists technology, but actually likes to be told if the house is secure when I am away. I try to minimize announcements and avoid having her need to interact with any display. To her getting an announcement "The Dryer is finished" is priceless, because it is announced throughout the house and the dryer is in the basement. It saves her steps and makes her happy. I'm sure you know the adage "Happy Wife...".

                            Saturday, one of us neglected to fully close the kitchen freezer drawer and we were outside picking up leaves and such in the yard. During the day, when the temperature is above 45 degrees and at least one of us is home, Sonos announcements are also made to the deck Sonos and front porch Sonos. While we were in the back yard, the speakers in "Dave's" louder voice announced "Warning the refrigerator freezer compartment is 18.1" alerting us to check the freezer. The announcement is made and a Pushover message to all clients is sent once every five minutes until it is nominal.
                            Do you have a temp sensor in the freezer? If so, where did you find it? Could have used one of those when our freezer died and we didn’t know it.


                            Sent from my iPad using Tapatalk
                            HS4 4.2.6.0 &HSTouch Designer 3.0.80
                            Plugin's:
                            BLBackup, BLOccupied, BLShutdown, EasyTrigger, Ecobee, Nest, AK Bond
                            EnvisaLink DSC, PHLocation, Pushover, SONOS, Blue Iris, UltraRachio3,
                            weatherXML, Jon00 Alexa Helper, Network Monitor, MyQ, Z-Wave

                            Comment


                              #15
                              Originally posted by The Profit View Post

                              Do you have a temp sensor in the freezer? If so, where did you find it? Could have used one of those when our freezer died and we didn’t know it.


                              Sent from my iPad using Tapatalk
                              All of my temperature sensors are OneWire DS18B20 encapsulated probes, connected to EDS OWServers. These probes are in a watertight stainless steel sleeves slightly less than 1/4" in diameter. I inserted one into the refrigerator and freezer compartment in our kitchen refrigerator and both chest freezers. I carefully picked places to from the inside to the back. Then I sealed the inside and outside of the entry holes with silicone after inserting the probes.

                              Click image for larger version

Name:	DS18B20.jpg
Views:	420
Size:	83.5 KB
ID:	1259171

                              The OWServers update about once a minute through the Ultra1Wire3 plug-in. We also monitor heating pipes, air conditioners, hot water, attic, etc. with the same sensors. A total of 53 sensors.

                              Click image for larger version

Name:	Capture.PNG
Views:	347
Size:	234.6 KB
ID:	1259172 ,
                              HS4 Pro, Windows 10 pro

                              Comment

                              Working...
                              X