Button to Bypass Door Alarm


#1

1) Give a description of the problem
I have a door sensor that activates an alarm every time the door is open. I need to be able to deactivate it when I go through the door, but I don’t know how.

2) What is the expected behaviour?
I’d like to use a Smartthings button that I have to press the button before opening the door, which will delay the alarm 10 seconds. If the door is still open 10 seconds later, the alarm will start. If the door is closed in that time, no alarm will sound.
3) What is happening/not happening?
Currently, I have a very simple alarm. When door sensor is open, alarm plays. When door sensor is closed, alarm stops. I don’t know how to add the button into the mix to be used as a bypass.


#2

I might attack this from the other side… Maybe something like this:

IF button is pressed
Then 
    WAIT 10 seconds
    IF Door is open
    Then
        Trigger alarm
    END IF 
END IF

This solves everything except criminals opening your door without pushing the button.
That element can be added using variables or other methods… IE

IF button is pressed
Then with Location (TCP set to Never)
    Set variable {delay} = true
    WAIT 10 seconds
    Set variable {delay} = false
    IF Door is open
    Then
        Trigger alarm
    END IF 
END IF

IF Door's contact changes to open
   and
   variable {delay} is false
      Then trigger alarm
END IF

#3

Thank you for the help. I followed the first piston very easily, but I’m running into trouble with the 2nd. I don’t have much experience with variables. How do I set those? When I tried “With Location, Do Variable”, it said “Nothing Selected” nor did I have the option to set anything. So I’m a little lost with the variables.


#4

I was thinking something like this:

I added a bunch of optional log commands so it should make troubleshooting much easier.

Note: With that hard coded 10 seconds in there, I would wait at least 15 seconds between each test.
(we want the previous event to complete fully before doing another test)


#5

Thank you very much. I imported your piston and used my devices. However, I can’t get my doorbell device to ring when the door is open. I notice it is logging correctly, but no sound is happening. Here is what I have:


#6

Everyone’s house is different, so I did not add any sounds to the piston structure above.

If the logs did as you’d expect, then just insert whatever kind of notification you want inside the appropriate block.

For example, you are currently sending a Turn on command to Music Player 1…
(IE: I would not expect a Turn on command to actually make any sound)


Note: I believe you also need to switch your last IF block back to the way I had it…

IF Contact Sensor CHANGES TO open

(You want a lightning bolt next to it)


#7

It’s a doorbell, so I thought Turn On would work. I changed it to Siren and now it works. Thank you!

So when I open the door, the doorbell turns on. Thats what I want. When I press the button, then open the door: no doorbell. Also what I want. But after the 10 seconds are up, if the door is still open I’d like the doorbell to begin chiming. How do I go about doing that?


#8

You can add the same Siren command to the appropriate block…

In my sample piston, that is the THEN block at line 32-33.


If that does not solve it, and we need to troubleshoot this more, please turn on Trace and set log level to Full. (more info here)


#9

This worked!! Thank you for all the help, everything works just as I wanted.


#10

Glad to hear!

Perhaps you can solution my post above to help others?