Repeat until true not working


#1

1) Give a description of the problem
When true doesn’t seem to be executing

2) What is the expected behaviour?
Light should turn on when locked

3) What is happening/not happening?
The piston finishes and the doors do lock but the light is not turned on.

In the end what I am trying to is make piston to secure the house at night.

  1. A switch is turned on to start the process.
  2. announcing locking doors
  3. Lock doors and loop until locked <— This is my focus right now
  4. Then Check garage door
  5. Then Arm alram
  6. Announce house is secure.

#2

Can you provide the log from the execution?


#3

I am using webcore with hubitat

9/1/2023, 1:48:57 PM +122ms
+4ms ╔Received event [V-Time For Bed].switch = off with a delay of 101ms, canQueue: true, calledMyself: false
+26ms ║RunTime initialize > 24 LockT > 2ms > r9T > 6ms > pistonT > 3ms (first state access 11 m:16 6 18)
+31ms ║Runtime (7773 bytes) initialized in 6ms (v0.3.114.20230222_HE)
+33ms ║╔Execution stage started
+45ms ║║Comparison (enum) off changes_to (string) on = false (1ms)
+49ms ║║Condition #2 evaluated false (9ms)
+51ms ║║Cancelling condition #1’s schedules…14 (st:16)
+53ms ║║Condition group #1 evaluated false (condition changed) (13ms)
+59ms ║╚Execution stage complete. (25ms)
+95ms ╚Event processed successfully (91ms)
9/1/2023, 1:48:56 PM +89ms
+4ms ╔Received event [V-Time For Bed].switch = on with a delay of 132ms, canQueue: true, calledMyself: false
+337ms ║RunTime initialize > 336 LockT > 1ms > r9T > 315ms > pistonT > 300ms (first state access 16 m:20 5 331)
+347ms ║Runtime (7705 bytes) initialized in 315ms (v0.3.114.20230222_HE)
+350ms ║╔Execution stage started
+373ms ║║Comparison (enum) on changes_to (string) on = true (1ms)
+388ms ║║Condition #2 evaluated true (19ms)
+391ms ║║Condition group #1 evaluated true (condition changed) (23ms)
+407ms ║║Command optimization: Skipped execution of device command [Back door lock].lock() because it would make no change to the device. (10ms)
+410ms ║║Command optimization: Skipped execution of device command [Basement lock].lock() because it would make no change to the device. (1ms)
+414ms ║║Command optimization: Skipped execution of device command [Garage Lock].lock() because it would make no change to the device. (1ms)
+499ms ║║Executed device command [Kitchen door lock].lock() (83ms)
+548ms ║║Executed device command [Porch lock].lock() (47ms)
+555ms ║║Executed virtual command [Back door lock, Basement lock, Garage Lock, Kitchen door lock, Porch lock].wait [20000] (2ms)
+559ms ║║Requesting wake up at Fri, Sep 1 2023 @ 1:49:16 PM EDT (in 19999ms) for 14 (st:16)
+566ms ║╚Execution stage complete. (216ms)
+706ms ║Setting up scheduled job for Fri, Sep 1 2023 @ 1:49:16 PM EDT (in 19983ms)
+711ms ╚Event processed successfully (708ms)


#4

Looking at the log, it appears the piston is not waking up again from the wait? Are there no further log entries? Has this worked before or is it a new piston?


#5

This is a new piston. I have the logs setup for full. I am just coping them from the page.


#6

Is there a better way to get the logs?


#7

I removed the wait and it works hmmm


#8

So my trigger switch stays on for a second then shuts off. When I set it to stay on it runs correctly


#9

What turns your trigger switch off? If this happens while the piston is waiting, the piston will be run again, the wait will be cancelled, and nothing will happen as the switch is off. You can get round this using the task cancellation policy - its worth reading up on this if you’re not familiar with it.

You should be able to see this in the logs?


#10

Does it work if you take out the 20 second delay?


#11

to be clear note:

559ms ║║Requesting wake up at Fri, Sep 1 2023 @ 1:49:16 PM EDT (in 19999ms) for 14 (st:16)

is where the wakeup for the wait is set.

Then there is another run shows in the logs:

+51ms ║║Cancelling [condition]( #1’s schedules…14 (st:16)

where it is cancelled on the next run that was started by

4ms ╔Received event [V-Time For Bed].switch = off with a delay of 101ms, canQueue: true, calledMyself: false

So the suggestion above on task cancellation policy is correct suggestion

https://wiki.webcore.co/Task_Cancellation_Policy

Also read about