genielabs / HomeGenie

HomeGenie, the programmable automation intelligence
https://homegenie.it
GNU General Public License v3.0
387 stars 154 forks source link

[BUG] Restore from back up #458

Closed tuicemen closed 1 year ago

tuicemen commented 1 year ago

Version Both net versions of 1.4.0-beta.17 on a Raspberrypi

Describe the bug Restores only partialy work Installing a restore adds devices to the Dashboards but the actual user created programs don't get added. If you re-add the programs by importing them they are assigned the wrong wigets. There is no way to change to the correct widget from dropdown list on description screen of the program.

Code to Reproduce In stall a fresh HG beta.17 use the option to restore from backup that has some custom programs ) (More then 1) I used one from beta.15 but believe one from 1.3.19 stable will do the same.

Expected behavior A restore should restore all programs to the programs section as well as the Dashboards.

Screenshots/Stacktrace If applicable, add screenshots/stacktrace Will see about adding a sample screen shot later today.

Additional context

Editing a restored program should be possible without having to re importing it.

tuicemen commented 1 year ago

just tested installing a back up from 1.3-stable.19 on 1.4.0-beta.19 and I'm still having issues. This time no dashboard displays HG says none configured. Also if I go into programs I can see some programs but not all and the issue with the ones seen are still the same ProgramMess Note: modules says Arm Home (not correct as that would be a simple button press module) All the info displayed for that module are also incorrect (not related to the Arm Home or DuckDns status widgets) and no way to change to corect module The Arm Home program doesn't even display in the programs page to delete it

genemars commented 1 year ago

I guess these programs are using a custom widget. Were you able to import them in some other way? Mapping the custom widget to the "status" or sensor widget should fix the problem. Maybe I will make all custom widgets to be mapped automatically to the status/sensor widget. Can you send me the programs.xml file contained in the backup zip? Or maybe just one of these programs exported to hgx, since you said they are all the same.

tuicemen commented 1 year ago

I can convert most custom widget to use the HG status however some like my ecobee widget is completely custom I think if custom widgets were mapped to status/sensor widgets that would solve the issue for most. Then maybe we could make work with the custom widget code you added with the video module. I have some custom widgets that wouldn't map correctly to those though like my ecobee thermostat module https://forums.x10.com/index.php?topic=31467.0 (hgx file is downloadable from there)

genemars commented 1 year ago

I can't see the hgx file in the page you linked. I guess I have to register. Would you mind sending in email or attaching here?

tuicemen commented 1 year ago

the my-ecobee program hgx [homegenie_backup_20230129_115752.zip] I attempted a factory reset to start fresh and got this error) RestoreError Maybe that is related to the failed backup of 1.3-stable.19 files not completing.

tuicemen commented 1 year ago

You are already registered as homegenie on the x10 forums I believe

tuicemen commented 1 year ago

Found the reason why I got the error with the factory reset. HG reset to using port 80

genemars commented 1 year ago

Found the reason why I got the error with the factory reset. HG reset to using port 80

Thanks for reporting, I just fixed this so that it will keep the current HTTP port settings.

genemars commented 1 year ago

the my-ecobee program hgx homegenie_backup_20230129_115752.zip

I couldn't find the eco-bee program in there. It seems a backup file of a v1.4.0-beta.18 install.

tuicemen commented 1 year ago

sorry don't know how I pasted the backup :( try this 1018-My-Ecobee.hgx.txt just remove the txt extension

genemars commented 1 year ago

There isn't much that can be done than rewriting the eco-bee code in order to use the new thermostat widget. You can look at the Smart Thermostat program to see how it is implemented. The only missing fields are:

I can update the widget to display the humidity but I am not sure about what the other field means.

tuicemen commented 1 year ago

Thermostate.call is just the last time info was updated.
I was thinking the smart thermostat may be adaptable just haven't dug into it yet. The addition of humidity would be helpful.