Blank System Variables and "Was" Conditions Not Working


#1

1) Give a description of the problem
I’m trying to get a variable to update with the current time when my garage door opens or closes. Instead, the variable updates every time the piston runs because the variable $currentEventAttribute (and every variable like it) are always null.

I’ve tried writing this as “if Contact Sensor 1’s contact changed within the last 1 minute” as an alternate, but that evaluates as false every time too.

Is there something in webCoRE I need to enable to start using these variables? They seem very helpful in cutting down on nested IF’s and variables if I could get them to work.

2) What is the expected behavior?
When this piston is executed by a change in Contact Sensor 1 contact, update Timestamp.

3) What is happening/not happening?
Timestamp is updating every time the piston runs.
4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

Logs will be very helpful in this situation. You could also try logging to console the $currentEventAttribute so you can see what it is exactly posting while you gather logs.


#3

Thanks! I’ll pull some logs together for this later today - I just thought maybe there was a known step to take in the configuration of webCoRe that I overlooked to make these work.


#4

I forgot I still had this running without edits, so I have some activity from just now… both from Temperature change [should not affect Timestamp variable] and garage door open/close [should affect Timestamp variable].

11/25/2017, 1:54:07 PM +734ms
+1ms ╔Received event [Garage Door Sensor].temperature = 59 with a delay of 239ms
+186ms ║RunTime Analysis CS > 15ms > PS > 53ms > PE > 118ms > CE
+196ms ║Runtime (57980 bytes) successfully initialized in 53ms (v0.2.0fe.20171109) (194ms)
+197ms ║╔Execution stage started
+212ms ║║Comparison (string) temperature is (enum) closed = false (1ms)
+213ms ║║Condition #63 evaluated false (8ms)
+214ms ║║Condition group #60 evaluated false (state did not change) (9ms)
+216ms ║║Cancelling statement #16’s schedules…
+225ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+235ms ║║Calculating (string) 100 + (string) % >> (string) 100%
+238ms ║║Calculating (string) 0 + (string) % >> (string) 0%
+245ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+255ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+260ms ║║Executed virtual command setTile (1ms)
+270ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+279ms ║║Calculating (string) 100 + (string) % >> (string) 100%
+282ms ║║Calculating (string) 0 + (string) % >> (string) 0%
+286ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+295ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+299ms ║║Executed virtual command setTile (1ms)
+309ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+317ms ║║Calculating (string) 100 + (string) % >> (string) 100%
+320ms ║║Calculating (string) 0 + (string) % >> (string) 0%
+325ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+332ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+336ms ║║Executed virtual command setTile (1ms)
+344ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+353ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+363ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+370ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+379ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+387ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+394ms ║║Calculating (string) Front Porch Overhead Light level is currently Front Porch Overhead Light level is currentlyb, Green
+398ms ║║Calculating (string) Front Porch Overhead Light level is currently >> (string) Front Porch Overhead Light level is currently
+402ms ║║Calculating (string) Front Porch Overhead Light level is currently + (string) 0 >> (string) Front Porch Overhead Light level is currently 0
+406ms ║║Calculating (string) Front Porch Overhead Light level is currently 0 + (string) %
+406ms ║║ >> (string) Front Porch Overhead Light level is currently 0%
+410ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+410ms ║║ + (string) Garage Wall Lights level is currently Front Porch Overhead Light level is currently 0%
+410ms ║║ Garage Wall Lights level is currentlyb,
+414ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+414ms ║║ Garage Wall Lights level is currently Front Porch Overhead Light level is currently 0%
+414ms ║║ Garage Wall Lights level is currentlyb, Green
+417ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+418ms ║║ Garage Wall Lights level is currently >> (string) Front Porch Overhead Light level is currently 0%
+418ms ║║ Garage Wall Lights level is currently
+421ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+421ms ║║ Garage Wall Lights level is currently + (string) 0 >> (string) Front Porch Overhead Light level is currently 0%
+421ms ║║ Garage Wall Lights level is currently 0
+424ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+424ms ║║ Garage Wall Lights level is currently 0 + (string) %
+424ms ║║ >> (string) Front Porch Overhead Light level is currently 0%
+424ms ║║ Garage Wall Lights level is currently 0%
+426ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+427ms ║║ Garage Wall Lights level is currently 0%
+427ms ║║ + (string) Garage Wall Lights 2 level is currently Front Porch Overhead Light level is currently 0%
+427ms ║║ Garage Wall Lights level is currently 0%
+427ms ║║ Garage Wall Lights 2 level is currentlyb,
+429ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+429ms ║║ Garage Wall Lights level is currently 0%
+430ms ║║ Garage Wall Lights 2 level is currently Front Porch Overhead Light level is currently 0%
+430ms ║║ Garage Wall Lights level is currently 0%
+430ms ║║ Garage Wall Lights 2 level is currentlyb, Green
+432ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+432ms ║║ Garage Wall Lights level is currently 0%
+432ms ║║ Garage Wall Lights 2 level is currently >> (string) Front Porch Overhead Light level is currently 0%
+433ms ║║ Garage Wall Lights level is currently 0%
+433ms ║║ Garage Wall Lights 2 level is currently
+435ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+435ms ║║ Garage Wall Lights level is currently 0%
+435ms ║║ Garage Wall Lights 2 level is currently + (string) 0 >> (string) Front Porch Overhead Light level is currently 0%
+435ms ║║ Garage Wall Lights level is currently 0%
+435ms ║║ Garage Wall Lights 2 level is currently 0
+437ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+437ms ║║ Garage Wall Lights level is currently 0%
+437ms ║║ Garage Wall Lights 2 level is currently 0 + (string) % >> (string) Front Porch Overhead Light level is currently 0%
+437ms ║║ Garage Wall Lights level is currently 0%
+437ms ║║ Garage Wall Lights 2 level is currently 0%
+439ms ║║Executed virtual command setState (1ms)
+446ms ║║Calculating (string) 100 + (string) % >> (string) 100%
+450ms ║║Calculating (string) 100% + (string) 59 >> (string) 100% 59
+451ms ║║Calculating (string) 100% 59 + (string) ° >> (string) 100% 59°
+463ms ║║Calculating (string) Since + (string) 11/25 11:14 AM >> (string) Since 11/25 11:14 AM
+471ms ║║Calculating (enum) closed == (enum) closed >> (boolean) true
+474ms ║║Executed virtual command setTile (1ms)
+479ms ║║Comparison (string) null executes (integer) 1 = false (1ms)
+480ms ║║Condition #48 evaluated false (3ms)
+481ms ║║Condition group #45 evaluated false (state did not change) (4ms)
+485ms ║║Comparison (string) null executes (integer) 2 = false (1ms)
+486ms ║║Condition #52 evaluated false (3ms)
+487ms ║║Condition group #49 evaluated false (state did not change) (4ms)
+491ms ║║Comparison (string) null executes (integer) 3 = false (1ms)
+492ms ║║Condition #56 evaluated false (3ms)
+493ms ║║Condition group #53 evaluated false (state did not change) (4ms)
+495ms ║╚Execution stage complete. (299ms)
+504ms ╚Event processed successfully (504ms)
11/25/2017, 1:49:51 PM +796ms
+1ms ╔Received event [Garage Door Sensor].contact = closed with a delay of 142ms
+162ms ║RunTime Analysis CS > 12ms > PS > 37ms > PE > 113ms > CE
+170ms ║Runtime (57982 bytes) successfully initialized in 37ms (v0.2.0fe.20171109) (169ms)
+171ms ║╔Execution stage started
+180ms ║║Comparison (string) contact is (enum) closed = false (1ms)
+182ms ║║Condition #63 evaluated false (4ms)
+182ms ║║Condition group #60 evaluated false (state did not change) (5ms)
+184ms ║║Cancelling statement #16’s schedules…
+193ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+202ms ║║Calculating (string) 100 + (string) % >> (string) 100%
+205ms ║║Calculating (string) 0 + (string) % >> (string) 0%
+211ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+219ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+223ms ║║Executed virtual command setTile (1ms)
+233ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+242ms ║║Calculating (string) 100 + (string) % >> (string) 100%
+244ms ║║Calculating (string) 0 + (string) % >> (string) 0%
+249ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+257ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+260ms ║║Executed virtual command setTile (1ms)
+269ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+278ms ║║Calculating (string) 100 + (string) % >> (string) 100%
+280ms ║║Calculating (string) 0 + (string) % >> (string) 0%
+286ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+293ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+297ms ║║Executed virtual command setTile (1ms)
+306ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+315ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+324ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+333ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+342ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+351ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+357ms ║║Calculating (string) Front Porch Overhead Light level is currently Front Porch Overhead Light level is currentlyb, Green
+362ms ║║Calculating (string) Front Porch Overhead Light level is currently >> (string) Front Porch Overhead Light level is currently
+365ms ║║Calculating (string) Front Porch Overhead Light level is currently + (string) 0 >> (string) Front Porch Overhead Light level is currently 0
+369ms ║║Calculating (string) Front Porch Overhead Light level is currently 0 + (string) %
+369ms ║║ >> (string) Front Porch Overhead Light level is currently 0%
+373ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+373ms ║║ + (string) Garage Wall Lights level is currently Front Porch Overhead Light level is currently 0%
+373ms ║║ Garage Wall Lights level is currentlyb,
+376ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+376ms ║║ Garage Wall Lights level is currently Front Porch Overhead Light level is currently 0%
+376ms ║║ Garage Wall Lights level is currentlyb, Green
+380ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+380ms ║║ Garage Wall Lights level is currently >> (string) Front Porch Overhead Light level is currently 0%
+380ms ║║ Garage Wall Lights level is currently
+383ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+383ms ║║ Garage Wall Lights level is currently + (string) 0 >> (string) Front Porch Overhead Light level is currently 0%
+383ms ║║ Garage Wall Lights level is currently 0
+386ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+386ms ║║ Garage Wall Lights level is currently 0 + (string) %
+386ms ║║ >> (string) Front Porch Overhead Light level is currently 0%
+386ms ║║ Garage Wall Lights level is currently 0%
+388ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+389ms ║║ Garage Wall Lights level is currently 0%
+389ms ║║ + (string) Garage Wall Lights 2 level is currently Front Porch Overhead Light level is currently 0%
+389ms ║║ Garage Wall Lights level is currently 0%
+389ms ║║ Garage Wall Lights 2 level is currentlyb,
+391ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+391ms ║║ Garage Wall Lights level is currently 0%
+391ms ║║ Garage Wall Lights 2 level is currently Front Porch Overhead Light level is currently 0%
+391ms ║║ Garage Wall Lights level is currently 0%
+392ms ║║ Garage Wall Lights 2 level is currentlyb, Green
+394ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+394ms ║║ Garage Wall Lights level is currently 0%
+394ms ║║ Garage Wall Lights 2 level is currently >> (string) Front Porch Overhead Light level is currently 0%
+394ms ║║ Garage Wall Lights level is currently 0%
+394ms ║║ Garage Wall Lights 2 level is currently
+396ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+396ms ║║ Garage Wall Lights level is currently 0%
+396ms ║║ Garage Wall Lights 2 level is currently + (string) 0 >> (string) Front Porch Overhead Light level is currently 0%
+397ms ║║ Garage Wall Lights level is currently 0%
+397ms ║║ Garage Wall Lights 2 level is currently 0
+398ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+398ms ║║ Garage Wall Lights level is currently 0%
+399ms ║║ Garage Wall Lights 2 level is currently 0 + (string) % >> (string) Front Porch Overhead Light level is currently 0%
+399ms ║║ Garage Wall Lights level is currently 0%
+399ms ║║ Garage Wall Lights 2 level is currently 0%
+400ms ║║Executed virtual command setState (0ms)
+409ms ║║Calculating (string) 100 + (string) % >> (string) 100%
+413ms ║║Calculating (string) 100% + (string) 58 >> (string) 100% 58
+415ms ║║Calculating (string) 100% 58 + (string) ° >> (string) 100% 58°
+422ms ║║Calculating (string) Since + (string) 11/25 11:14 AM >> (string) Since 11/25 11:14 AM
+428ms ║║Calculating (enum) closed == (enum) closed >> (boolean) true
+432ms ║║Executed virtual command setTile (1ms)
+436ms ║║Comparison (string) null executes (integer) 1 = false (1ms)
+437ms ║║Condition #48 evaluated false (3ms)
+438ms ║║Condition group #45 evaluated false (state did not change) (4ms)
+442ms ║║Comparison (string) null executes (integer) 2 = false (1ms)
+443ms ║║Condition #52 evaluated false (3ms)
+444ms ║║Condition group #49 evaluated false (state did not change) (4ms)
+448ms ║║Comparison (string) null executes (integer) 3 = false (1ms)
+449ms ║║Condition #56 evaluated false (3ms)
+450ms ║║Condition group #53 evaluated false (state did not change) (4ms)
+452ms ║╚Execution stage complete. (280ms)
+459ms ╚Event processed successfully (459ms)
11/25/2017, 1:49:08 PM +995ms
+1ms ╔Received event [Garage Door Sensor].temperature = 58 with a delay of 561ms
+184ms ║RunTime Analysis CS > 16ms > PS > 51ms > PE > 117ms > CE
+192ms ║Runtime (57976 bytes) successfully initialized in 51ms (v0.2.0fe.20171109) (190ms)
+193ms ║╔Execution stage started
+207ms ║║Comparison (string) temperature is (enum) open = false (1ms)
+208ms ║║Condition #63 evaluated false (7ms)
+209ms ║║Condition group #60 evaluated false (state did not change) (8ms)
+211ms ║║Cancelling statement #16’s schedules…
+220ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+228ms ║║Calculating (string) 100 + (string) % >> (string) 100%
+230ms ║║Calculating (string) 0 + (string) % >> (string) 0%
+236ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+244ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+248ms ║║Executed virtual command setTile (1ms)
+258ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+266ms ║║Calculating (string) 100 + (string) % >> (string) 100%
+269ms ║║Calculating (string) 0 + (string) % >> (string) 0%
+274ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+283ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+287ms ║║Executed virtual command setTile (1ms)
+297ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+306ms ║║Calculating (string) 100 + (string) % >> (string) 100%
+308ms ║║Calculating (string) 0 + (string) % >> (string) 0%
+312ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+321ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+325ms ║║Executed virtual command setTile (2ms)
+335ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+342ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+352ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+360ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+369ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+377ms ║║Calculating (enum) off == (enum) on >> (boolean) false
+383ms ║║Calculating (string) Front Porch Overhead Light level is currently Front Porch Overhead Light level is currentlyb, Green
+388ms ║║Calculating (string) Front Porch Overhead Light level is currently >> (string) Front Porch Overhead Light level is currently
+392ms ║║Calculating (string) Front Porch Overhead Light level is currently + (string) 0 >> (string) Front Porch Overhead Light level is currently 0
+395ms ║║Calculating (string) Front Porch Overhead Light level is currently 0 + (string) %
+396ms ║║ >> (string) Front Porch Overhead Light level is currently 0%
+411ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+411ms ║║ + (string) Garage Wall Lights level is currently Front Porch Overhead Light level is currently 0%
+411ms ║║ Garage Wall Lights level is currentlyb,
+415ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+415ms ║║ Garage Wall Lights level is currently Front Porch Overhead Light level is currently 0%
+415ms ║║ Garage Wall Lights level is currentlyb, Green
+419ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+419ms ║║ Garage Wall Lights level is currently >> (string) Front Porch Overhead Light level is currently 0%
+419ms ║║ Garage Wall Lights level is currently
+422ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+422ms ║║ Garage Wall Lights level is currently + (string) 0 >> (string) Front Porch Overhead Light level is currently 0%
+422ms ║║ Garage Wall Lights level is currently 0
+425ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+425ms ║║ Garage Wall Lights level is currently 0 + (string) %
+425ms ║║ >> (string) Front Porch Overhead Light level is currently 0%
+425ms ║║ Garage Wall Lights level is currently 0%
+428ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+428ms ║║ Garage Wall Lights level is currently 0%
+428ms ║║ + (string) Garage Wall Lights 2 level is currently Front Porch Overhead Light level is currently 0%
+428ms ║║ Garage Wall Lights level is currently 0%
+428ms ║║ Garage Wall Lights 2 level is currentlyb,
+431ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+431ms ║║ Garage Wall Lights level is currently 0%
+431ms ║║ Garage Wall Lights 2 level is currently Front Porch Overhead Light level is currently 0%
+431ms ║║ Garage Wall Lights level is currently 0%
+431ms ║║ Garage Wall Lights 2 level is currentlyb, Green
+434ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+434ms ║║ Garage Wall Lights level is currently 0%
+434ms ║║ Garage Wall Lights 2 level is currently >> (string) Front Porch Overhead Light level is currently 0%
+434ms ║║ Garage Wall Lights level is currently 0%
+434ms ║║ Garage Wall Lights 2 level is currently
+436ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+436ms ║║ Garage Wall Lights level is currently 0%
+436ms ║║ Garage Wall Lights 2 level is currently + (string) 0 >> (string) Front Porch Overhead Light level is currently 0%
+436ms ║║ Garage Wall Lights level is currently 0%
+436ms ║║ Garage Wall Lights 2 level is currently 0
+438ms ║║Calculating (string) Front Porch Overhead Light level is currently 0%
+438ms ║║ Garage Wall Lights level is currently 0%
+438ms ║║ Garage Wall Lights 2 level is currently 0 + (string) % >> (string) Front Porch Overhead Light level is currently 0%
+438ms ║║ Garage Wall Lights level is currently 0%
+438ms ║║ Garage Wall Lights 2 level is currently 0%
+440ms ║║Executed virtual command setState (0ms)
+447ms ║║Calculating (string) 100 + (string) % >> (string) 100%
+451ms ║║Calculating (string) 100% + (string) 58 >> (string) 100% 58
+452ms ║║Calculating (string) 100% 58 + (string) ° >> (string) 100% 58°
+461ms ║║Calculating (string) Since + (string) 11/25 11:14 AM >> (string) Since 11/25 11:14 AM
+468ms ║║Calculating (enum) open == (enum) closed >> (boolean) false
+472ms ║║Executed virtual command setTile (1ms)
+477ms ║║Comparison (string) null executes (integer) 1 = false (2ms)
+478ms ║║Condition #48 evaluated false (4ms)
+478ms ║║Condition group #45 evaluated false (state did not change) (4ms)
+483ms ║║Comparison (string) null executes (integer) 2 = false (1ms)
+484ms ║║Condition #52 evaluated false (4ms)
+485ms ║║Condition group #49 evaluated false (state did not change) (4ms)
+489ms ║║Comparison (string) null executes (integer) 3 = false (1ms)
+490ms ║║Condition #56 evaluated false (4ms)
+491ms ║║Condition group #53 evaluated false (state did not change) (4ms)
+492ms ║╚Execution stage complete. (299ms)
+504ms ╚Event processed successfully (504ms)


#5

Ugh, I think I just figured it out. The $currentEventAttribute is ‘contact’. But selecting the physical device [Contact Sensor : Contact] actually gives its value… ‘closed’ instead. It’s looking for ‘contact’ which I’ll just have to put in as a string to make this work.

Is there a way you know if to select an attribute from a list or is it best just to go with manually typing out the string?


#6

Maybe it’s the device handler giving out the wrong info (Contact vs contact), probably just go with manually typing it unless you’re comfortable digging into device handler code :slight_smile: