Creating Tile Issue


#1

1) Give a description of the problem
I used a previous piston import (fh5r), and updated the device to just one to see if I could get it to work. It always comes back with an error: An error occurred while executing the event: java.lang.NullPointerException: Cannot invoke method hasCommand() on null object

2) What is the expected behaviour?
To run without the error

3) What is happening/not happening?
It is creating the error: An error occurred while executing the event: java.lang.NullPointerException: Cannot invoke method hasCommand() on null object

4) Post a Green Snapshot of the piston![image|45x37](upload://xK8WwMCzoDkDrcB1

Jf27yjtZ9bq.png)

5) Attach logs after turning logging level to Full
1/20/2021, 9:43:30 AM +156ms
+0ms ╔Received event [My home].test = 1611153810155 with a delay of 0ms
+62ms ║RunTime Analysis CS > 22ms > PS > 6ms > PE > 35ms > CE
+65ms ║Runtime (54314 bytes) successfully initialized in 6ms (v0.3.110.20191009) (64ms)
+67ms ║╔Execution stage started
+73ms ║║Cancelling statement #206’s schedules…
+89ms ║║Calculating (decimal) 1.611153810155E12 - (decimal) 1.0 >> (decimal) 1.611153810154E12
+699ms ║║__An error occurred while executing the event: java.lang.NullPointerException: Cannot invoke method hasCommand() on null object__
+710ms ║╚Execution stage complete. (643ms)
+723ms ║Setting up scheduled job for Wed, Jan 20 2021 @ 9:45:41 AM EST (in 130.622s)
+731ms ╚Event processed successfully (731ms)
1/20/2021, 9:35:48 AM +247ms
+780ms ║**An error occurred while executing the event: java.lang.NullPointerException: Cannot invoke method hasCommand() on null object**


#2

When you press TEST, only the WITH statement (lines 57-61) will be executed. The events and timers will only happen when the triggering event or time occurs.

As a result ‘tilePressDeviceID’ has no assigned value at the time the test button is pressed and the piston executes, so the piston throws an error trying to toggle a non-existent device.

Looking at the piston, I don’t see how lines 57-61 will ever be executed as I believe the On Event and Timer actions will only run the code within their respective blocks. This wasn’t always the case with On Event, as I recall, but it seems to me it’s been that way for a couple of years now.


#3

Is there a way to make this work or is Tiles just a thing of the past then?


#4

Looking at it again, I realize that lines 57-61 will be executed when you click on the tile. But the TEST will still produce an error every time.

My question is, do you have a tile on the dashboard? If not, one should be generated when you manually toggle one of the power switches for the first time after saving the piston. Once the tile appears, you should be able to click on it and see if the piston works as expected.