Import and restore Apps Bugs [Fixed]

I tried backup/restore/import apps the first time. I tried on both my RM 5.0/5.1 rules app, and on my dashboards. The IMPORT function appears to be broken (under I was able to use RESTORE method, however it initially gave me a javascript error which flashed too quickly to read.

Details Follow:

When I try to import rules to a new hub, the import function gets stuck at the point where you map the rule to existing devices. The screen flickers as the upper right gear icon appears and disappears. Trying to click on any of the mapping boxes, cancel, etc has no effect. I can click back into either the apps or settings main page, then back into the export/import page, where it takes me back to the last step prior to import (with the file selected) where I can cancel out of the import function. One time it took be back to the flickering page, but then clicking out and back in a second time took care of it.

RESTORE was generating a java script error, but it was disappearing from the screen before I could read it. A very carefully timed screenshot allowed me to read it and recognize that it was trying to load a custom device driver that wasn't on my new hub. I had already re-created the virtual switches and hub variables contained within my rules. I added the custom device code, then the rules restored fine, however each rule/restore function duplicated all the devices contained within the rules, including a custom device I wasn't using in the rule. I later found that the custom device was left over in some conditions in the rule set that I was no longer actually using. Cleaning up (deleting) those conditions I presume would fix that problem, but I never went back to try another restore due to the device duplication. That happened every time I restored the rules, which I did one at a time to ensure it didn't lock up or crash my hub.

I was able to go in and remove the duplicated devices, but I had to ensure the rules were all mapped to the same instance of the virtual device I was using. In one case, an actual device was used, the rules created multiple instances of the z-wave device with the device type name. Again, I was able to delete/remove these duplicated devices and map the rule to my actual device.

In each case, using the "in use by" at the bottom of the device page helped me recreate the mapping, but I had to find each instance of the device usage in the rule and ensure they were all mapped the same. Even though the devices were all duplicated, the order they appeared in the device list helped me ensure they were all mapped the same.

Not what you are supposed to use RESTORE for, but it helped me work around the previous issue.

These issues acted exactly the same whether I was restoring RM rules, or restoreing dashboards. From what I can tell it appears to be a problem with the app IMPORT function, and a non-standard implementation of using the RESTORE function. Even with RESTORE, my thought is ideally RESTORE should NOT create multiple instances of devices, but rather create a device only if one doesn't already exist. Recognize that is not as easy in implementation.

Good news is that through all of this the hub never locked up and required a reset, and the app rules themselves never became broken to the point that I had to delete and start over. Just took some extra time to clean everything up and get all the mapping straight.

Before you do anything update to .142


I just updated to .143 on a different hub, same result on import that I saw on .140 on the first hub. The screen flickers as gear icon in the top right appears/disappears, at the point where you map the rule to each device/etc. None of the buttons work and take me to a location to actually map anything. They change color as the mouse hovers over them as I try to click, but unable to click into them.

I only tried the import, didn't run through the restore work-around that I did on my other hub.

What browser are you using?

Safari. I can also try Chrome, hadn't thought of that.

Yeah try chrome or ff

I tried Chrome. When I loaded and selected the individual rules, it went right to loading then gave me an error. It didn't go the the import/restore page like normal or bring up the device mapping page. Then it came back with an error. It's possible I inadvertently clicked through something, it appears to have restored the apps and added the devices associated with the apps.

I then loaded a dashboard through IMPORT, it had the same result as safari, flashing screen at the mapping page. however in this case I could see an error intermixed with the device mapping screen.

UPDATE - I figured out that I hit RESTORE vice IMPORT when I first tried the RM app import through Chrome. I went through the IMPORT function in Chrome and it had the same results as Safari.

However - I have a file with 4 saved rules. I did find that one of those rules performs as expected on the import, it allows me to map devices and imports as a duplicate rule with IMPORT added to the end of the name. The other three rules each produce the same error.

Go to settings, do a backup of your current database to your PC. Then do a soft reset then restore the database you backed up to your pc and see if that helps. I mean this really sounds like a corruption issue.

1 Like

Certainly I'll try it and let you know. I'm not sure it's a corruption issue only because I've tried it with two separate source files (from two separate hubs). In both hub import cases, I've tried both RM 5.1 app and dashboard app imports. The two hubs are running completely different rules and devices, and each give the same results. The only thing which may be a corruption related issue is if I carried the corruption from hub 1 to hub 3 through my process below. Also unsure if it's an issue with starting from an initial C-5 source moving to a C-7.

Here's the path:

1 - Developed the RM rules and dashboard on a C-5 (hub 1). Once complete and fully working, backed up full set of RM rules and dashboards (checked all boxes in both cases).

2 - First tried importing to a C-7 (hub 2), no luck, went the restore path. Deleted extra devices, cleaned up rules to remove old conditionals (including custom device detailed above),

3 - Once hub 2 was up and operational, created backup (from C-7 Hub 2) of 4 RM rules and the single dashboard associated with my routine (the 'cleaned' versions as noted above).

4 - tried import to C-7 (hub 3) with same results as seen on hub 2 import/restore. Did restore on all 4 apps (import same time) vice import by mistake 1st time through. All 4 imported with final result as the screen-shot fault listed in the earlier post. Went back and tried import on individual apps with same result except 1 of the 4 RM rule apps allowed me to map on import. Dashboard app import had same results.

Tried step 4 using both Safari and Chrome with virtually identical results. No other browser related issues found elsewhere on any hub management related page elsewhere with either S or C browser (primarily use S).

Hub DB backup / soft reset / restore has same result. In the process I noticed the single rule that was actually importing yesterday evening (allowed me to map devices) isn't importing now.

1 Like

Problem is fixed in .146.


Doesn't work for me. I have firmware and when I go to add a custom app (.groovy file... and I've tried many different ones) I get the following error upon import:

Unexpected Error

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

Error: Lexing failed on line: 1, column: 1, while reading '/', no possible valid JSON value or punctuation could be recognized.

Welcome to the Hubitat forums!

Are you trying to add an app via importing into the Apps tab, OR are you trying to import via the Apps Code tab?

It looks to me like you are importing using the wrong function or place here.

Well yes indeed that was the problem. #boneheadmove Thanks