Receiving Duplicate SMS Notification


#1

1) Give a description of the problem
Created a Piston that will send me a notification if a garage door remains open for more than x minutes, after a certain time of the day. If the door is open, send an SMS message. Everything is working, but I get two copies of the message.

2) What is the expected behavior?
Would like to receive just a single SMS. Ideally I would also like to get a second message after the door has been closed, but haven’t figured that out. Might just create a second piston that does that.

3) What is happening/not happening?
I’m getting two messages

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
1/27/2019, 3:01:07 PM +168ms
+1ms ╔Received event [Home].time = 1548619268416 with a delay of -1249ms
+494ms ║RunTime Analysis CS > 72ms > PS > 401ms > PE > 20ms > CE
+498ms ║Runtime (38657 bytes) successfully initialized in 401ms (v0.3.109.20181207) (496ms)
+500ms ║╔Execution stage started
+517ms ║║Cancelling condition #5’s schedules…
+519ms ║║Condition #5 evaluated true (3ms)
+521ms ║║Cancelling condition #3’s schedules…
+523ms ║║Condition group #3 evaluated true (state changed) (9ms)
+525ms ║║Cancelling condition #1’s schedules…
+526ms ║║Condition group #1 evaluated true (state changed) (15ms)
+531ms ║║Cancelling statement #6’s schedules…
+548ms ║║Calculating (string) Bill’s Side and Krystal’s Side + (string) Garage Doors are Open! >> (string) Bill’s Side and Krystal’s Side Garage Doors are Open!
+1144ms ║║Executed virtual command sendSMSNotification (587ms)
+1306ms ║║Condition #5 evaluated true (1ms)
+1308ms ║║Condition group #3 evaluated true (state did not change) (4ms)
+1309ms ║║Condition group #1 evaluated true (state did not change) (7ms)
+1313ms ║║Cancelling statement #6’s schedules…
+1326ms ║║Calculating (string) Bill’s Side and Krystal’s Side + (string) Garage Doors are Open! >> (string) Bill’s Side and Krystal’s Side Garage Doors are Open!
+1428ms ║║Executed virtual command sendSMSNotification (94ms)
+1432ms ║╚Execution stage complete. (932ms)
+1433ms ╚Event processed successfully (1433ms)
1/27/2019, 3:00:38 PM +103ms
+1ms ╔Received event [Home].test = 1548619238103 with a delay of 1ms
+229ms ║RunTime Analysis CS > 23ms > PS > 180ms > PE > 26ms > CE
+232ms ║Runtime (38647 bytes) successfully initialized in 180ms (v0.3.109.20181207) (230ms)
+234ms ║╔Execution stage started
+253ms ║║Comparison (time) 54038344 is_after (time) 33900000 = true (9ms)
+255ms ║║Time restriction check passed
+257ms ║║Condition #2 evaluated true (16ms)
+273ms ║║Comparison (enum) open is (string) open = true (2ms)
+276ms ║║Condition #4 evaluated true (16ms)
+290ms ║║Comparison (enum) open stays (string) open = true (2ms)
+294ms ║║Comparison (enum) open stays (string) open = true (2ms)
+312ms ║║Adding a timed trigger schedule for device :2b82e99df12c72eb6fc69cb396728e27: for condition 5
+317ms ║║Adding a timed trigger schedule for device :43d2814a300d95d84f9af5ccbaa70bd5: for condition 5
+321ms ║║Cancelling condition #5’s schedules…
+322ms ║║Condition #5 evaluated false (45ms)
+324ms ║║Cancelling condition #3’s schedules…
+325ms ║║Condition group #3 evaluated false (state changed) (66ms)
+327ms ║║Cancelling condition #1’s schedules…
+328ms ║║Condition group #1 evaluated false (state changed) (88ms)
+342ms ║╚Execution stage complete. (109ms)
+350ms ║Setting up scheduled job for Sun, Jan 27 2019 @ 3:01:08 PM EST (in 29.964s), with 1 more job pending
+360ms ╚Event processed successfully (360ms)


#2

Hi @bbwebb
I haven’t tested it but I believe line#25 is causing that…

1 - Try it again by deleting line 25
2 - For the door closing part…

IF contact sensor 1 or 2 CHANGES TO CLOSED
do this do that
send SMS


#3

That makes sense, and worked! Really didn’t need the two conditions.

On the closing part. The issue that I’m having is that I only want to send the message that the garage door was closed if I’ve already received the message that it was left open.


#4

I am glad it worked…

ok for the closing part, you need to use a very basit variable…

After the send SMS part
you can set a new value to a variable
Send SMS “garage doors are open”
Set variable {garagedoor} to TRUE

IF Contact sensor 1 and 2 CHANGES to CLOSED
AND
If variable {garage door} is TRUE
send SMS "It’s all good, garage doors are closed, no panic:))"
(but now we have set the variable back to FALSE)
Set variable value {garagedoor} = FALSE

How are you with the variables??
I’ll do my best to walk you through if you need help.


#5

Still learning for sure! I spend as much time trying to understand what all of the options do, as I do building the piston.

That worked great. Initially I defined the variable to start out as FALSE, but that resulted in getting the text during the other hours. leaving it undefined did the trick.

Thanks so much for the help. Now to figure out what I want to do next :slight_smile:
Bill


#6

Cool:)
Yes i forgot mention the starting point of the variable but you already got that down:))))

oh man webcore is so cool, you are in for a ride:))))))) (recent statistics revealed that most divroces caused by, husbands/wifes getting lost in WebCore LOL)