Is there a way to view the device values saved using "capture attributes"


#1

1) Give a description of the problem
I am debugging a piston and need to see the attributes associated with a device as they’re saved (specifically, level and switch state). I capture this info to a variable but cannot figure out how look at the actual values. If I text the variable to myself, the value is always “Empty device list.” Is there a way to see what values are being captured?

2) What is the expected behavior?
Lights are off. Piston runs, captures state (which is off), turns lights on waits 2 minutes and then restores state, which should be off. Log shows piston restoring lights to 100%, not 0%. I need view the values the piston is grabbing when it runs.

3) What is happening/not happening?
Device state doesn’t appear to be being restored properly. I want to see what values are being captured so I know what should be restored.

**4) Post a Green Snapshot of the piston![image|45x37]

**5) Attach any logs
I’ve bolded the area in the log where I set the variable. It’s those values that I want to expose and look at.

9/25/2018, 12:44:51 PM +992ms
+0ms ╔Received event [Home].execute = :32cb8712b15ef6863581585ad4206678: with a delay of 135ms
+127ms ║RunTime Analysis CS > 26ms > PS > 58ms > PE > 44ms > CE
+130ms ║Runtime (41610 bytes) successfully initialized in 58ms (v0.3.108.20180906) (129ms)
+131ms ║╔Execution stage started
+138ms ║║Cancelling statement #16’s schedules…
+191ms ║║Executed physical command [null].speak([Motion detected on the patio. Alarm has been activated and all cameras are now recording.]) (46ms)
+192ms ║║Executed [LANnoucer].speak (49ms)
+196ms ║║Cancelling statement #1’s schedules…
+211ms ║║Executed virtual command [Patio Lights].saveStateLocally (7ms)
+216ms ║║Executed virtual command [Patio Lights].setVariable (1ms)
+220ms ║║Executed virtual command [Patio Lights].wait (1ms)
+221ms ║║Waiting for 200ms
+562ms ║║Executed physical command [Patio Lights].setLevel([100]) (135ms)
+563ms ║║Executed [Patio Lights].setLevel (138ms)
+567ms ║║Executed virtual command [Patio Lights].wait (0ms)
+569ms ║║Requesting a wake up for Tue, Sep 25 2018 @ 12:46:52 PM MDT (in 120.0s)
+574ms ║╚Execution stage complete. (443ms)
+576ms ║Setting up scheduled job for Tue, Sep 25 2018 @ 12:46:52 PM MDT (in 119.995s)
+584ms ╚Event processed successfully (584ms)

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


#2

I don’t think webcore exposes that to us so I’d probably try the long way around by logging [deviceName: attribute] during the capture and restore.


#3

Thanks @eibyer. That seems like a good approach. Unfortunately, I get an error when I try to log the values. I’m not sure if it’s something wrong in the way I’ve used the log statement or something else.

Does anyone have any ideas what I’m doing wrong and how I can log the values I need to look at?

Log w/ errors:

/25/2018, 2:12:28 PM +163ms
+0ms ╔Received event [Home].execute = :32cb8712b15ef6863581585ad4206678: with a delay of 93ms
+115ms ║RunTime Analysis CS > 22ms > PS > 47ms > PE > 47ms > CE
+118ms ║Runtime (44928 bytes) successfully initialized in 47ms (v0.3.108.20180906) (117ms)
+119ms ║╔Execution stage started
+126ms ║║Cancelling statement #16’s schedules…
+176ms ║║Executed physical command [null].speak([Motion detected on the patio. Alarm has been activated and all cameras are now recording.]) (44ms)
+177ms ║║Executed [LANnoucer].speak (46ms)
+180ms ║║Cancelling statement #1’s schedules…
+197ms ║║Executed virtual command [Patio Lights].saveStateLocally (9ms)
+326ms ║║null
+328ms ║║Error executing virtual command [Patio Lights].log: (3ms) groovy.lang.MissingMethodException: No signature of method: physicalgraph.sandbox.TruncatingLoggingListener.empty device list() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, null) values: [║║ null, null]
+346ms ║║null
+347ms ║║Error executing virtual command [Patio Lights].log: (2ms) groovy.lang.MissingMethodException: No signature of method: physicalgraph.sandbox.TruncatingLoggingListener.empty device list() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, null) values: [║║ null, null]
+359ms ║║SWITCH AND LEVEL WERE JUST CAPTURED:
+361ms ║║Executed virtual command [Patio Lights].log (2ms)
+366ms ║║Executed virtual command [Patio Lights].setVariable (1ms)
+370ms ║║Executed virtual command [Patio Lights].wait (1ms)
+372ms ║║Waiting for 200ms
+579ms ║║Empty device list
+581ms ║║Error executing virtual command [Patio Lights].log: (2ms) groovy.lang.MissingMethodException: No signature of method: physicalgraph.sandbox.TruncatingLoggingListener.empty device list() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, null) values: [║║ Empty device list, null]
+728ms ║║Executed physical command [Patio Lights].setLevel([100]) (140ms)
+732ms ║║Executed [Patio Lights].setLevel (143ms)
+736ms ║║Executed virtual command [Patio Lights].wait (1ms)
+738ms ║║Requesting a wake up for Tue, Sep 25 2018 @ 2:14:28 PM MDT (in 120.0s)
+743ms ║╚Execution stage complete. (623ms)
+745ms ║Setting up scheduled job for Tue, Sep 25 2018 @ 2:14:28 PM MDT (in 119.995s)
+753ms ╚Event processed successfully (754ms)
9/25/2018, 2:12:23 PM +192ms
+1ms ╔Received event [Home].time = 1537906344579 with a delay of -1388ms
+161ms ║RunTime Analysis CS > 24ms > PS > 63ms > PE > 74ms > CE
+164ms ║Runtime (44908 bytes) successfully initialized in 63ms (v0.3.108.20180906) (162ms)
+166ms ║╔Execution stage started
+423ms ║║null
+424ms ║║Error executing virtual command [Patio Lights].log: (2ms) groovy.lang.MissingMethodException: No signature of method: physicalgraph.sandbox.TruncatingLoggingListener.empty device list() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, null) values: [║║ null, null]
+443ms ║║null
+445ms ║║Error executing virtual command [Patio Lights].log: (3ms) groovy.lang.MissingMethodException: No signature of method: physicalgraph.sandbox.TruncatingLoggingListener.empty device list() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, null) values: [║║ null, null]
+456ms ║║SWITCH AND LEVEL TO BE RESTORED:
+457ms ║║Executed virtual command [Patio Lights].log (2ms)
+478ms ║║Restoring attribute ‘level’ to value ‘100’ using command setLevel(100)
+486ms ║║Skipped execution of physical command [Patio Lights].setLevel([100]) because it would make no change to the device. (7ms)
+490ms ║║Restoring attribute ‘switch’ to value ‘off’ using command off()
+1490ms ║║Executed physical command [Patio Lights].off() (999ms)
+1492ms ║║Executed virtual command [Patio Lights].loadStateLocally (1029ms)
+1496ms ║║Executed virtual command [Patio Lights].wait (1ms)
+1497ms ║║Waiting for 3000ms
+4503ms ║║Executed virtual command [Patio Lights].setVariable (2ms)
+4506ms ║╚Execution stage complete. (4340ms)
+4507ms ╚Event processed successfully (4507ms)

And the updated piston with logging:


#4

Only need one colon in the [deviceName: attribute]


#5

I deleted all but one log statement and removed the second colon from the remaining log statement. I’m still getting the error. When I open the task, I can see things are evaluating properly (the switch was off when I ran the piston) but I get an error when the piston runs.

Here’s the error:

||+551ms|║║Executed [LANnoucer].speak (441ms)|
|—|---|
|+554ms|║║Cancelling statement #1’s schedules…|
|+568ms|║║Executed virtual command [Patio Lights].saveStateLocally (7ms)|
|+578ms|║║Level:|
|+580ms|║║Error executing virtual command [Patio Lights].log: (3ms) groovy.lang.MissingMethodException: No signature of method: physicalgraph.sandbox.TruncatingLoggingListener.off() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, null) values: [║║ Level:, null] Possible solutions: any(), notify(), wait(), find(), grep(), dump()|
|+589ms|║║Executed virtual command [Patio Lights].setVariable (2ms)|
|+593ms|║║Executed virtual command [Patio Lights].wait (1ms)|
|+595ms|║║Waiting for 200ms|

Any suggestions are appreciated.


#6

Ooh, under Log type, leave it as info, use Expression instead of Value for the next field.


#7

That was it. Thank you.