Announcement

Collapse
No announcement yet.

Creating an event using multiple door sensors

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

    Creating an event using multiple door sensors

    I have a heater in my garage. I have 3 doors with sensors (A, B, C). I have a connected thermostat.

    I have the following event:

    Event 1
    If Door Sensor A changes and becomes open
    Set 'heater state virtual device' to current thermostat mode
    Set thermostat mode to 'Off'

    Event 2
    If Door Sensor A changes and becomes closed
    Set thermostat mode to 'heater state virtual device'

    This works as it stores the current state of the thermostat, turns it off while the door is open, than sets it back to whatever state it was before.

    NOW, the fun part. I have 2 other doors. I'd like it to turn off the heat when ANY door is open, but if door B opens, and I set the state when door B opens, it will set the state to off (as the thermostat mode is off due to door A being open).

    How would I go about turning off the heat but remembering what the state was when the first door opens, and back when the last one closes, in any order?

    #2
    These Events should do what you want.

    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	92.7 KB
ID:	1195869

    The heat will be turned off if any of the three doors are opened. The heat will be turned on when all three are closed. This could also be done with Easy Trigger groups.

    Click image for larger version

Name:	Capture1.PNG
Views:	1
Size:	44.5 KB
ID:	1195870
    HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

    Comment


      #3
      AH, Randy beat me to it!

      Maybe you could try putting in OR IF for event 1 for the other doors and AND IF in event 2 for the other doors.

      Event 1 then would look for any door open and remember the thermostat setting

      Event 2 then would require all 3 doors to be closed before it returns the thermostat to those settings

      Comment


        #4
        Randy, I don't think your example solves my issue.

        I need to remember what state the heater was in before the first door is open, and set it to that state when the last door closes.

        In your example it will turn off when any door is opened and than turn to heat when all 3 doors are closed. BUT if it was in the off position previously than it is setting the heater to heat even though it was off previously.

        Problem with the state is if door a opens and it's set to heat, the trigger turns it off. Than wgeb door b opens it sets the virtual device to the current state, which is now off. so when door b and a close, the virtual state is now off and will set to off, instead of heat as it was originally.

        Comment


          #5
          what I might need to do is keep a state if ANY door is open. And if a second door opens and the ANY door state is open, than not change the heater mode state

          but than closing is tricky....

          Comment


            #6
            I was thinking of something like this.

            Event 1
            If current thermostat mode changes to any value
            Then set 'heater state virtual device' to current thermostat mode

            Event 2
            If door A changes and becomes open
            Or If door B changes and becomes open
            Or If door C changes and becomes open
            Then set thermostat to Off

            Event 3
            If door A changes and becomes closed
            And If door B changes and becomes closed
            And If door C changes and becomes closed
            Then set thermostat mode to 'heater state virtual device'

            Something like that. Maybe needs a little tweaking.

            Comment


              #7
              Originally posted by DancingPaul View Post
              Randy, I don't think your example solves my issue.

              I need to remember what state the heater was in before the first door is open, and set it to that state when the last door closes.

              In your example it will turn off when any door is opened and than turn to heat when all 3 doors are closed. BUT if it was in the off position previously than it is setting the heater to heat even though it was off previously.

              Problem with the state is if door a opens and it's set to heat, the trigger turns it off. Than wgeb door b opens it sets the virtual device to the current state, which is now off. so when door b and a close, the virtual state is now off and will set to off, instead of heat as it was originally.
              If you have Easy Trigger you can write the value of your heating to a virtual device when a door opens and from the virtual device back to the heating when all doors are closed.

              Beyond that you will need logic to only set the virtual heating device when the first door opens. The easiest way would be to add conditions to the Off event triggers to check that the other two doors are closed when one opens.
              Last edited by randy; March 15, 2018, 02:50 PM. Reason: Edited for accuracy
              HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

              Comment


                #8
                Cowinger, I thought of that too but when event 2 changes it to OFF, than event 1 will trigger setting it to off.

                Originally posted by cowinger View Post
                I was thinking of something like this.

                Event 1
                If current thermostat mode changes to any value
                Then set 'heater state virtual device' to current thermostat mode

                Event 2
                If door A changes and becomes open
                Or If door B changes and becomes open
                Or If door C changes and becomes open
                Then set thermostat to Off

                Event 3
                If door A changes and becomes closed
                And If door B changes and becomes closed
                And If door C changes and becomes closed
                Then set thermostat mode to 'heater state virtual device'

                Something like that. Maybe needs a little tweaking.

                Comment


                  #9
                  I *Think* I got it:

                  created a state for ANY door being open
                  if a door opens it checks if ANY is set to open, if not it sets the vrtual heater state

                  if ANY door is closed (meaning all are closed) than it proceeds to set the virtual heater as it's the first door opening.

                  Closing: every door checks for every other door to be closed. If the other 2 are closed, it's the last one and proceeds to set back the therm to the virtual state
                  Attached Files

                  Comment


                    #10
                    Originally posted by DancingPaul View Post
                    Cowinger, I thought of that too but when event 2 changes it to OFF, than event 1 will trigger setting it to off.
                    That is true. The modifications to the events I posted above should work.
                    HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

                    Comment


                      #11
                      Originally posted by DancingPaul View Post
                      I *Think* I got it:

                      created a state for ANY door being open
                      if a door opens it checks if ANY is set to open, if not it sets the vrtual heater state

                      if ANY door is closed (meaning all are closed) than it proceeds to set the virtual heater as it's the first door opening.

                      Closing: every door checks for every other door to be closed. If the other 2 are closed, it's the last one and proceeds to set back the therm to the virtual state
                      That should work.
                      HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

                      Comment


                        #12
                        I would really think there would be a better/easier more efficient way to do this. Hopefully someone will come up with one. I dread the day if I have 10 or more sensors doing something across the whole house and had to write something in this manner.


                        I know easy trigger has groups but I have yet to play with them.


                        There's still one edge case and that's if someone turns the heat off while one of the doors are open - but i think that can be solved by checking if the heat mode changes AND door any virtual device = open, than set the heater virtual device to the new mode.

                        Comment


                          #13
                          Another take:
                          Event 1
                          If a recurring trigger happens (once a minute)
                          And If Door A has been closed for at least (60 seconds)
                          And If Door B has been closed for at least (60 seconds)
                          And If Door C has been closed for at least (60 seconds)
                          Then store heater state in a virtual device

                          Event 2
                          If Door A changes and becomes open
                          Or If Door B changes and becomes open
                          Or If Door C changes and becomes open
                          Turn heater off

                          Event 3
                          If Door A changes and becomes closed
                          And If Door B is closed
                          And If Door C is closed

                          Of If Door B changes and becomes closed
                          And If Door A is closed
                          And If Door C is closed

                          Of If Door C changes and becomes closed
                          And If Door A is closed
                          And If Door B is closed

                          Then restore heater to the state stored in the virtual device
                          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


                            #14
                            Originally posted by DancingPaul View Post
                            I would really think there would be a better/easier more efficient way to do this. Hopefully someone will come up with one. I dread the day if I have 10 or more sensors doing something across the whole house and had to write something in this manner.
                            I know easy trigger has groups but I have yet to play with them.
                            Are you saying that you want something that is easier than EasyTrigger groups?

                            For large numbers of items, I find that a script that loops through the devices is an efficient way to handle them, and adding one more becomes pretty easy.
                            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


                              #15
                              I haven't tried easytrigger groups yet. I'll give them a shot.


                              Originally posted by Uncle Michael View Post
                              Are you saying that you want something that is easier than EasyTrigger groups?

                              For large numbers of items, I find that a script that loops through the devices is an efficient way to handle them, and adding one more becomes pretty easy.

                              Comment

                              Working...
                              X