Error in Logs on Tile Piston


#1

I’m getting this error in logs in reference to the hasCommand in the webCoRE Piston Smartapp, not sure if this is an issue or not since I’m not seeing any issues from this error but wanted to report it just incase.

I also posted this here:

ce984a2b-a2ae-4b9d-96c3-c44e803a769e 9:35:08 PM: trace ║║ Executed virtual command setVariable (4ms)
ce984a2b-a2ae-4b9d-96c3-c44e803a769e 9:35:08 PM: debug ║║ Calculating (integer) 1 + (integer) 1 >> (integer) 2
ce984a2b-a2ae-4b9d-96c3-c44e803a769e 9:35:08 PM: debug ║║ Calculating (integer) 2 - (integer) 1 >> (integer) 1
ce984a2b-a2ae-4b9d-96c3-c44e803a769e 9:35:08 PM: debug ║║ Calculating (integer) 2 - (integer) 1 >> (integer) 1
ce984a2b-a2ae-4b9d-96c3-c44e803a769e 9:35:08 PM: debug ║║ Calculating (string) 65% + (string) 5376 >> (string) 65% 5376
ce984a2b-a2ae-4b9d-96c3-c44e803a769e 9:35:03 PM: error ║║ An error occurred while executing the event: java.lang.NullPointerException: Cannot invoke method hasCommand() on null object @ line 1579
ce984a2b-a2ae-4b9d-96c3-c44e803a769e 9:35:03 PM: debug ║║ Calculating (string) 25 + (string) % >> (string) 25%
ce984a2b-a2ae-4b9d-96c3-c44e803a769e 9:35:03 PM: debug ║║ Calculating (string) 25% + (string) 0 >> (string) 25% 0
ce984a2b-a2ae-4b9d-96c3-c44e803a769e 9:35:03 PM: debug ║║ Calculating (string) 25 + (string) % >> (string) 25%
ce984a2b-a2ae-4b9d-96c3-c44e803a769e 9:35:03 PM: debug ║║ Calculating (integer) 2 + (integer) 1 >> (integer) 3
ce984a2b-a2ae-4b9d-96c3-c44e803a769e 9:35:03 PM: debug ║║ Cancelling statement #119’s schedules…
ce984a2b-a2ae-4b9d-96c3-c44e803a769e 9:35:03 PM: debug ║║ Cancelling statement #206’s schedules…
ce984a2b-a2ae-4b9d-96c3-c44e803a769e 9:35:03 PM: trace ║║ Executed virtual command setTile (2ms)

Here’s the Piston I’m getting this error on:


Device Status Tiles
Device Status Tiles
#2

I never got a reply on this one, this error still occurs for me but the piston seems to work fine. Not sure if this is something I’m doing wrong or if there’s a bug in webCoRE.

Logs:
10/12/2017, 7:26:40 PM +900ms
+1ms ╔Received event [Living Room Lamp].level = 0 with a delay of 357ms
+540ms ║RunTime Analysis CS > 38ms > PS > 373ms > PE > 129ms > CE
+552ms ║Piston waited at a semaphore for 287ms
+554ms ║Runtime (48403 bytes) successfully initialized in 373ms (v0.2.0fa.20171011) (552ms)
+555ms ║╔Execution stage started
+566ms ║║Cancelling statement #91’s schedules…
+577ms ║║Calculating (string) on == (string) on >> (boolean) true
+581ms ║║Executed virtual command setVariable (2ms)
+592ms ║║Calculating (integer) 2 + (integer) 1 >> (integer) 3
+596ms ║║Executed virtual command setVariable (2ms)
+603ms ║║Calculating (integer) 3 - (integer) 1 >> (integer) 2
+608ms ║║Executed virtual command setVariable (2ms)
+616ms ║║Calculating (integer) 3 - (integer) 1 >> (integer) 2
+621ms ║║Executed virtual command setVariable (2ms)
+624ms ║║Executed virtual command wait (0ms)
+625ms ║║Requesting a wake up for Thu, Oct 12 2017 @ 7:26:45 PM EDT (in 4.0s)
+629ms ║║Cancelling statement #206’s schedules…
+637ms ║║Calculating (decimal) 0.0 - (decimal) 1.0 >> (decimal) -1.0
+963ms ║║An error occurred while executing the event: java.lang.NullPointerException: Cannot invoke method hasCommand() on null object
+965ms ║╚Execution stage complete. (410ms)
+967ms ║Setting up scheduled job for Thu, Oct 12 2017 @ 7:26:45 PM EDT (in 3.659s)
+986ms ╚Event processed successfully (986ms)
10/12/2017, 7:26:40 PM +221ms
+1ms ╔Received event [Living Room Lamp].switch = on with a delay of 148ms
+226ms ║RunTime Analysis CS > 39ms > PS > 91ms > PE > 97ms > CE
+242ms ║Runtime (48337 bytes) successfully initialized in 91ms (v0.2.0fa.20171011) (241ms)
+243ms ║╔Execution stage started
+252ms ║║Cancelling statement #91’s schedules…
+261ms ║║Calculating (string) on == (string) on >> (boolean) true
+267ms ║║Executed virtual command setVariable (3ms)
+279ms ║║Calculating (integer) 2 + (integer) 1 >> (integer) 3
+282ms ║║Executed virtual command setVariable (2ms)
+290ms ║║Calculating (integer) 3 - (integer) 1 >> (integer) 2
+294ms ║║Executed virtual command setVariable (2ms)
+304ms ║║Calculating (integer) 3 - (integer) 1 >> (integer) 2
+308ms ║║Executed virtual command setVariable (3ms)
+311ms ║║Executed virtual command wait (0ms)
+312ms ║║Requesting a wake up for Thu, Oct 12 2017 @ 7:26:44 PM EDT (in 4.0s)
+316ms ║║Cancelling statement #206’s schedules…
+324ms ║║Calculating (decimal) 0.0 - (decimal) 1.0 >> (decimal) -1.0
+782ms ║║An error occurred while executing the event: java.lang.NullPointerException: Cannot invoke method hasCommand() on null object
+785ms ║╚Execution stage complete. (543ms)
+786ms ║Setting up scheduled job for Thu, Oct 12 2017 @ 7:26:44 PM EDT (in 3.528s)
+803ms ╚Event processed successfully (803ms)

Piston:


#3

Found the line in IDE that is causing the error:
An error occurred while executing the event: java.lang.NullPointerException: Cannot invoke method hasCommand() on null object @ line 1602


Device Status Tiles
#4

Yep i’m seeing this error on multiple pistons aswell…


#5

I’m still getting this error too.


Device Status Tiles
#6

I am getting same error. Any cause/remedy found?


#7

Going back to the original post, the problem was that a toggle command was being issued on a null device name. The device variable was defined by an expression that used ‘$currentEventValue - 1’ as an array index. As ‘$currentEventValue’ was ‘0’ and ‘on’ in the two examples in the logs, the indexed value didn’t exist. I suspect that ‘$currentEventValue’ should have been ‘tile’ as that was calculated earlier.

The ‘hasCommand()’ method does what it sounds like. You’ve asked to issue a command to a device and the piston is checking the device has that command. The error is because the ‘device’ is actually a null value.