1) Give a description of the problem
Recently added a new door sensor to a piston. The piston seems to be using “stale” state from that sensor when it is triggered by a timeout, and therefore evaluating incorrectly. I am puzzled why this would be.
2) What is the expected behavior?
I expect the most recent (“live”) state of the door sensor to be used when the piston triggers by an subsequent timeout event.
3) What is happening/not happening?
A timer checks that the door has not been open for 45’, and if it has then notifications are sent. (This is on line 32 of the attached piston screenshot.) What seems to be happening is that when the timer expires, the wrong state of the door sensor is used and the notification condition is incorrectly satisfied.
The IDE logs show that the door sensor does change to “closed” (after bouncing open briefly), and should be in the closed state when the piston evaluates from the timeout. The piston’s logs show that the previous state (5:56:10 AM) from the contact was “open”, with no subsequent “closed” state activity being seen.
I would think that the latest and greatest live state of the sensors would always be used (in line 28 of the piston) when the timeout occurs (at 6:41:09 AM in the log) … apparently that is not happening.
I can add some type of workaround, but I’d prefer understanding why this is happening first.
BTW, the other two door sensors read closed through the events, so they are not involved in the problem.
4) Post a Green Snapshot of the piston
5) Attach any logs (From ST IDE and by turning logging level to Full)
4/3/2019, 6:41:09 AM +72ms
+0ms ╔Received event [HayekHome].time = 1554298870626 with a delay of -1555ms
+188ms ║Runtime (44911 bytes) successfully initialized in 124ms (v0.3.10a.20190223) (186ms)
+189ms ║╔Execution stage started
+219ms ║║ TIMEOUT EXPIRED IN INNER LOOP
+220ms ║║Executed virtual command log (1ms)
+286ms ║║Executed virtual command sendPushNotification (49ms)
+295ms ║║Executed virtual command setVariable (4ms)
+398ms ║║Executed [Echo - Family Room].setVolumeSpeakAndRestore (91ms)
+436ms ║║Executed [Echo - Master Bedroom].setVolumeSpeakAndRestore (35ms)
+474ms ║║Executed [Echo - Media Room].setVolumeSpeakAndRestore (34ms)
+577ms ║║Executed virtual command sendSMSNotification (24ms)
+586ms ║╚Execution stage complete. (396ms)
+587ms ╚Event processed successfully (588ms)
4/3/2019, 5:56:10 AM +399ms
+2ms ╔Received event [Garage Door - Ctr].contact = open with a delay of 138ms
+181ms ║Runtime (44915 bytes) successfully initialized in 124ms (v0.3.10a.20190223) (178ms)
+182ms ║╔Execution stage started
+210ms ║║Executed virtual command setState (1ms)
+232ms ║╚Execution stage complete. (50ms)
+234ms ║Setting up scheduled job for Wed, Apr 3 2019 @ 6:41:10 AM PDT (in 2699.994s)
+245ms ╚Event processed successfully (245ms)Preformatted text
IDE LOG SHOWING THE CONTACT “BOUNCE” EVENT:
2019-04-03 5:56:10.309 AM PDT
4 hours ago DEVICE contact closed Garage Door - Ctr was closed
2019-04-03 5:56:10.261 AM PDT
4 hours ago DEVICE contact open Garage Door - Ctr was opened
2019-04-03 5:56:10.026 AM PDT
4 hours ago DEVICE contact closed Garage Door - Ctr was closed
REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.