Missed motion events; outage?


#13

This is often because of more than one trigger per piston. (piston 8w7tp has three)

Moving the motion sensors to their own piston will greatly reduce the semaphore delays.


#14

This is often because of more than one trigger per piston. (piston 8w7tp has three)

So, should I have a piston for each condition: Motion, Inactive, manual switch on, manual switch off?

I’ve been tempted to re-write all of my pistons now that I know more about webcore, but I think I still have more to learn. If I do so, I want to do it correctly.

By the way, I may code a bit differently, but piston 04tfe looks good as is…

I saw some using “Motion clear for X”, but didn’t know that was the option when I wrote mine. Is that the biggest difference in your code?

Thanks


#15

Piston pihb has ZERO triggers… This means that all of your conditions are treated as triggers. (notice all the lightning bolts in the left margin)

In a nutshell, this piston will run top to bottom, and execute any command not blocked by conditions whenever any of the lightning bolt lines changes to ANYTHING at all.

Your current triggers:

  • Location changing to Home
  • Location changing to Away
  • Location changing to Night
  • Location changing to X
  • Motion Sensor 2 changing to active
  • Motion Sensor 2 changing to inactive
  • @BathroomsFreeze changing to false
  • @BathroomsFreeze changing to true
  • Sun sets
  • Sun rises

When any of these 10+ things happens, the piston runs top to bottom.

At the risk of sounding like a broken record, when I want reliability, I try to only use one trigger per piston.


#16

The following two triggers are actually only one:

  • IF MotionA changes to active
  • IF MotionA changes to inactive

I put both in the same piston, so only that piston fires when the motion sensor changes.


Pro Tip:

If you only use one of them (IF Motion changes to active), the piston will still fire when it changes to inactive. (so it’s better to keep both in the same piston)


#17

Thanks WCmore for your help. I adjusted the code as you suggested (See piston snapshot below), but still have the same problem. I tested the piston by activating the motion and letting it turn off after the 3 min delay. On the fourth try, the light stayed on.

The piston log for the unsuccessful try shows:
*12/27/2019, 4:19:50 PM - Received event [Bathroom Motion].motion = active with a delay of 209ms
(It never registers as inactive so the light just stays.)

The previous (successful) log showed both the active and inactive events:
*12/27/2019, 4:14:43 PM - Received event [Bathroom Motion].motion = active with a delay of 243ms
*12/27/2019, 4:15:03 PM - Received event [Bathroom Motion].motion = inactive with a delay of 2898ms


#18

Your triggers look much better in piston aeyz2! :+1:


Two things come to mind when the motion sensor is not faithfully reporting itself to the hub:

  1. It might be time for a new battery
  2. That device may be too far from the hub

Both of these are easy to test and fix.


A tougher possibility is you may have loops bogging down your SmartThings hub or heavy downloading / streaming to your home networking, which can essentially, impact your reliability. This one is much tougher to diagnose and resolve.


#19

If you check the smartthings graph event logs, do you see the motion clear events? I’m still thinking my issue is that the event isn’t making it to webcore.


#20

Thanks WCmore, I now have one trigger per piston. A couple pistons have one trigger and one timer, I hope that is OK. As a result, I went from 6 pistons to 21 pistons. So far so good, and I have seen no missed triggers. Thanks again.


#21

ian_boje:
If you check the smartthings graph event logs, do you see the motion clear events? I’m still thinking my issue is that the event isn’t making it to webcore

No, there are no events. I agree that it seems some events are not even making it to Webcore.


#22

Yes, I do this a lot. The “Every day at X” block stays inside that block, and the normal trigger, ignores what is inside the EVERY block.

So even though they are written in the same piston, they act relatively independent…


#23

Did you see my earlier post, @wjames2020?

The likeliest reasons occasional data is lost is one (or more) of the following:

  • Low battery in the sensor
  • Sensor too far from the hub
  • Poor Mesh network
  • Too much commotion in the home network at the time
    (pistons looping, downloads, gaming, streaming HD etc)

#24

For me things was working fine and all of a sudden motion sensor stays active and lights not turning off. I know WCore gave likeliest reasons but, none of them pertains to me.


#25

Yeah… It is incredibly tough troubleshooting four five different people in the same thread at the same time!!

I am constantly scrolling scrolling trying to only read one person at a time… (so I can respond properly) and then repeating those steps for the next person.

I still think the solution(s) are one of the many found in this thread… but if none of those resolve your issue, I would start a new thread so people can focus on one issue at a time.


#26

Thanks WCore!! I will keep troubleshooting hoping I can figure out something and maybe help someone else in return.


#27

WCmore:
Did you see my earlier post, @wjames2020?

  • Low battery in the sensor: Batteries are fine (multiple sensors)
  • Sensor too far from the hub: One of the sensors with missing events is only 5 feet away.
  • Poor Mesh network: Not sure how to diagnose this
  • Too much commotion in the home network at the time (pistons looping, downloads, gaming, streaming HD etc): Nothing else is using the Internet other than web surfing. (I am the only person here). Is there a good way to diagnose if there are too many pistons looping?

I noticed that if I go to the SmartThings website and look at motion states for the specific devices, the active/inactive list is 100% accurate with nothing missing. When I check my logs on WebCore, there are a few instances missing (and those correspond precisely to missed triggers). I am not sure if this is helpful.


#28

Oh… This seems to contradict what was said earlier… My apologies.

If this second quote is true, then yes, my advice applies to you.


Essentially, if SmartThings is unaware, then webCoRE will be as well…


#29

WCmore:
Oh… This seems to contradict what was said earlier…

My fault, I misread earlier today as I was preoccupied with resetting my SmartThings hub to see if that could help and spent all day putting it back together. (Bad idea, never doing that again.) So it seems that SmartThings is getting the data, but it is not showing up in WebCore. (Hope that makes more sense.)

Additionally, I’m also finding that daily timed events that trigger one piston are running, but not triggering the piston. (Basically, run a lighting scene at sunrise and sunset.) The Sunrise/Sunset piston tries to execute the piston, but the receiving piston doesn’t run. I think whatever is going on is based in my hub (maybe looping too much), but I am at a loss for how to troubleshoot that. :frowning:

Everything worked so well a week ago.


#30

I have been having the exact same problem as OP. The major difference for me is that I have no hub in my setup. All of my integrations are cloud-to-cloud. I can guarantee my hub is not bogged down because it doesn’t exist. :slight_smile:

It seems related to me. My system was working perfectly fine until that outage.

I have a few pistons that trigger on location mode change, and none of them missed an event until after the Dec 19 outage.

I also have a virtual device that has exactly one piston listening to its events, and I have seen that piston fail to fire frequently, even though ST’s log for that device shows the events.

Seems that way to me as well.

Does anybody have any ideas how to troubleshoot this?

Edit, in case this information helps:

I should add that ever since that outage, I’ve seen these exceptions in the live logs, and they seem to correlate with missed pistons:

8:12:17 AM: error org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not execute query; uncategorized SQLException for SQL [select this_.id as id88_0_, this_.version as version88_0_, this_.date_created as date3_88_0_, this_.`key` as key4_88_0_, this_.type as type88_0_, this_.value as value88_0_ from server_config this_ where this_.`key`=?]; SQL state [null]; error code [0]; [SimpleAsyncTaskExecutor-626] Timeout: Pool empty. Unable to fetch a connection in 30 seconds, none available[size:50; busy:1; idle:0; lastwait:30000].; nested exception is org.apache.tomcat.jdbc.pool.PoolExhaustedException: [SimpleAsyncTaskExecutor-626] Timeout: Pool empty. Unable to fetch a connection in 30 seconds, none available[size:50; busy:1; idle:0; lastwait:30000]. @line 1149 (processSchedules)

That exception refers to line 1149 in the WebCore Piston SmartApp, which is:

runIn(t, timeHandler, [data: next])

#31

Is this helpful?

The first screenshot is from SmartThings that show four events, 2 Active and 2 Inactive. The very next screenshot shows the logs from WebCore. Both of the Inactive readings are missing. Is this what you are seeing ian_boje and dds82?



#32

That’s exactly what I saw: events in SmartThings, nothing detected by WebCore.