After many months of working fine, my webcore instance has recently been missing some motion events.
One example, which I’ll copy below, is a motion inactive signal from one of my Smartthings Motion Sensors. The event was captured in the ST IDE, but does not appear in the Webcore log (and the light was never turned off). Any idea what could cause a disconnect between the ST IDE and Webcore?
Webcore Log:
12/24/2019, 12:36:32 PM +121ms
+1ms
╔Received event [My home].time = 1577219793611 with a delay of -1491ms
+245ms
╚Event processed successfully (245ms)
12/24/2019, 12:35:33 PM +291ms
+1ms
╔Received event [Guest Bathroom Motion Sensor].motion = active with a delay of 380ms
+507ms
║Setting up scheduled job for Tue, Dec 24 2019 @ 12:36:33 PM PST (in 59.814s)
+516ms
╚Event processed successfully (516ms)
12/24/2019, 9:52:46 AM +224ms
+0ms
╔Received event [My home].time = 1577209966776 with a delay of -553ms
One thing I noticed from looking at your Piston is I don’t think line 35 is necessary If A device is already in the state you ask it to set something to webcore ignores it. If you turn on full logging it will say something to that effect n the log. I am sure it has nothing to do with your issue but thought I would mention it,. I have read over on the Webcore forum that using a device as a trigger for the same device is not a good idea.
Also you might want to try posting over on the webcore forum, as there are a number of experts that stay pretty active and are very responsive and helpful.
Thanks for that! I thought I was being helpful having Webcore avoiding running an unnecessary command, but with command optimization it wouldn’t run anyway if the switch is already off. I’ll make that change to my pistons.
And I’ll also look into the webCoRE specific forum!
Thank you! I haven’t had a chance to post on the webCoRE forum, so no worry of a duplicate post.
My problems seem to be getting better over time. It’s also been good motivation to optimize my pistons.
A nothing thing I’ve noticed is getting “piston waited for a semaphore” in pistons I shouldn’t be seeing that. For example, I have a simple motion on/light on—-motion stays inactive/light off piston that I’m seeing semaphore waits. I don’t know how too many hits can be coming in when there is no overlap. Maybe just a weird quirk.
I don’t know which device in your piston represents “Guest Bathroom Motion Sensor”… but all of your motion triggers happens 1-10 minutes after the sensor is no longer active…
For what it’s worth, motion sensors can be some of the “chattiest” of devices. For reliability, I typically only place one motion sensor trigger in each piston. (and do not enable parallelism)
Such as:
execute
IF Sensor A's motion changes to on
Then turn on light
END IF
IF Sensor A's motion stays inactive for X min
Then turn off light
END IF
end execute
If you cram multiple sensors in to the same piston, this often leads to multiple timers simultaneously counting down inactivity… (which often causes problems)
I try to code so there is never more than one timer in limbo, per piston.