How to Fix Error When Opening Hub Variables
If you see "Unexpected Error" when opening Hub Variables from Settings, try this fix.
How to Fix Error When Opening Hub Variables
Rarely, some users may encounter an error like the following when opening the Settings > Hub Variables page:
Unexpected Error
An unexpected error has occurred trying to load the app. Check Logs for more information.
Error: Cannot get property 'id' on null object
This issue can be fixed by following the steps below.
-
When opening the Hub Variables page that throws the error, note the URL in your web browser. It should appear similar to:
http://your-hub-ip/installedapp/configure/xxxx/hubVar,
wherexxxxwill be some number unique to your hub. Note this number. -
Manually change the URL to this format, substituting for
xxxxthe number noted above:
http://your-hub-ip/installedapp/status/xxxx
(i.e., changeconfiguretostatusand remove/hubVar) -
Select Remove Hub Variables (in the bottom right).
-
Try accessing Settings > Hub Variables again. The above steps should have resolved your problem.
Notes
Use caution when peforming the above steps if you have any hub variable connectors created. Removing the Hub Variables app will remove connectors as well.
If you have any hub variable connectors created, performing the above steps will also remove the connectors. If these connector devices are in use by any apps, use the following steps to avoid problems:
- Create a new (temporary) virtual device of an appropriate type for each connector in use.
- Swap this new virtual device out for the connector device in all apps.
- Perform the above steps to fix Hub Variables access.
- Re-create any previous hub variable connectors.
- Swap out the temporary virtual device created in step 1 with the new hub variable connector.
Whenever possible, we suggest using hub variables directly in apps (this is now supported by many apps, including Hubitat® Dashboard, Rule Machine, and many others). See the Hub Variables documentation for more. This will avoid the need to deal with variable connectors.
For additional assistance, we suggest visiting https://community.hubitat.com.