Event passed to piston does not match trigger event

triggers

#1

I have the following piston which looks for the mode changing. When it changes, the temperature set points are to be updated accordingly. What is happening, however, is sometimes I get a time event passed to the piston rather than the mode change event. Not sure how to work around this but it is definitely not working consistently.

Here are the logs showing it working once and then not working the next time:

|+0ms|╔Received event **[Las Vegas].time/recovery = 1543759250194** with a delay of 1ms|
| --- | --- |
|+163ms|║RunTime Analysis CS > 23ms > PS > 76ms > PE > 63ms > CE|
|+166ms|║Runtime (59866 bytes) successfully initialized in 76ms (v0.3.108.20180906) (165ms)|
|+168ms|║╔Execution stage started|
|+169ms|║╚Execution stage complete. (2ms)|
|+170ms|╚Event processed successfully (170ms)|

|12/1/2018, 11:00:29 PM +265ms|
|+0ms|╔Received event **[Las Vegas].mode = Night** with a delay of 67ms|
|+166ms|║RunTime Analysis CS > 24ms > PS > 75ms > PE > 68ms > CE|
|+170ms|║Runtime (59517 bytes) successfully initialized in 75ms (v0.3.108.20180906) (168ms)|
|+171ms|║╔Execution stage started|
|+180ms|║║Comparison (string) :029adf8e458ff2c389317cdd86776bd5: changes = true (1ms)|
|+181ms|║║Cancelling condition #4's schedules...|
|+183ms|║║Condition #4 evaluated true (5ms)|
|+184ms|║║Cancelling condition #3's schedules...|
|+185ms|║║Condition group #3 evaluated true (state changed) (8ms)|
|+189ms|║║Evaluating switch with values [[i:23:v, v:[t:string, v::029adf8e458ff2c389317cdd86776bd5:, n:Night]]]|
|+194ms|║║Comparison (string) :029adf8e458ff2c389317cdd86776bd5: is (string) Night = true (2ms)|
|+197ms|║║Cancelling statement #29's schedules...|
|+1470ms|║║Calculating (string) The nighttime temperature in Las Vegas is + (string) 47.7 >> (string) The nighttime temperature in Las Vegas is 47.7|
|+1477ms|║║Calculating (string) The nighttime temperature in Las Vegas is 47.7 + (string) but inside it is >> (string) The nighttime temperature in Las Vegas is 47.7 but inside it is|
|+1484ms|║║Calculating (string) The nighttime temperature in Las Vegas is 47.7 but inside it is + (string) 73 >> (string) The nighttime temperature in Las Vegas is 47.7 but inside it is 73|
|+1491ms|║║Calculating (string) The nighttime temperature in Las Vegas is 47.7 but inside it is 73 + (string) upstairs and >> (string) The nighttime temperature in Las Vegas is 47.7 but inside it is 73 upstairs and|
|+1498ms|║║Calculating (string) The nighttime temperature in Las Vegas is 47.7 but inside it is 73 upstairs and + (string) 74 >> (string) The nighttime temperature in Las Vegas is 47.7 but inside it is 73 upstairs and 74|
|+1504ms|║║Calculating (string) The nighttime temperature in Las Vegas is 47.7 but inside it is 73 upstairs and 74 + (string) downstairs. Today's high will be >> (string) The nighttime temperature in Las Vegas is 47.7 but inside it is 73 upstairs and 74 downstairs. Today's high will be|
|+1509ms|║║Calculating (string) The nighttime temperature in Las Vegas is 47.7 but inside it is 73 upstairs and 74 downstairs. Today's high will be + (string) 62 >> (string) The nighttime temperature in Las Vegas is 47.7 but inside it is 73 upstairs and 74 downstairs. Today's high will be 62|
|+1514ms|║║Calculating (string) The nighttime temperature in Las Vegas is 47.7 but inside it is 73 upstairs and 74 downstairs. Today's high will be 62 + (string) and the low will be >> (string) The nighttime temperature in Las Vegas is 47.7 but inside it is 73 upstairs and 74 downstairs. Today's high will be 62 and the low will be|
|+1519ms|║║Calculating (string) The nighttime temperature in Las Vegas is 47.7 but inside it is 73 upstairs and 74 downstairs. Today's high will be 62 and the low will be + (string) 41 >> (string) The nighttime temperature in Las Vegas is 47.7 but inside it is 73 upstairs and 74 downstairs. Today's high will be 62 and the low will be 41|
|+1523ms|║║Calculating (string) The nighttime temperature in Las Vegas is 47.7 but inside it is 73 upstairs and 74 downstairs. Today's high will be 62 and the low will be 41 + (string) . >> (string) The nighttime temperature in Las Vegas is 47.7 but inside it is 73 upstairs and 74 downstairs. Today's high will be 62 and the low will be 41.|
|+1829ms|║║Executed physical command [LV Thermostat - Downstairs].log([info, The nighttime temperature in Las Vegas is 47.7 but inside it is 73 upstairs and 74 downstairs. Today's high will be 62 and the low will be 41., true]) (299ms)|
|+1830ms|║║Executed [LV Thermostat - Downstairs].log (302ms)|
|+2075ms|║║Executed physical command [LV Thermostat - Downstairs].setHeatingSetpoint([69.0]) (241ms)|
|+2076ms|║║Executed [LV Thermostat - Downstairs].setHeatingSetpoint (243ms)|
|+2084ms|║║Calculating (string) Las Vegas downstairs heating set to + (string) 69 >> (string) Las Vegas downstairs heating set to 69|
|+2104ms|║║Executed virtual command [LV Thermostat - Downstairs].sendPushNotification (15ms)|
|+2307ms|║║Executed physical command [LV Thermostat - Downstairs].setCoolingSetpoint([80.0]) (199ms)|
|+2308ms|║║Executed [LV Thermostat - Downstairs].setCoolingSetpoint (201ms)|
|+2316ms|║║Calculating (string) Las Vegas downstairs cooling set to + (string) 80 >> (string) Las Vegas downstairs cooling set to 80|
|+2335ms|║║Executed virtual command [LV Thermostat - Downstairs].sendPushNotification (14ms)|
|+2339ms|║║Cancelling statement #50's schedules...|
|+2552ms|║║Executed physical command [LV Thermostat - Upstairs].setHeatingSetpoint([68.0]) (208ms)|
|+2553ms|║║Executed [LV Thermostat - Upstairs].setHeatingSetpoint (211ms)|
|+2561ms|║║Calculating (string) Las Vegas upstairs heating set to + (string) 68 >> (string) Las Vegas upstairs heating set to 68|
|+2582ms|║║Executed virtual command [LV Thermostat - Upstairs].sendPushNotification (16ms)|
|+2785ms|║║Executed physical command [LV Thermostat - Upstairs].setCoolingSetpoint([77.0]) (199ms)|
|+2787ms|║║Executed [LV Thermostat - Upstairs].setCoolingSetpoint (201ms)|
|+2794ms|║║Calculating (string) Las Vegas upstairs cooling set to + (string) 77 >> (string) Las Vegas upstairs cooling set to 77|
|+2813ms|║║Executed virtual command [LV Thermostat - Upstairs].sendPushNotification (14ms)|
|+2819ms|║╚Execution stage complete. (2649ms)|
|+2821ms|╚Event processed successfully (2821ms)|

Here is the piston: