"Unexpected error" and locked out of Hub Variables

I was trying to follow another thread and created two variables for Sunrise and Sunset (type=variable-time). I created a rule to set the variables but became locked out of the Settings>Hub Variables page, which now displays the message

Unexpected Error

An unexpected error has occurred trying to load the app. Check Logs for more information.

Error: Cannot get property 'type' on null object

The log entry is as follows:
app696 (time/date) ERROR: java.lang.NullPointerException: Cannot get property 'type' on null object on line 168 (method hubVar)

I've deleted the child instance of the rule, but am still locked out of the variables page so can't remove the errant variables.

Any thoughts please?
Andy.

See if you can add the variable to a dashboard, then create a tile for the variable and give it a valid value.

In the Apps>Dashboard config I can add the variables to make them available, but on the dashboard I can't find them in the device list in order to add them on a tile.

Change the Tile Type to Variable

Oops ;-), yes, now I can add a tile! Still locked out of the variables page, though.

What are you trying to set the time to?

I wish to display the sunrise and sunset times on the dashboard, so wanted to set the variables to those times.

For now, to get your variable page back, let's try and set the time to 12:00 AM

As in the hub time or the variables? (Thanks for helping. I need to go do something but will be back in 30 minutes).

Using the Dashboard tile, set the variable to 12:00 AM

Is now set to 00:00 on the 18th (the date is displayed too).

You must have your hub time format set 24Hr mode, and be using a dateTime variable instead of just time. Regardless the variable should now contain a valid date and time if you saved it, and that should allow you to use the hub variable page again.

Sadly not. I'm still getting the error. I was in 24 hour mode and using a DateTime variable (I didn;t see a Time only option). Interestingly I tried changing the hub to 12hr mode and the "SunRise" variable tile displayed "invalid time" whilst the SunSet variable tile continued to show 00:00 in 24hr time.

Sounds like the SunRise variable is your issue then. Try putting the hub back into 12Hr mode and then resetting the time portion of the variable using the drop downs.

No joy. I've put the hub in 12hr mode, rebooted for good luck. Both variables are now visible but they only have adjustment using 24hr format (0-23). Resaved them to 00:00 again and saved, but still have the error.

@bravenel I'm afraid I've forgotten the way out of this one, any guidance?

Realistically, only way out of this is to restore a backup from before Hub Variables got trashed.

I've done a restore from the previous night and the fault problem has cleared. Thank you both.

1 Like