Announcement

Collapse
No announcement yet.

Door sensor send email when open 5 minutes

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

  • Door sensor send email when open 5 minutes

    I have a door sensor (z-wave) that I have on my front door and want to get a text message from my HS3 system (via email) if the door has been open for a set amount of time (5 minutes for example).

    I tried to control a timer but it got in a loop and sent text messages every second until I rebooted the system.

    I already have the following setup to only notify me when the door is opened and then pause for a specific amount of time before sending another notice.



    Any suggestions would be appreciated.

    Thanks,
    Micah
    Attached Files
    Last edited by mrd10607@yahoo.com; May 1st, 2019, 08:09 PM. Reason: Door sensor alarm

  • #2
    You could use:

    IF door has been open for exactly 5 minutes
    THEN send email

    For multiple emails you would need an event for each time period. This way you can vary the time period.


    Or to send multiple emails at a regular interval, you could use:

    event 1
    IF door opens
    THEN start timer

    event 2
    IF door closes
    THEN stop timer

    event 3
    IF timer becomes 5 minutes
    THEN send email
    THEN restart timer

    I have a similar situation where I use a combination of these concepts such that I get notifications at increasing intervals up to a point and then at regular intervals thereafter.
    -Wade

    Comment


    • #3
      Here's how I do that. In my case I want to sound a notification if my heater is ON and any of doors / windows are open for more than 10 seconds.

      And instead of email I use Pushover plugin to send instant push.
      And I'm using AKGoogleCalendar plugin to show this in my Google Calendar

      If you need any explanation, feel free to ask

      Click image for larger version  Name:	Capture.PNG Views:	1 Size:	74.0 KB ID:	1302443
      Click image for larger version  Name:	Capture1.PNG Views:	1 Size:	38.1 KB ID:	1302444

      Comment


      • #4
        Originally posted by cc4005 View Post
        event 1
        IF door opens
        THEN start timer

        event 2
        IF door closes
        THEN stop timer

        event 3
        IF timer becomes 5 minutes
        THEN send email
        THEN restart timer
        It doesn't have to be that complex, you don't need any timers, just use available trigger options! KISS!

        Comment


        • #5
          And BTW you didn't need to reboot, you could just disable the event:

          Click image for larger version  Name:	Capture2.PNG Views:	1 Size:	14.3 KB ID:	1302449

          Comment


          • #6
            I use the same exact kind of event that alexbk66 shows.

            If door sensor open for at least 15 minutes, speak to a couple of google devices and send a pushover message. don't rerun for 5 minutes.


            HS3 SEL running Pro Edition 3.0.0.531 on Ubuntu 18.04, mono 5.20, 656 devices, 209 events.
            Plug-Ins: Chromecast, Device History, EasyTrigger, Ecobee, JowiHue, LutronCaseta, MeiUnifi, PHLocation2, Pushover 3P, SDJ-Health, Sonos, WeatherFlow, weatherXML
            Scripts: SparkMan's Lock Event, 5 of Jon00 scripts.

            Comment


            • #7
              Originally posted by alexbk66 View Post

              It doesn't have to be that complex, you don't need any timers, just use available trigger options! KISS!
              I try to avoid events that put continuous processing load on the server. Your method is definitely simpler but would evaluate continuously (every second?) until the door is closed. My approach is a holdover from my days with Vera and its anemic hardware and may be a non-issue with HS3, but it can't hurt either IMO.
              -Wade

              Comment


              • #8
                Originally posted by cc4005 View Post
                I try to avoid events that put continuous processing load on the server. Your method is definitely simpler but would evaluate continuously (every second?) until the door is closed.
                No, I set "Can't re-run for 10 seconds" - so HS will set the timer internally for 10 seconds.

                Comment


                • #9
                  Originally posted by cc4005 View Post
                  I try to avoid events that put continuous processing load on the server. Your method is definitely simpler but would evaluate continuously (every second?) until the door is closed.
                  I have seen no evidence that an event that does not run generates measurable overhead. The event engine appears to be very efficient in the way it handles conditions.

                  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


                  • #10
                    Originally posted by alexbk66 View Post
                    No, I set "Can't re-run for 10 seconds" - so HS will set the timer internally for 10 seconds.
                    Hmmm. Would seem the trigger is still evaluated every second but the event doesn't fire due to the 10 second limit--which is effectively just another condition. But based on Mike's comment above, it's likely an academic discussion.

                    edit: On further thought the running timer may add as much processing load as evaluating the trigger for all I know.
                    -Wade

                    Comment


                    • #11
                      Originally posted by cc4005 View Post
                      On further thought the running timer may add as much processing load as evaluating the trigger for all I know.
                      Evaluating a trigger even every second (as part of existing event system) is nothing, it takes a couple of cpu commands, just a few nanoseconds. On the other hand, creating another timer uses an extra thread which creates extra overhead.

                      Comment


                      • #12
                        that's the logic i use. it has it's pro/cons

                        Attached Files

                        Comment


                        • #13
                          MattL0 Using AKSmartDevice plugin you can simply set the lights countdown timer to 5 minutes, add motion sensors as triggers - then every motion detected will restart the countdown timer. And if there's no motion - after 5 minutes lights will switch off.

                          https://youtu.be/mmyrx8kXnWY?t=149

                          Comment


                          • #14
                            Thanks . But i can do this with events.


                            And I use some more complicated ( conditional) events for other things.

                            ex: if MPc-be is set to play.
                            Then, it will trigger other event action if conditions are true ( three time) : So, another event will close the lights in kitchen if nobody is in there since x time. another event for the bathroom, another for the hallway etc.



                            I don't feel the need to buy a plugin for this when the event engine can do it. And more important, it is really easy to manager all the logic in one place VS, 70% of the logic on the event engine , 20 % on a plugin , 10 % on another plugin.
                            Attached Files

                            Comment


                            • #15
                              Originally posted by MattL0 View Post
                              I don't feel the need to buy a plugin for this when the event engine can do it.
                              I don't like HS event system, that's why I created AKSmartDevice plugin. What I don't like using HS events - if you replace one device - you need to go through your events and find where your device is used and replace it. And if something isn't working - you need to troubleshoot all these events...

                              In SmartDevice plugin all device settings (i.e. triggers, actions, countdown timers) are on the device config page for the device itself. And there's a log as well for this particular device only.

                              In programming history HS events are similar to old days "Structured programming paradigm" - when external code controls your object state with lots ifs/else/then. And your object doesn't know what's happening to it and why.

                              AKSmartDevice approach is similar to contemporary "Object Oriented paradigm" - when object behavior is encapsulated inside the object itself, so the object knows how to behave in different situations, and it can track its state changes.

                              Originally posted by MattL0 View Post
                              it is really easy to manager all the logic in one place VS, 70% of the logic on the event engine , 20 % on a plugin , 10 % on another plugin.
                              I'm trying to move as much as possible functionality inside the plugin, to minimize use of HS events.

                              Comment

                              Working...
                              X