Webcore presense sensor repeated triggers


#1

1) Give a description of the problem
I installed webcore presense sensor on my iphone and I use my iphone’s presense as a trigger to some pistons. However, the WC presence sensor will sometimes send multiple/repeated events.

2) What is the expected behaviour?
When I leave my home, I expect the WC PS to send one trigger/event.

3) What is happening/not happening?
When I leave my home, my webcore pistons receive multiple events.
Example:
received event: Kyle’s Iphone not present. (executes piston to turn off when i leave)
0.1 seconds later
received event: Kyle’s iphone not present. Doesn’t execute the piston because it “changes from not present to not present”. (needs to change from present to not present to execute the piston).
0.1 seconds later
received event: Kyle’s iphone not present.
0.1 seconds later
repeat this process for a total of ~2 times… or 7 times. One day I got 17 notifications

4) Post a Green Snapshot of the pistonimage


Here’s a “minimal” logging snapshot from another piston, because you can’t see all the multiple events if I set it to “full”.


5) Attach logs after turning logging level to Full
This is for the “when arrive” piston (1st piston) above.
2/15/2024, 6:43:01 PM +459ms
+3ms ╔Received event [iPhone Kyle].presence = present with a delay of 1659ms, canQueue: true, calledMyself: false
+19ms ║Runtime (6820 bytes) initialized in 5ms (v0.3.114.20230828_HE)
+21ms ║╔Execution stage started
+63ms ║║Executed virtual command sendPushNotification (29ms)
+73ms ║╚Execution stage complete. (52ms)
+80ms ╚Event processed successfully (77ms)
2/15/2024, 6:43:00 PM +162ms
+5ms ╔Received event [iPhone Kyle].presence = present with a delay of 1245ms, canQueue: true, calledMyself: false
+19ms ║Runtime (6824 bytes) initialized in 2ms (v0.3.114.20230828_HE)
+20ms ║╔Execution stage started
+82ms ║║Executed device command [Driveway].on() (51ms)
+116ms ║║Executed device command [Garage].on() (32ms)
+119ms ║║Command optimization: Skipped execution of device command [Under Cabinet].on() because it would make no change to the device. (1ms)
+185ms ║║Executed device command [Garage lock].unlock() (61ms)
+230ms ║║Executed virtual command sendPushNotification (37ms)
+237ms ║╚Execution stage complete. (217ms)
+243ms ╚Event processed successfully (239ms)
2/15/2024, 8:02:41 AM +333ms
+6ms ╔Received event [iPhone Kyle].presence = not present with a delay of 7111ms, canQueue: true, calledMyself: false
+22ms ║Runtime (6823 bytes) initialized in 3ms (v0.3.114.20230828_HE)
+23ms ║╔Execution stage started
+68ms ║║Executed virtual command sendPushNotification (32ms)
+74ms ║╚Execution stage complete. (51ms)
+83ms ╚Event processed successfully (77ms)
2/15/2024, 8:02:40 AM +895ms
+4ms ╔Received event [iPhone Kyle].presence = not present with a delay of 6721ms, canQueue: true, calledMyself: false
+18ms ║Runtime (6818 bytes) initialized in 2ms (v0.3.114.20230828_HE)
+19ms ║╔Execution stage started
+59ms ║║Executed virtual command sendPushNotification (30ms)
+65ms ║╚Execution stage complete. (46ms)
+71ms ╚Event processed successfully (69ms)
2/15/2024, 8:02:39 AM +349ms
+4ms ╔Received event [iPhone Kyle].presence = not present with a delay of 6036ms, canQueue: true, calledMyself: false
+18ms ║Runtime (6813 bytes) initialized in 2ms (v0.3.114.20230828_HE)
+19ms ║╔Execution stage started
+59ms ║║Executed virtual command sendPushNotification (30ms)
+64ms ║╚Execution stage complete. (45ms)
+71ms ╚Event processed successfully (67ms)
2/15/2024, 8:02:37 AM +874ms
+4ms ╔Received event [iPhone Kyle].presence = not present with a delay of 5491ms, canQueue: true, calledMyself: false
+18ms ║Runtime (6808 bytes) initialized in 2ms (v0.3.114.20230828_HE)
+19ms ║╔Execution stage started
+62ms ║║Executed virtual command sendPushNotification (33ms)
+68ms ║╚Execution stage complete. (48ms)
+75ms ╚Event processed successfully (71ms)
2/15/2024, 8:02:36 AM +321ms
+4ms ╔Received event [iPhone Kyle].presence = not present with a delay of 4919ms, canQueue: true, calledMyself: false
+20ms ║Runtime (6803 bytes) initialized in 3ms (v0.3.114.20230828_HE)
+21ms ║╔Execution stage started
+87ms ║║Executed virtual command sendPushNotification (50ms)


#2

I’ve noticed the same. It only seems to happen occasionally, but dont remember it doing it in the past. I’ve used the WC presence sensor for years.


#3

Looking at the presence driver, it seems to be the cause of this.

If someone can edit some code I can give you something to try to fix it.


#4

I posted an update to the webcore-presence.groovy device if you want to get a new one for user installs.

if it works you can try hpm repair