1) Give a description of the problem
A Piston with an if statement that tests if Location Mode changes to any of one set and changes away from another set didn’t work.
2) What is the expected behavior?
Both conditions of the if should have evaluated to true.
3) What is happening/not happening?
The changes away from any of part evaluated to false, even though the Location Mode did just change away from one of the entries.
In the picture I’m referring to the first condition group of the second if statement. The logs show two consecutive events: Location Mode changes to Returning (:f0e9f598527e206e3175b1f965119279:), and Location Mode changes to Home (:b1070d1f86ac0eb5509e790e6c1d617d:).
I highlighted the condition in the log that evaluated incorrectly. This tests if Location Mode changes away from any of Returning, Vacation, or Away. Clearly, the previous event was Location Mode = Returning, and in this event Location Mode = Home. So, this condition should have evaluated to true. But as you can see in the log it evaluated to false.
FWIW, I’ve used this construct many times and it has worked just fine. And, yes, as I understand it, two triggers can be in the same condition group if they’re for the same device/attribute, which is the case here.
Is this a bug? It sure seems like it to me.
4) Post a Green Snapshot of the piston
5) Attach any logs (From ST IDE and by turning logging level to Full)
2/18/2018, 3:56:35 PM +705ms
+0ms ╔Received event [Doral Ct].mode = Home with a delay of 92ms
+155ms ║RunTime Analysis CS > 23ms > PS > 47ms > PE > 86ms > CE
+158ms ║Runtime (45073 bytes) successfully initialized in 47ms (v0.2.102.20180116) (157ms)
+159ms ║╔Execution stage started
+172ms ║║Comparison (string) :b1070d1f86ac0eb5509e790e6c1d617d: changes_to_any_of (string) :f0e9f598527e206e3175b1f965119279:,:0330ac3fcc593bae7e16b64cb3917e59:,:58a71c424e58cffffc004203fcb08e32: = false (4ms)
+174ms ║║Cancelling condition #6’s schedules…
+174ms ║║Condition #6 evaluated false (8ms)
+175ms ║║Condition group #27 evaluated false (state did not change) (10ms)
+179ms ║║Comparison (time) 57395882 happens_daily_at (time) 84600000 = false (0ms)
+180ms ║║Condition #5 evaluated false (4ms)
+185ms ║║Cancelling statement #5’s schedules…
+188ms ║║Requesting time schedule wake up at Sun, Feb 18 2018 @ 11:30:00 PM CST
+200ms ║║Condition #24 evaluated false (6ms)
+201ms ║║Condition group #1 evaluated false (state did not change) (36ms)
+210ms ║║Comparison (string) :b1070d1f86ac0eb5509e790e6c1d617d: changes_to_any_of (string) :b1070d1f86ac0eb5509e790e6c1d617d:,:aa96cbc2a1c70bc707d94201749098ff:,:3678843679dc3d0590aa7b01f0ebb09a: = true (3ms)
+212ms ║║Cancelling condition #22’s schedules…
+213ms ║║Condition #22 evaluated true (7ms)
+222ms ║║Comparison (string) :b1070d1f86ac0eb5509e790e6c1d617d: changes_away_from_any_of (string) :f0e9f598527e206e3175b1f965119279:,:0330ac3fcc593bae7e16b64cb3917e59:,:58a71c424e58cffffc004203fcb08e32: = false (5ms)
+223ms ║║Condition #29 evaluated false (10ms)
+224ms ║║Condition group #25 evaluated false (state did not change) (19ms)
+228ms ║║Comparison (time) 57395931 happens_daily_at (time) 21600000 = false (0ms)
+230ms ║║Condition #31 evaluated false (4ms)
+231ms ║║Cancelling statement #31’s schedules…
+235ms ║║Requesting time schedule wake up at Mon, Feb 19 2018 @ 6:00:00 AM CST
+238ms ║║Condition group #30 evaluated false (state did not change) (12ms)
+245ms ║║Condition #26 evaluated false (7ms)
+246ms ║║Condition group #23 evaluated false (state did not change) (42ms)
+260ms ║╚Execution stage complete. (101ms)
+265ms ║Setting up scheduled job for Sun, Feb 18 2018 @ 11:30:00 PM CST (in 27204.031s), with 1 more job pending
+278ms ╚Event processed successfully (277ms)
2/18/2018, 3:03:18 PM +313ms
+1ms ╔Received event [Doral Ct].mode = Returning with a delay of 93ms
+159ms ║RunTime Analysis CS > 13ms > PS > 57ms > PE > 89ms > CE
+162ms ║Runtime (45060 bytes) successfully initialized in 57ms (v0.2.102.20180116) (160ms)
+164ms ║╔Execution stage started
+175ms ║║Comparison (string) :f0e9f598527e206e3175b1f965119279: changes_to_any_of (string) :f0e9f598527e206e3175b1f965119279:,:0330ac3fcc593bae7e16b64cb3917e59:,:58a71c424e58cffffc004203fcb08e32: = true (2ms)
+177ms ║║Condition #6 evaluated true (6ms)
+197ms ║║Comparison (string) :f0e9f598527e206e3175b1f965119279: changes_away_from_any_of (string) :b1070d1f86ac0eb5509e790e6c1d617d:,:aa96cbc2a1c70bc707d94201749098ff:,:3678843679dc3d0590aa7b01f0ebb09a: = false (17ms)
+198ms ║║Cancelling condition #28’s schedules…
+199ms ║║Condition #28 evaluated false (21ms)
+200ms ║║Cancelling condition #27’s schedules…
+201ms ║║Condition group #27 evaluated false (state changed) (31ms)
+204ms ║║Comparison (time) 54198515 happens_daily_at (time) 84600000 = false (0ms)
+206ms ║║Condition #5 evaluated false (4ms)
+207ms ║║Cancelling statement #5’s schedules…
+210ms ║║Requesting time schedule wake up at Sun, Feb 18 2018 @ 11:30:00 PM CST
+220ms ║║Condition #24 evaluated false (8ms)
+221ms ║║Cancelling condition #1’s schedules…
+222ms ║║Condition group #1 evaluated false (state changed) (52ms)
+231ms ║║Comparison (string) :f0e9f598527e206e3175b1f965119279: changes_to_any_of (string) :b1070d1f86ac0eb5509e790e6c1d617d:,:aa96cbc2a1c70bc707d94201749098ff:,:3678843679dc3d0590aa7b01f0ebb09a: = false (3ms)
+233ms ║║Condition #22 evaluated false (7ms)
+234ms ║║Condition group #25 evaluated false (state did not change) (9ms)
+238ms ║║Comparison (time) 54198549 happens_daily_at (time) 21600000 = false (1ms)
+239ms ║║Condition #31 evaluated false (4ms)
+241ms ║║Cancelling statement #31’s schedules…
+244ms ║║Requesting time schedule wake up at Mon, Feb 19 2018 @ 6:00:00 AM CST
+246ms ║║Condition group #30 evaluated false (state did not change) (11ms)
+254ms ║║Condition #26 evaluated false (7ms)
+255ms ║║Condition group #23 evaluated false (state did not change) (31ms)
+259ms ║╚Execution stage complete. (96ms)
+262ms ║Setting up scheduled job for Sun, Feb 18 2018 @ 11:30:00 PM CST (in 30401.426s), with 1 more job pending
+271ms ╚Event processed successfully (270ms)
REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.