Multiple Push Notifications


#1

1) Give a description of the problem
Multiple(2,3,4 or more) push notifications for the same even firing via iOS Shortcuts using Siri. This happens on all member phones. I’ve deleted devices and re-paired them to my ST hub to confirm they weren’t “stuck” to an old automation that could be sending me the notifications. I also turned on SMS notifications and consistently would receive two notifications that way, never less never more even though I could receive anywhere from 2-7 push notifications for the same piston. Not sure where to turn at this point.

Because I’m using iOS Shortcuts to obtain Siri voice control, (Siri is commanding Shortcuts to fire the Webcore piston for this part properly) i need to use Webcore to obtain the push notification. My piston that is fired by Siri is a separate unique piston that does not contain the push notification request.

2) What is the expected behaviour?
One push notification when event fires.

3) What is happening/not happening?
Too many notifications of the same event.

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach logs after turning logging level to Full

    2/16/2021, 4:44:41 PM +941ms
    +1ms ╔Received event [Top Of Steps X-Mas LX].switch = on with a delay of 56ms
    +10133ms ║RunTime Analysis CS > 15ms > PS > 10091ms > PE > 26ms > CE
    +10134ms ║Piston waited at a semaphore for 10087ms
    +10136ms ║Runtime (40024 bytes) successfully initialized in 10091ms (v0.3.113.20210203) (10134ms)
    +10137ms ║╔Execution stage started
    +10194ms ║║Comparison (enum) on is (string) on = true (2ms)
    +10196ms ║║Comparison (enum) on is (string) on = true (1ms)
    +10198ms ║║Comparison (enum) on is (string) on = true (1ms)
    +10200ms ║║Comparison (enum) on is (string) on = true (1ms)
    +10202ms ║║Comparison (enum) on is (string) on = true (1ms)
    +10205ms ║║Comparison (enum) on is (string) on = true (1ms)
    +10207ms ║║Comparison (enum) on is (string) on = true (1ms)
    +10209ms ║║Cancelling condition #2's schedules...
    +10210ms ║║Condition #2 evaluated true (70ms)
    +10211ms ║║Cancelling condition #1's schedules...
    +10212ms ║║Condition group #1 evaluated true (state changed) (71ms)
    +10214ms ║║Cancelling statement #3's schedules...
    +10238ms ║║Executed virtual command sendSMSNotification (19ms)
    +10262ms ║║Executed virtual command sendPushNotification (21ms)
    +10264ms ║╚Execution stage complete. (128ms)
    +10265ms ╚Event processed successfully (10265ms)

#2

I only see 2 PUSH notifications in the log, just as you have programmed in your piston.


#3

Ok, the snake must be so close to striking me, but where do you see two calls for a push notification in my piston? And even still, why do I receive more than two push notifications at the same time?

I’m gonna keep scanning this over and I’ve been fussing with it for a month or so now. I know it’s going to be obvious, but I’m just not seeing it. And this is about as simple a piston as can be.

Thanks.


#4

Also, the inclusion of the SMS notification is just to prove to myself that there’s no consistency between Push and SMS notifications which logically they should be exactly the same in the same piston. One for one.


#5

Sorry, only one PUSH and one SMS. This PUSH goes to the ST app of everyone that is registered on that account and is in the messages section. The SMS is a text to your choice of phone numbers directly to the phone.


#6

Right… Sooooo… any thoughts why i might be getting multiples of the same event? I have no automations setup in SmartThings using these devices so there shouldn’t be accidental notifications coming from other automations somewhere…

Thanks!


#7

Your log only shows one PUSH and one SMS being executed. Not sure where the others are coming from. Unless the list of switches that you have in your trigger are becoming true at different times and are triggering this piston multiple times (for each switch that changes state). I suggest taking out all but a single switch and see if the multiple PUSH/SMS occur.


#8

I have done that and if it’s a single device, i get a single notification. So while that sort of makes sense, the piston says ALL, so once ALL is true then the notification should be sent no? And if it’s sending me a push for each device, i should get 7 each time. There’s absolutely no constistency. There are 2ms between each of the 7 comparisons.

Thanks for the idea.


#9

Just a suggestion to try…
Take a single switch and make it a trigger and all of the others a condition…

IF Switch 3 CHANGES TO On
and
All of Switch 5, 6, 8, 9, 13, 14 are On
Then Do stuff.

See what happens.


#10

I’m going to keep that in my back pocket for the moment.

Here’s why. If I run a Scene in ST that fires the same 7 switches, i get one and only one push and SMS. And I’ve tried this multiple times and same result.

Now to figure out why Siri and/or iOS Shortcuts causes a glitch…

Any thoughts?


#11

Sorry. Android here.


#12

‘Event’ singular? Your notification piston will receive seven events in quick succession and there will be semaphore waits to add interesting delays to some of them.

Each time an event is received saying a switch is now on, the all ... are on will use on as the current value of that switch and then check what value SmartThings has as the current value of the other switches.

If the switches turn on in series and take their time about it, the first on will be received while the piston sees the other six switches as still off. Then the second on will be received and there will be five switches still off and so on until the last switch turns on and the push notification has been sent.

Now take that elegant scenario, and say one of the events arrives a bit too close to the last one. Let’s say it is the third event. As there is already a piston processing the second on event, the piston processing the third one will hit a semaphore and wait up to ten seconds to allow the second one to finish (more often than not the full ten seconds) before it continues. By the time it continues all the other switches are now on so a second notification gets sent.

So things can get a bit messy depending on how quickly the switches are turned on.