Announcement

Collapse
No announcement yet.

Event logic does not work correctly

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

    Event logic does not work correctly

    Hello all,

    I am trying to be able to determine if all my locks are in a locked start. I have chosen to create 2 simple events for locked and unlock for each of 3 locks. They look like:

    IF Back door Z-Wave Lock changes and becomes Locked
    Then Reset counter back-door-locked to value 1

    IF Garage Door Z-Wave Door Lock changes and becomes Unlocked
    Then Reset counter back-door-locked to value 2


    These are tied to the changing of the lock status. Then I have a very simple test routine:

    IF back-door-locked value has become this absolute value: 2

    OR IF front-door-locked value has become this absolute value: 2

    OR IF garage-door-locked value has become this absolute value: 2
    Then Send an Email


    Looking at my counters, page I see:
    Name Value (Action)
    back-door-locked 1
    Increment and Decrement are by '1', and Reset is to '0', unless another value is entered here:
    front-door-locked 1
    Increment and Decrement are by '1', and Reset is to '0', unless another value is entered here:
    garage-door-locked 1
    Increment and Decrement are by '1', and Reset is to '0', unless another value is entered here:
    So, all of my counters are 1. 1 !=2 for all 3 locks. BUT I get an email *every* time and all the locks show locked.

    I have checked and tested the actions of locking and unlocking. The counter values are correct. They change/update correctly.

    What am I missing here? This seems like very simple logic. I do not have any exotic conditions or logic. I am testing this by calling the check lock event when one of the doors goes to the locked state.

    #2
    When do you want an email? When any are unlocked? When any are locked? When all are locked? When all are unlocked?

    Do you have the Easy Trigger plug-in?
    HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

    Comment


      #3
      Originally posted by Grover View Post
      So, all of my counters are 1. 1 !=2 for all 3 locks. BUT I get an email *every* time and all the locks show locked.

      This seems like very simple logic. I do not have any exotic conditions or logic. I am testing this by calling the check lock event when one of the doors goes to the locked state.
      To continue Randy's question, what does *every* time mean?

      Your events seem to be aimed at sending an email whenever one of the locks becomes unlocked, but your last statement says, "I am testing this by calling the check lock event when one of the doors goes to the locked state."

      Are you running the event when a door becomes locked as a test? Are you running the event as an action of another event? If so, does that event include the option to check conditions?

      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


        #4
        Good questions. My thought is that when I arm my alarm system via any of several mechanisms (Homeseer, the alarm keypad, alarm system cell app), it will fir send a lock directive to all the locks. Then it waits about 30 seconds and checks that the doors did in fact lock. If they are not locked, I want to receive an email that they failed to lock. I only want an email if they are not locked after sending the lock instruction. I have also put a 30 second delay after the lock directive before I check time to reduce the probability of timing issues.

        So in short:

        If ARM
        {
        lock-all-doors
        wait 30 seconds
        check the status of all locks
        if any are not in locked state
        {
        Send email
        }
        }

        Comment


          #5
          Here are a set of three Events I whipped up using standard HomeSeer Triggers and Conditions.

          The first Event is triggered by arming the system. You can trigger it however you want. This Event calls the second Event which will lock my two doors. You will note that in Event 1 I asked the Conditions in the called Event to be honored. This is not necessary because the Event has no Conditions. I believe it is a best practice to get in the habit of enabling this option, because it is very rare you wouldn't want the conditions to be honored. I also hit both locks a second time after 30 seconds. While my locks are very reliable, if they ever fail to respond to a command they will usually respond to a second one. This second Event is called immediately and the actions could easily be included in the first Event. The reason I separate them is because the Lock Doors Event can be used in a number of occasions. We hit the Event each night when we put the house to sleep and hit it when the last person leaves the house, even if we do not arm the alarm.

          The third Event is called from the first one with a 1 minute delay. This Event checks both doors and sends an email if either door is not locked. Since I am calling the Event with Conditions honored, the Event will run (be true) if either door is not locked, but it will not run if both are locked. You can stack as many locks as you want using additional (OR IF) Triggers. I also used replacement variables in the body of the email so I would know which door was not locked.

          Hopefully this helps. Feel free to ask questions.

          Click image for larger version

Name:	capture.png
Views:	86
Size:	54.6 KB
ID:	1258699
          Click image for larger version

Name:	Capture1.PNG
Views:	61
Size:	93.4 KB
ID:	1258700
          HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

          Comment


            #6
            Here are Events 2 and 3 using an Easy Trigger Group. The group is built of all locks

            Click image for larger version  Name:	Capture3.PNG Views:	1 Size:	27.6 KB ID:	1258706

            Then the Events use the Group as a Condition and an Action. With a lot of devices an Easy Trigger Group saves some steps in an Event. Since an Easy Trigger Action cannot be delayed, I put a 30 second "Wait" before hitting the locks a second time. You cannot use the Status Text, you must use Values.

            Click image for larger version  Name:	Capture4.PNG Views:	1 Size:	78.3 KB ID:	1258707
            HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

            Comment


              #7
              I did something very similar. The first event was to watch for my system becoming armed:

              Click image for larger version

Name:	number1.jpg
Views:	56
Size:	83.2 KB
ID:	1258779

              Then I have my locks:

              Click image for larger version

Name:	number2.jpg
Views:	62
Size:	141.4 KB
ID:	1258780
              And finally my check routine:

              Click image for larger version

Name:	number3.jpg
Views:	59
Size:	179.6 KB
ID:	1258781
              My routines to track the locked and unlocked status are:

              Click image for larger version

Name:	number4.jpg
Views:	50
Size:	201.8 KB
ID:	1258782

              I did this to prevent the act of locking and unlocking from triggering things. I added the calling of check locks to the end to test it. The results are that anytime I call check locks, I get an email. It is more complex as I thought I was trying to work around some issues here.

              I had originally just tested the value of the lock to be lock/unlock directly but decided maybe that was part of the problem so I went to having the lock/unlock set the value of a counter. As I said, I think this is overly complex but I was trying one other way to tackle the issue of or'ing 3 conditions together.

              That said, I still have no idea why this does not work. The email is alway sent telling me that I have door unlocked, but the email also always shows all the doors as locked.

              Thank you all for your help and patience with me.


              Comment


                #8
                You didn't show the name of this Event:



                I suspect it is "Security System Check Locks" and that you are calling it from "Security System Lock All Doors". If that is the case it will run any time "Lock All Doors" runs, no matter whether the doors are locked or not. You have "Run Only if Other Event Conditions are TRUE", but the event only has Triggers, no Conditions. An Event that is called from another Event ALWAYS ignores Triggers as I wrote in this Event Clinic post. It will also generate an email any time any of the doors are unlocked, whether or not the system is armed.

                I would urge you to reexamine the set of Events I posted in #5 above. It is a very simple set of Events, requires no counters and will only send an email when you are arming the system and doors remain unlocked. Since none of the Events are triggered by lock actions, they will only be checked and/or run at the time you arm the system. The counters are not a problem, but they over complicate the events and serve no purpose. If you want an email sent any time any of the three locks is unlocked you could change the Triggers in Event #3, but you stated you only wanted them sent when armed.
                HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                Comment

                Working...
                X