Changing to Decimal did not change the failure. Here are the logs. I also included the previous comparison that worked correctly.
2/22/2018, 9:39:12 PM +400ms
+1ms ╔Received event [Home].time = 1519360753416 with a delay of -1016ms
+251ms ║RunTime Analysis CS > 22ms > PS > 118ms > PE > 110ms > CE
+254ms ║Runtime (38853 bytes) successfully initialized in 118ms (v0.2.102.20180116) (251ms)
+255ms ║╔Execution stage started
+324ms ║║Comparison (time) 77952669 is_between (time) 75600000 … (time) 1519306920000 = true (10ms)
+325ms ║║Time restriction check passed
+327ms ║║Condition #5 evaluated true (58ms)
+498ms ║║Comparison (decimal) 85.5 was_less_than (decimal) 10.0 = true (161ms)
+500ms ║║Cancelling condition #6’s schedules…
+501ms ║║Condition #6 evaluated true (172ms)
+510ms ║║Comparison (enum) on is (string) on = true (2ms)
+512ms ║║Cancelling condition #7’s schedules…
+513ms ║║Condition #7 evaluated true (12ms)
+514ms ║║Cancelling condition #2’s schedules…
+515ms ║║Condition group #2 evaluated true (state changed) (246ms)
+518ms ║║Cancelling statement #3’s schedules…
+603ms ║║Executed physical command [Living Room Bulb].off() (82ms)
+603ms ║║Executed [Living Room Bulb].off (83ms)
+609ms ║║Skipped execution of physical command [Living Room Light].off([]) because it would make no change to the device. (3ms)
+610ms ║║Executed [Living Room Light].off (5ms)
+614ms ║╚Execution stage complete. (360ms)
+615ms ║Setting up scheduled job for Thu, Feb 22 2018 @ 9:41:13 PM MST (in 120.401s)
+625ms ╚Event processed successfully (625ms)
2/22/2018, 9:37:12 PM +383ms
+1ms ╔Received event [Home].time = 1519360633416 with a delay of -1033ms
+225ms ║RunTime Analysis CS > 24ms > PS > 85ms > PE > 116ms > CE
+228ms ║Runtime (38851 bytes) successfully initialized in 85ms (v0.2.102.20180116) (226ms)
+229ms ║╔Execution stage started
+298ms ║║Comparison (time) 77832628 is_between (time) 75600000 … (time) 1519306920000 = true (10ms)
+300ms ║║Time restriction check passed
+302ms ║║Condition #5 evaluated true (57ms)
+494ms ║║Comparison (decimal) 84.3 was_less_than (decimal) 10.0 = false (182ms)
+496ms ║║Condition #6 evaluated false (193ms)
+497ms ║║Condition group #2 evaluated false (state did not change) (252ms)
+501ms ║╚Execution stage complete. (272ms)
+503ms ║Setting up scheduled job for Thu, Feb 22 2018 @ 9:39:13 PM MST (in 120.531s)
+512ms ╚Event processed successfully (512ms)
What’s strange is that the failure occurred at roughly the same time as yesterday. I do not know if that is significant but it is an odd coincidence.
Mike - Thanks for the comment, but consider the case where the TV is not on at all. Come 9pm, there is nothing that would trigger shutting off the lights, so I’m not sure that will do all that I want. Still, I have not tried Stays, so I will try it to see what happens. On your other point of 2 min being too fast for the system to handle, I could try changing the polling time from 2 min to 4 min. There is nothing magic about 2. But like I said, I have other pistons with a 2 min polling time that seem to be working just fine. Here’s a thought. Is it possible that will all the pistons running on 2 min intervals that I’m getting the equivalent of stack overflow that causes the system to get confused where normally it would be OK? I’ll look at all those pistons and lengthen the time if they do not need to be so fast.
BTW, this piston, or at least a version of it, ran for 6 months in Core with no problems using the same 2 min technique. It is only when I moved it to WebCore that I had these problems. Is there something inherent in Core that makes it better suited for this type of polling piston, or WebCore worse?
Also BTW, I have another piston in WebCore that runs every 10 min, except occasionally, maybe once every day or 2, it fails. In that case I’m turning on a switch, waiting for 2.5 min, then turning it off. But when it fails, it fails to turn off. I catch that problem by using a 2nd piston to determine if the switch is on for too long. I’m still chasing a solution to that problem.
Robin - You are right, I will change the conditions to have it run sooner. But I wanted to test it in the most similar circumstances possible.
Thanks to both of you for your comments. I’ll make a few changes and see what happens. Will let you know.