Door sensor to trigger Aeotec doorbell and send SMS


#1

1) Give a description of the problem
A simple piston to check the state change on a door sensor and ring a chime when “open”
2) What is the expected behavior?
The Aeotec Doorbell is triggered to ring a chime when a door sensor is open, then send an SMS notice to my phone of the event. When the door sensor closes, there is no chime, and an SMS notice is sent to my phone, indicating the current status (open/close)
3) What is happening/not happening?
Everything appears to function as expected. I would like to know/learn if there is a simple way to turn this piston on/off (arm/disarm) from the ST app?

I am new to ST and to webCore and this is my first attempt at writing code. I wonder if my approach is the most efficient method of accomplishing this. i.e. is there a better way?

Thank you for any input!


4) Post a Green Snapshot of the pistonimage
(UPLOAD YOUR IMAGE HERE)


#2

You could create a “simulated switch” in the ST IDE, then add that to your piston:

If ‘Simulated Switch’ is ‘ON’
AND
‘Contact Sensor 6’s’ contact changes
THEN…

EDIT: Here’s an example of a piston I use for a “Hot Tub” mode. I use Action Tiles and have a on/off switch within Action Tiles that triggers this piston: (“Switch 9” is the virtual switch)


#3

I like what you’ve got. I agree it should work You’re using some advanced concepts for such a simple piston too, so clearly you’ve done your homework. Usually you only need to use $currentEventDevice if you’ve got more than one device which could be the trigger. Same with $currentEventValue.

For a single event like this though, you just just write a simple IF block

If door changes to open then
Send your notice
play the sound
ELSE
just send the message

The way WC works is that all events on that device will initiate the piston to run. So even when the door closes the piston will run. Depending on what you’re checking for it may not do anything but the event will cause the piston to fire. Which is why the ELSE part will work, because it’s a change which is not open… Hopefully you follow my logic there…kind of wordy but not sure how else to say that.

As for turning this whole thing off within the ST app. I would advise using a restriction on the overall piston and using the Simulated switch that was suggested previously. I would set it up a bit differently though.

My suggestion would be to use #6 from this thread.


#4

These are great inputs and I appreciate your insights on this! I’m currently using this piston, without the doorbell chime, to trigger on the 5 door sensors that I have installed. I keep the “test sensor” at my desk, so that I can easily test the piston operation without having to get up and open a door :slight_smile:

There’s such a lot to learn here…I’m going to study the Simulated switch method and attempt to incorporate that into my final piston.

Thanks all… I will likely have more questions coming soon!